On Mon, Sep 10, 2012 at 12:26 PM, Jan Comans wrote: >> We should have a random number generator in simgear that returns the >> same random number within the same period of time (I believe it was set >> to 1 second) to prevent short time quirks between different machines. >> This was specially added for (random) clouds. > > I have looked at this, but as far as I can see FG calls the regular > time seed intialization instead of the 'time period' one. I think the > period is even 10min. But I recall having some issues with giving the > whole simulation a fixed seed (either through the srand10 method or > providing a custom seed). Next to that, the time period seed relies on > the fact that system clocks are more or less in sync. Normally NTP > should take care of that, but with our sim being tweaked constantly > this is difficult to guarantee. This for me is also a reason for > providing a separate rng to handle the part that I'm interested in. > As I said before, form me this was just a quick and dirty hack to get > the results we needed. Personally, I think it would be beneficial to > put the randomness somewhere in the property tree so that the cloud > code can build 'deterministic' clouds from these values. In this way, > other FG instances could be coupled in way similar to using > --fdm=external, and just receive the basic random seeds that would > result in the same cloud fields on every instance. But that's just my > idea without having looked at the code too much.
I've committed a change to keep the clouds in sync across multi-process systems. It relies on the clocks of the systems being roughly in sync as the seed changes every 10 minutes. Thanks for pointing out the problem Jan and for your patch which gave me a simple recipe to follow of where needed change :). I've limited ability to test this myself, but certainly re-starting FG a couple of times created the same cloud-field. Note that a reset does not as the RNG seed is not re-generated. -Stuart ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel