|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004572||Spring engine||General||public||2014-10-05 12:55||2016-11-05 21:46|
|Target Version||Fixed in Version|
|Summary||0004572: random number generator is not random in pregame|
|Description||In 97.0.1-458 I get the same sequence of random numbers (in synced luarules) each time I start Spring. |
The only thing I've found which changes the sequence of "random" numbers produced is changing the map - changing the number of players and various other things did not.
In 96.0 I get a different sequence of random numbers, even if I don't change anything. (I have a randomized spawning gadget which depends on this behaviour.)
|Steps To Reproduce||see attached gadget|
I am not sure how to provide more info; let me know if/what more is useful.
|Additional Information||I am not seeding the synced random number generator (in 96.0 there was no need too). Am I supposed too? If so, with what?|
|Tags||No tags attached.|
|Checked infolog.txt for Errors|
for i=1,10 do
since a while the pathcache is created after lua is initialized, i guess this is why there is no randomness before pathcache is created, else the pathcache would be invalid!?
not sure if this can be fixed in a clean way to have real random numbers before path cache is created.
|is this still a major "bug" then?|
Yes, you are right, it seems that (synced) gadget:GameStart() produces randomness but gadget:Initialize() does not.
This is enough for my current purpose, so I'll leave it to you to judge if its safe to release without finding the cause of this - I don't know enough to judge if there is a desync risk hiding somewhere here.
It seems LuaIntro does not have randomness either (even though the random number generator is seeded with os.clock() in /luaintro/config.lua).
In 98.0, the loadscreen shown is always the same (e.g. BA 8.06).
|Fixed AFAIK - LuaIntro screens are random|
|2014-10-05 12:55||silentwings||New Issue|
|2014-10-05 12:55||silentwings||File Added: testbed.lua|
|2014-10-05 13:11||abma||Target Version||=> 98.0|
|2014-10-05 17:40||abma||Note Added: 0013705|
|2014-10-05 17:57||abma||Summary||random number generator is not random => random number generator is not random in pregame|
|2014-10-05 17:57||abma||Note Added: 0013706|
|2014-10-05 17:57||abma||Status||new => feedback|
|2014-10-05 18:22||silentwings||Note Added: 0013707|
|2014-10-05 18:22||silentwings||Status||feedback => new|
|2014-10-05 18:37||abma||Target Version||98.0 =>|
|2014-10-07 18:51||abma||Severity||major => minor|
|2014-10-28 02:32||silentwings||Note Added: 0013778|
|2016-11-05 21:46||hokomoko||Assigned To||=> hokomoko|
|2016-11-05 21:46||hokomoko||Status||new => resolved|
|2016-11-05 21:46||hokomoko||Resolution||open => fixed|
|2016-11-05 21:46||hokomoko||Note Added: 0016856|