SimulationProcessTick

From sc2k-reverse
Revision as of 06:21, 14 March 2025 by NotAnyoneSpecial (talk | contribs) (added info from araxestroy from the forum to start page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Every month is split into 25 ticks (otherwise known as days) that need to be processed before moving on to the next month, each tick processes different things in the Simulator:

  • Day 1: Calculate budget updates for the last month. If it's March or July and the "Subscription" newspaper option is selected, generate and show a non-alert newspaper. Update some of the calendar variables in the simulation state. Push the monthly graph stack back one month.
  • Day 2: Update power consumption for cities over 50,000 (not really required after commits 2a3f72c and 020133b).
  • Day 3: I haven't gotten through this one yet but I think it's what updates things like crime and pollution and other components stored as 64x64 and 32x32 blocks of data. This might also be where the game figures out what exactly constitutes "downtown", I'm still pulling that apart.
  • Day 4: Growth tick, stepping (0, 0).
  • Day 5: Growth tick, stepping (0, 1).
  • Day 6: Growth tick, stepping (0, 2).
  • Day 7: Growth tick, stepping (0, 3).
  • Day 8: Growth tick, stepping (1, 0).
  • Day 9: Growth tick, stepping (1, 1).
  • Day 10: Growth tick, stepping (1, 2).
  • Day 11: Growth tick, stepping (1, 3).
  • Day 12: Growth tick, stepping (2, 0).
  • Day 13: Growth tick, stepping (2, 1). Advance the season if it's March, June, September, or December.
  • Day 14: Growth tick, stepping (2, 2).
  • Day 15: Growth tick, stepping (2, 3).
  • Day 16: Growth tick, stepping (3, 0).
  • Day 17: Growth tick, stepping (3, 1).
  • Day 18: Growth tick, stepping (3, 2).
  • Day 19: Growth tick, stepping (3, 3).
  • Day 20: Update traffic data for the month. I think.
  • Day 21: Update water consumption for cities over 50,000 (not really required after commits 2a3f72c and 020133b).
  • Day 22: Update RCI demands. Theoretically do radioactive decay and forest growth (so rare it's practically a zero chance). Potentially display some Extra! newspapers depending on what's happening in the city and things like the national trend. Process new inventions if it's January. Update weather. Simulate the national and city economies (yes, that's vague, I haven't gotten through it all). Update graphs.
  • Day 23: Grant rewards for city progression, including military base proposal. Check for scenario victory/failure conditions. Check for city bankruptcy (funds hitting -$100,000).
  • Day 24: Redraw the entire screen (not really required after commit 67b67c3). Do some MFC window updates/invalidates.
  • Day 25: Do some more MFC window updates/invalidates. Determine upcoming city crisis and whether it's just a "residents demand XYZ" type crisis or a full-blown disaster.