Removal of unneeded stuff

Removal of unneeded stuff

Discussion between Spring developers.
Post Reply
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Removal of unneeded stuff

Post by Auswaschbar »

Preprocessor flag: SYNCCHECK
Can I remove this flag and compile it every time? A build without it is not useful imho

Preprocessor flag: TRACE_SYNC
Whats the difference between this and SYNCCHECK?

Config variable: Map archives
Do I remember right that it is not possible to store more than one map in an archive because of checksum errors? Why should we keep this option then?

To be continued...

Some feedback would be nice
Thanks
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Removal of unneeded stuff

Post by Tobi »

Auswaschbar wrote:Preprocessor flag: SYNCCHECK
Can I remove this flag and compile it every time? A build without it is not useful imho
Hmm, IIRC SYNCCHECK conflicts with SYNCDEBUG (which is broken btw), so I don't think removing it too soon is a good idea.
Preprocessor flag: TRACE_SYNC
Whats the difference between this and SYNCCHECK?
TRACE_SYNC creates an enormous trace file that can be diff'ed against trace file of other clients to narrow down desync. Basically this is made obsolete by the SYNCDEBUG #define (if it worked that is 8))

SYNCCHECK only enables checking whether clients are in sync, no debugging stuff like TRACE_SYNC has. (SYNCCHECK is enabled by default while TRACE_SYNC is disabled by default)
Config variable: Map archives
Do I remember right that it is not possible to store more than one map in an archive because of checksum errors? Why should we keep this option then?
No, this is not for that issue. This just enables/disables whether archives in the root of the Spring data directories are mapped into the VFS.

IMHO this option could be removed together with that automatic mapping: In Spring we got .sdz/.sd7/.sdd after all and a fairly established way to switch mods etc, so I don't think there is much use for mapping every archive in the root of the data directory into the virtual file system (plus this mapping may cause desync in MP games if you forget to remove the archives).
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Post by Auswaschbar »

Random number generators:
Does anybody know how much RNGs do we have in spring? I know at least 4:
struct UnsyncedRandomNumberGenerator (GameSetup.cpp)
class CRandomNumberGenerator (GameServer.cpp)
the one from CGlobalSyncedStuff
and one from CGlobalUnsyncedStuff
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I think that's about it. Though I didn't even recall the GameServer one so I may forget others too...

I know there is one in streflop too but since that's basically a third party library (even though made specifically for Spring) it doesn't count.

One thing to watch out for with the RNGs is the randomness, the one in GameSetup.cpp is specifically made to be random with low numbers too:
When I used rand() % numTeams in it I always got the same startposition setup, but when I used (int)((double)rand() / RAND_MAX * numTeams) the startpositions were properly randomized.

In the end though I think one class could do it all (with a global synced and a global unsynced instance, and maybe an instance in gameserver, since it's a different thread), especially if it also has operator() so it can be used as functor in e.g. std::shuffle.
Post Reply

Return to “Dedicated Developer Discussion”