The game has a list of NightEvents
, each with a tree of requirements and operations. Here's a representation of the tree for the APARTMENT_UPGRADE
event, which seems to trigger at the start of every night from night 12 onwards:
RUNSTEPS ? Night/Savings < 20
RUNSTEPS ? Night/Apartment == C7
SAY A cheaper class 8 apartment is available. (Rent = 25, Heat = 10)
RUNSTEPS MOVE TO CLASS-8 | 75 | NO
RUNSTEPS YES
SETFACT Night/Apartment C8
SETFACT Night/Rent -25
SETFACT Night/Heat -10
SETFACT Night/ApartmentTimer 4
RUNSTEPS ? Night/Apartment == C6
SAY A cheaper class 8 apartment is available. (Rent = 25, Heat = 10)
RUNSTEPS MOVE TO CLASS-8 | 150 | NO
RUNSTEPS YES
SETFACT Night/Apartment C8
SETFACT Night/Rent -25
SETFACT Night/Heat -10
SETFACT Night/ApartmentTimer 4
RUNSTEPS ? Night/Apartment == C5
SAY A cheaper class 8 apartment is available. (Rent = 25, Heat = 10)
RUNSTEPS MOVE TO CLASS-8 | 225 | NO
RUNSTEPS YES
SETFACT Night/Apartment C8
SETFACT Night/Rent -25
SETFACT Night/Heat -10
SETFACT Night/ApartmentTimer 4
RUNSTEPS ? Night/Savings > 20
SETFACT Night/ApartmentTimer --1
RUNSTEPS ? Night/ApartmentTimer <= 0
RUNSTEPS ? Night/Apartment == C8
SAY A class-7 apartment is available. (Rent = 30, Heat = 10)
RUNSTEPS MOVE TO CLASS-7 | -100 | NO
RUNSTEPS YES
SETFACT Night/Apartment C7
SETFACT Night/Rent -30
SETFACT Night/Heat -10
SETFACT Night/ApartmentTimer 5
RUNSTEPS NO
SETFACT Night/ApartmentTimer 2
RUNSTEPS ? Night/Apartment == C7
SAY A class-6 apartment is available. (Rent = 40, Heat = 5)
RUNSTEPS MOVE TO CLASS-6 | -100 | NO
RUNSTEPS YES
SETFACT Night/Apartment C6
SETFACT Night/Rent -40
SETFACT Night/Heat -5
SETFACT Night/ApartmentTimer 5
RUNSTEPS NO
SETFACT Night/ApartmentTimer 2
RUNSTEPS ? Night/Apartment == C6
SAY A class-5 apartment is available. (Rent = 50, Heat = 0)
SAY Class-5 is the best a worker can have.
RUNSTEPS MOVE TO CLASS-5 | -100 | NO
RUNSTEPS YES
SETFACT Night/Apartment C5
SETFACT Night/Rent -50
SETFACT Night/Heat 0
ENABLE Achievement ACH_APT_CLASS5
It seems that the game has a hidden counter that decreases by 1 each night if you have more than 20 credits for the night's opening balance (savings). Each night that opens with more than 20 credits in savings will progress you one step to being offered an apartment upgrade, which will occur when the counter reaches 0. If an upgrade is accepted, the counter resets to 5, and if declined, resets to 2.
Likewise, nights opening with fewer than 20 credits in savings will offer you the option to downgrade to class-8 if you have upgraded from class-8 in the past. Unlike upgrades, downgrades do not have a counter and will be offered any time your savings match this criterion. Should a downgrade be accepted, the upgrade counter resets to 4, no matter what progress you had previously.
The fact that this counter resets to 5 upon an accepted upgrade is supported by the previously-known info of upgrades, as the earliest possible upgrades to classes 7, 6, and 5 are each five days apart.
In conclusion, the best way to ensure you get each apartment upgrade offered as soon as possible is to end every day with at least 20 credits in savings; I would recommend leaving a safe margin of about 5 credits by aiming for 25 credits.