That was my first thought, and in theory yes it's deterministic. But when I sat down to code it, I realised there's a bunch of factors that make it way more complicated:
- Cities produce set amounts in cycles over time, so can "run out" of stuff if trains take more than the city produces.
- Trains make less money when they deliver to a city that already has enough of the stuff than it needs to progress to the next level.
- It's possible to get a station upgrade automatically level's up a city.
- Trains actually take twice: Once when they arrive at a station, once just before they leave, in case the city produces while they are waiting, and assuming they're not already full.
The choice was either to replicate the entire business logic of the game for the offline progress. But then any time I fix a bug or make a change, I'd have to change everything in two places. Or refactor the game to allow it to step through the simulation without firing off UI events, resetting timers etc. Plus deal with edge cases like the player winning or triggering an achievement during the offline mode calculation.
At that point, it was too complicated and I was aiming for just a regular Steam app. So I parked it and said maybe I'll come back if/when I do a web/browser build. In the meantime the game launched on Steam and hasn't done well enough to justify the effort. Making a web build has proved to be more than just the one day's work I thought it'd be. My thinking was to upload the web build now that it is made, gauge the reaction and then decide if it's worth working on the game more or parking it again and taking the lessons to make a new game.