MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002583VCMIMultiplayerpublic2016-10-30 22:302017-05-22 22:08
ReporterSXX 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
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
(0006984)
Dydzio (developer)
2017-03-15 21:30

http://stackoverflow.com/questions/34903356/c11-random-number-distributions-are-not-consistent-across-platforms-what-al [^]

Seems we need to write custom consistent distribution (best way imo) or use boost or equivalent like http://www.pcg-random.org/ [^] for random number generation.
(0006985)
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.
(0006987)
Dydzio (developer)
2017-03-17 09:43

@Warmonger

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

There are some typedefs used, defined at the top of lib/CRandomGenerator.h
(0006995)
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: 10M.zip
2017-05-22 22:08 SXX File Added: 20M.zip
2017-05-22 22:08 SXX File Deleted: 20M.zip
2017-05-22 22:08 SXX File Deleted: 10M.zip

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean