New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Same seed on different platforms do not give same map #294
Comments
I would expect the following to be the issue: The solution in that case would be to use an integer seed instead. |
The code section in question is:
Does that really yield different hashes on different platforms? I thought this code is supposed to provide platform independent results. And even if, apparently the problem already arises with seed 0, which is an integer seed anyway? |
I've had a really busy weekend and am exhausted, but I thought I'd just check in and answer the basic question. As far as I can see, and haven't had time to test on Windows, I get the same layout of systems and placements, but the starting positions for all the empires are completely different. I need to check and confirm this but the pictures posted by both you and @Deepsloth look to be the same map, but I start near the top (where Enif Alpha is on your pic), and there's an AI (Etty) that starts at Grotto. The systems definitely have different names. Polaris has a toxic world in, and the system on your map that's deep space two jumps to the right towards Cursa Alpha has a Sentinel guarding an Ancient Ruins. So we're getting the same basic system layout, but different names, placements and similar. |
32/64 bit differences occur in boost::hash. See here: https://stackoverflow.com/questions/17426493/get-32-bit-hash-value-from-boosthash (Sorry for the drive-by comment) |
Created a PR with an attemped fix, please test: #297 |
Created a PR in another attempt to fix the issue: #298. Pls test. |
As mentioned in the discussion on PR #297, apparently some galaxy shapes do give identical maps across platforms, but not all. Elliptical seems to be fine, while spiral gives different maps. I've looked at the code for these two, and the only difference as far as use of rng functions are concerned is that spiral uses a function for gauss distribution, which elliptical does not. Another shape that uses this function for gauss distribution is ring. Here is a screenshot of seed 0 ring galaxy with all other settings on default (OSX): Please compare that to the map you get on your systems (Linux particularly). |
Seems to be identical, but IIRC Mac and Win have always been. It's on Linux where we get different results... can someone of our Liinux folks provide a screeshot (seed 0, ring, all other settings on default) for comparison? |
Linux (openSUSE 13.2 x86_64) screenshot with those settings at commit cb7b5c0: |
Yep, that further confirms my suspicion - it's the function for gauss distribution used in the C++ code that apparently yields different results on Linux. Well, I'm going to migrate the other galaxy map generator functions to Python, that should take care of the issue. |
After porting the rest of the galaxy shapes to Python, a seed 0 ring galaxy with all other settings on default looks like this on OSX (commit a1b8973): Please post screenshots from other platforms (especially Linux) for the same settings. |
Same Linux system, commit efaf3cf: |
Very good. So, I consider the problem solved so far and will close this issue. |
This issue has been brought up here.
Apparently, on Linux we get different maps from those generated on Windows and OSX with the same seed. Below is a screenshot I did of a default quickstart game with the 2015-08-10.2c00daa pre-release test build:
On Windows I get exactly the same map.
@MatGB: Pls, can you compare this screenshot to the maps you get with a default quickstart game on your Linux and Windows systems when using the above build?
@Dilvish-fo: As you're on Linux too, can you do the same on your system?
Everyone else who's on Linux, if you can test this, please do! I really want to get this issue solved for 0.4.5.
The text was updated successfully, but these errors were encountered: