View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0002225 | Spring engine | General | public | 2010-11-20 13:49 | 2010-11-20 22:20 | ||||
Reporter | SirMaverick | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 0.82.6.1 | ||||||||
Target Version | Fixed in Version | 0.82.7 | |||||||
Summary | 0002225: CGlobalUnsynced random seed not really random | ||||||||
Description | CGlobalUnsynced is seeded by SDL_GetTicks. SDL_GetTicks() is number of milliseconds since SDL library initialization. In SpringApp::Initialize() CGlobalUnsynced is created 3 lines after call to InitWindow which initializes SDL. Chances are that, on a fast CPU, this is done in under a millisecond - you will seed with 0. This seed is later used in GameData which is broadcasted by GameServer to seed CGlobalSynced's random function. So you'll have (with high probability) the same random number sequence in each run. Using a more random source might be useful. E.g. time? | ||||||||
Additional Information | http://springrts.com/phpbb/viewtopic.php?f=23&t=24563 | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2010-11-20 13:49 | SirMaverick | New Issue | |
2010-11-20 22:20 | Kloot | Note Added: 0005887 | |
2010-11-20 22:20 | Kloot | Status | new => resolved |
2010-11-20 22:20 | Kloot | Fixed in Version | => 0.82.6.1+git |
2010-11-20 22:20 | Kloot | Resolution | open => fixed |
2010-11-20 22:20 | Kloot | Assigned To | => Kloot |