Huge patch from viktor muraviev
Moderator: Moderators
- SwiftSpear
- Classic Community Lead
- Posts: 7287
- Joined: 12 Aug 2005, 09:29
- clericvash
- Posts: 1394
- Joined: 05 Oct 2004, 01:05
The Spring non-ExternalAI part of the patch looks pretty much OK, apart from some minor points:
- It does not compile with any of the configurations in VS8 (some libs are missing from his project file and some files weren't properly marked as not using PCHs). Did it compile without changes for you JC?
- It probably does not compile on Linux either (#include "smath.h" instead of #include "SMath.h"), but this should be minor stuff to fix.
- Some stuff that has intentionally not been changed by us, like adding a hyphen "-" between unit name and unit description (because various mods already include a separator in the description).
- Many stuff that's supposed to be removed/changed just has the old code commented out.
Last edited by Tobi on 20 Jun 2007, 12:36, edited 1 time in total.
There might be different methods but a long time back on the mailing list it was agreed that the best way for spring would be to save the game on all pc's, then use a tool called rsync to make sure everyone has the same savegame, and load the game again.
EDIT: It compiled ok with the release mode in vs8, but otherwise i haven't tested. I also had a discussion with trepan about std::set<Pointer> causing desyncs. That might have been why he changed a lot of stuff to std::list, but this does not scale well with the number of units. IMO someone should create a hash_unit_set or something, to sort unit pointers by unit ID.
EDIT: It compiled ok with the release mode in vs8, but otherwise i haven't tested. I also had a discussion with trepan about std::set<Pointer> causing desyncs. That might have been why he changed a lot of stuff to std::list, but this does not scale well with the number of units. IMO someone should create a hash_unit_set or something, to sort unit pointers by unit ID.
Could just use std::map<int, CUnit*> (where the int is the unit ID) I guess. But encapsulating it in a unit_set would be cleaner definitely.jcnossen wrote:EDIT: It compiled ok with the release mode in vs8, but otherwise i haven't tested. I also had a discussion with trepan about std::set<Pointer> causing desyncs. That might have been why he changed a lot of stuff to std::list, but this does not scale well with the number of units. IMO someone should create a hash_unit_set or something, to sort unit pointers by unit ID.
EDIT: as for the resync, I don't remember what exactly was discussed on the mailing list, but at this moment I'd prefer a resync solution that is closer to the actual game data, so it can actually give useful debugging output to fix the sync error. (ie. checks to see whether the loaded unit is any different from the to be deserialized unit)
Wouldn't that require yet another way of serializing all game data? I think you might get what you want by loading the old and new savegame to seperate structures for comparison.. Should be possible with a bit of work on the save/load code (it would only require some new code in LoadSaveHandler I think, nothing else).EDIT: as for the resync, I don't remember what exactly was discussed on the mailing list, but at this moment I'd prefer a resync solution that is closer to the actual game data, so it can actually give useful debugging output to fix the sync error. (ie. checks to see whether the loaded unit is any different from the to be deserialized unit)
Noiddq? wrote:Would the "Added max time diff" cause clocks to go out of sync in a multiplayer game if one player was lagging and the others weren't?
At worst you disconnect earlier if your PC really can't handle it, but I'm not sufficiently into the intrinsics of the code to change game speed based on CPU load.
Committed everything below rts/ apart from rts/build/vstudio8 as I need to test that better on Windows (and I'm on Linux now).
Fixed some things here and there and left some to do's open, see commit message:
http://spring.clan-sy.com/fisheye/chang ... g/?cs=3826
Fixed some things here and there and left some to do's open, see commit message:
http://spring.clan-sy.com/fisheye/chang ... g/?cs=3826
Cuppy needs to buy the http://www.viktor-muraviev-is-a-god.com domain now!!