SimulationProcessTick: Difference between revisions

From sc2k-reverse
Jump to navigationJump to search
added info from araxestroy from the forum to start page
 
m converted list into table, should be replaced with a list of functions eventually
 
Line 1: Line 1:
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:
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.
{| class="wikitable"
*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 !!
*Day 4: Growth tick, stepping (0, 0).
|-
*Day 5: Growth tick, stepping (0, 1).
|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 6: Growth tick, stepping (0, 2).
|-
*Day 7: Growth tick, stepping (0, 3).
|2 || Update power consumption for cities over 50,000 (not really required after commits 2a3f72c and 020133b).
*Day 8: Growth tick, stepping (1, 0).
|-
*Day 9: Growth tick, stepping (1, 1).
|3 || Updates things like crime and pollution and other components stored as 64x64 and 32x32 blocks of data. Possibly also determines what constitutes "downtown".
*Day 10: Growth tick, stepping (1, 2).
|-
*Day 11: Growth tick, stepping (1, 3).
|4 || Growth tick, stepping (0, 0).
*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.
|5 || Growth tick, stepping (0, 1).
*Day 14: Growth tick, stepping (2, 2).
|-
*Day 15: Growth tick, stepping (2, 3).
|6 || Growth tick, stepping (0, 2).
*Day 16: Growth tick, stepping (3, 0).
|-
*Day 17: Growth tick, stepping (3, 1).
|7 || Growth tick, stepping (0, 3).
*Day 18: Growth tick, stepping (3, 2).
|-
*Day 19: Growth tick, stepping (3, 3).
|8 || Growth tick, stepping (1, 0).
*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).
|9 || Growth tick, stepping (1, 1).
*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).
|10 || Growth tick, stepping (1, 2).
*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.
|11 || Growth tick, stepping (1, 3).
|-
|12 || Growth tick, stepping (2, 0).
|-
|13 || Growth tick, stepping (2, 1). Advance the season if it's March, June, September, or December.
|-
|14 || Growth tick, stepping (2, 2).
|-
|15 || Growth tick, stepping (2, 3).
|-
|16 || Growth tick, stepping (3, 0).
|-
|17 || Growth tick, stepping (3, 1).
|-
|18 || Growth tick, stepping (3, 2).
|-
|19 || Growth tick, stepping (3, 3).
|-
|20 || Update traffic data for the month.
|-
|21 || Update water consumption for cities over 50,000 (not really required after commits 2a3f72c and 020133b).
|-
|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. Update graphs.
|-
|23 || Grant rewards for city progression, including military base proposal. Check for scenario victory/failure conditions. Check for city bankruptcy (funds hitting -$100,000).
|-
|24 || Redraw the entire screen (not really required after commit 67b67c3). Do some MFC window updates/invalidates.
|-
|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.
|}

Latest revision as of 11:40, 24 March 2025

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.
2 Update power consumption for cities over 50,000 (not really required after commits 2a3f72c and 020133b).
3 Updates things like crime and pollution and other components stored as 64x64 and 32x32 blocks of data. Possibly also determines what constitutes "downtown".
4 Growth tick, stepping (0, 0).
5 Growth tick, stepping (0, 1).
6 Growth tick, stepping (0, 2).
7 Growth tick, stepping (0, 3).
8 Growth tick, stepping (1, 0).
9 Growth tick, stepping (1, 1).
10 Growth tick, stepping (1, 2).
11 Growth tick, stepping (1, 3).
12 Growth tick, stepping (2, 0).
13 Growth tick, stepping (2, 1). Advance the season if it's March, June, September, or December.
14 Growth tick, stepping (2, 2).
15 Growth tick, stepping (2, 3).
16 Growth tick, stepping (3, 0).
17 Growth tick, stepping (3, 1).
18 Growth tick, stepping (3, 2).
19 Growth tick, stepping (3, 3).
20 Update traffic data for the month.
21 Update water consumption for cities over 50,000 (not really required after commits 2a3f72c and 020133b).
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. Update graphs.
23 Grant rewards for city progression, including military base proposal. Check for scenario victory/failure conditions. Check for city bankruptcy (funds hitting -$100,000).
24 Redraw the entire screen (not really required after commit 67b67c3). Do some MFC window updates/invalidates.
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.