Continuing replay might be easiest way for save/load but I dont think it is worth it. It might be so impracticable nobody will use it.
Think what kind of games will player want to save/load? Probally not small games that were running for 5 minutes.
Mostly it will be games that were going on for a loooong time and now you do not want to lose hours of playing. Players will not use save/load when it takes dozens minutes.
Better is imo writing all unit positions etc to a file.
zwzsg did that years ago and it worked. (engine changes broke it but that was things unrelated to the actual save/load) Instead of saving to a script.txt it should save to a lua file though.
There were/are some problems:
1) unitIDs could not be kept - since some time they can, CreateUnit() got new parameter: solved.
So now can easier save command queues etc.
2) saving/loading the state of Lua all at once is not possible.* Would have to do it for each thing indivually: too much work. BUT: Most gadgets actually use UnitRules and save/loading that should be a lot easier. (can loop over it)
IMO it would be good enought if at first some things are not saved. (say a burning unit now longer burns after save/load) It could be done step by step...
*I wonder if it was possible to put everything into a table like instead of
local x=5 you have
local T.x=5 Then one would just have to loop over the keys/values of T?
3) Frame counter starts over at 0. Probally fixeable by something like
Spring.GetGameFrame()+frameWhenGameWasEnded4) unitscripts: variables, running threads etc. Might not matter much though.
5) CEG effects: not possible to read at all.
---
quote: you can just drag the 'end battle' screens off to the corner and keep playing. |
Type /endgraph into chat to hide it.