View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002583VCMIMultiplayerpublic2016-10-30 22:302017-05-22 22:08
Assigned To 
PlatformOSOS Version
Product Version0.98g 
Target VersionFixed in Version 
Summary0002583: Multiplayer: RNG distribution is not consistent between compilers / platforms
DescriptionToday we tested some MP with dydzio and one thing we find out is that map init could desync even if seed perfectly match. We use "mt19937" and it's do it's just very well.

While I did very little research it's looks like std distribution functions don't have deterministic results across platforms and compilers.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
Dydzio (developer)
2017-03-15 21:30 [^]

Seems we need to write custom consistent distribution (best way imo) or use boost or equivalent like [^] for random number generation.
Warmonger (administrator)
2017-03-16 17:28

Where exatly do we use random distributions? I don't remember any case, so probably it's not that important part after all.
Dydzio (developer)
2017-03-17 09:43


Check lib/CRandomGenerator.cpp -> CRandomGenerator::getIntRange for example.

There are some typedefs used, defined at the top of lib/CRandomGenerator.h
SXX (administrator)
2017-03-19 02:48

Keep in mind that integers are not problem there, but float are.

- Issue History
Date Modified Username Field Change
2016-10-30 22:30 SXX New Issue
2017-03-15 21:30 Dydzio Note Added: 0006984
2017-03-16 17:28 Warmonger Note Added: 0006985
2017-03-17 09:43 Dydzio Note Added: 0006987
2017-03-19 02:48 SXX Note Added: 0006995
2017-05-22 22:02 SXX File Added:
2017-05-22 22:08 SXX File Added:
2017-05-22 22:08 SXX File Deleted:
2017-05-22 22:08 SXX File Deleted:

Site | Forums | Wiki | Slack | GitHub

Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean