> I haven't had the chance to look at your fix beyond viewing the diffs, but at > first glance I'm slightly surprised it works across multiple > machines/instances. > I would expect that differences in initialization time would mean that at any > given moment in time some instances would have made more calls to mt_rand > than others, resulting in different generated numbers, even if they all > started > with the same seed. > > Is this something you've had to resolve, or is it simply not an issue > because the > only calls that truly matter are the initial calls to determine cloud > placement?
My first try was to just switch to a fixed seed with the default random number generator during initialization. But for some reason, this didn't really work out so well. I can't exactly remember, but I think it seemed to work on my home machine, but failed in our simulator. Then I decided to create a second rng which always initializes with a fixed seed ( either 1 or the value of FGRANDOMSEED). Then I just replaced all request for a random number with a call to this new rng. I just hoped that the clouds didn't depend on any variables that rely on the other rng somewhere along the way. But apparently this doesn't happen and the clouds come out the same on each machine/instance. We do have to be careful with initializing FlightGear of course. Slight differences in command line parameters result in wrong cloud fields. This is basically the reason why I referred to my patch as a hack. Changing the weather on the fly doesn't work at the moment because there is no way we can do exactly the same in each weather dialog on every machine. This would require a more fundamental change in the cloud generation code. > I'm currently up to my elbows in the random buildings code, but once I've > completed that job I will look at your fix in more detail and work out how > best > to integrate it. I know the feeling :) At the moment I don't have a lot of time to spend since I'm finalizing my experiment which should run in a couple of weeks. But once I get some time I'll try to look at the code a bit more and see if I have some ideas. I'll get in touch when I get to it. Cheers, Jan ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel