I just started the game recently (about ten minutes of play), so I might have missed some details. But here’s my thought on offline progress calculations:
Since the game already knows the distance between towns and the train speed, it should be possible to determine the exact time required for any route.
Based on that, we could maintain a heap of scheduled events — such as train route completions or resource productions — ordered by their NextEventOccurTime.
Each time the system should pop an event from heap. Then:
-
Calculate the income gained, city demand fulfilled, and resources consumed
-
Reinsert the event into the heap with its updated NextEventOccurTime
The simulation would continue until NextEventOccurTime > TotalOfflineProgressTime.
This approach allows the game to approximate offline progress deterministically without simulating every frame or tick, which should make it computationally efficient.