ewjordan wrote:
CommanderKeith is working out some of this in Java, but I think his solution is extremely Java specific.
Hi,
My way of saving state just invloves making a copy of the World by saving every single field in World and all its field's fields etc. The method I'm using is automatic - uses reflection to read and copy every object's fields. Isn't there something similar in other languages?
Erin gave me the idea to do this back when I asked if negative time updates were possible to go backwards in time and he said no, but that if you saved game state like 'prince of persia' then you can go back to the saved world and update forward to where you want to be. That's pretty much what I did (of course there are complications and I haven't quite got it to work with JBox2D yet, but it works with more simple things).
Cheers,
Keith
PS: I think XML is the wrong way to go, it would be too slow and with all of the parsing it would only be a solution for saving and loading games, not really for sync'ing server and client worlds by sending the whole game world to clients many times per second.