SaveGame - Page 2

SaveGame

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: SaveGame

Post by SpliFF »

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.
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: SaveGame

Post by el_matarife »

SpliFF wrote: For a "reality check" test I downloaded this replay which is a 1h 38m 8-way CA on The Hunters 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.
That's a a lot longer than most regular games though. If the 10x realtime number you're getting there is accurate, I think it might be viable to pause/resume or join games in progress up to 30 minutes in with no problems.
YHCIR
Posts: 190
Joined: 12 Aug 2006, 23:06

Re: SaveGame

Post by YHCIR »

FWIW, I have found that if I run a replay above 4x or 5x speed, after a minute or two, it has a massive delayed response to input, and I can't slow it down.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: SaveGame

Post by zwzsg »

But at least now pause works.
Post Reply

Return to “Lua Scripts”