Re: SaveGame
Posted: 26 Apr 2009, 13:27
Great tip Beherith, thanks.
Did some benchmarking using /skip
The limiting factor in the end wasn't strictly unit count, but unit pathing. There was only a marginal speed different between 10 units and 500, however speed falls off by approximately 100x if all 500 land units are patrolling. Both tests were strictly single player (no active AI) so measurements do not include projectiles, attack manuevering or AI logic.
For a "reality check" test I downloaded this replay which is a 1h 38m 8-way CA on The Hunders v3. Skipping to the end took about 10 - 15 minutes (I left the room and missed the end of the countdown). I doubt most people would be patient enough to use this on a regular basis.
The only solution I can see would be a major rewrite of the pathing system and possibly the projectile system as well. Since replays have the benefit of hindsight there may be some opportunities for caching or selective processing. One example would be to store the results of expensive computations in the replay. For example you could store a bitfield value of 1 each time a projectile has an effect on the sim state (ie, interacts with something other than terrain). That way you could remove projectiles that miss from further computation. This would have to be done with utmost care to ensure no side-effects with Lua or interceptors (like missile defense).
On the positive side I did notice that my CPU usage never went over 55% during playback so there may be opportunities to improve CPU usage (especially across multiple cores).
I think this more or less explains why this hasn't been done. On one hand you have a hit-and-miss attempt to store important state statically and on the other you have potential loading times that exceed the actual playing time of your average game.
Did some benchmarking using /skip
The limiting factor in the end wasn't strictly unit count, but unit pathing. There was only a marginal speed different between 10 units and 500, however speed falls off by approximately 100x if all 500 land units are patrolling. Both tests were strictly single player (no active AI) so measurements do not include projectiles, attack manuevering or AI logic.
For a "reality check" test I downloaded this replay which is a 1h 38m 8-way CA on The Hunders v3. Skipping to the end took about 10 - 15 minutes (I left the room and missed the end of the countdown). I doubt most people would be patient enough to use this on a regular basis.
The only solution I can see would be a major rewrite of the pathing system and possibly the projectile system as well. Since replays have the benefit of hindsight there may be some opportunities for caching or selective processing. One example would be to store the results of expensive computations in the replay. For example you could store a bitfield value of 1 each time a projectile has an effect on the sim state (ie, interacts with something other than terrain). That way you could remove projectiles that miss from further computation. This would have to be done with utmost care to ensure no side-effects with Lua or interceptors (like missile defense).
On the positive side I did notice that my CPU usage never went over 55% during playback so there may be opportunities to improve CPU usage (especially across multiple cores).
I think this more or less explains why this hasn't been done. On one hand you have a hit-and-miss attempt to store important state statically and on the other you have potential loading times that exceed the actual playing time of your average game.