Universe Generation Errors

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
UrshMost
Space Kraken
Posts: 123
Joined: Fri Jul 03, 2015 2:32 am
Location: Great White North Eh

Universe Generation Errors

#1 Post by UrshMost »

Is anyone else getting a message about universe generation errors at startup on the 09-28-6d72e6a win32 build?
Attachments
universe errors.jpg
universe errors.jpg (19.18 KiB) Viewed 880 times
Windows 10 64bit, AMD 8 Core, 16 GB
Nvidia GTX 670 @ 3240x1920
FreeOrion Build: Latest Windows Test Build

UrshMost
Space Kraken
Posts: 123
Joined: Fri Jul 03, 2015 2:32 am
Location: Great White North Eh

Re: Universe Generation Errors

#2 Post by UrshMost »

Ok, after some quick testing it happens every time when I choose 'random' for the galaxy shape in setup options. Choosing any specific shape seems to work fine.

error messages from the log file:


2015-09-28 16:43:35.253579 [debug] Server : random Star system positions calculated, final number of systems: 300
2015-09-28 16:43:35.253579 [error] Server : Python calc_planet_size: Pick planet size failedfreeorion.galaxyShape.random
2015-09-28 16:43:35.253579 [error] Server : Python calc_planet_size: Pick planet size failedfreeorion.galaxyShape.random

the error repeats for a few hundred lines.
Windows 10 64bit, AMD 8 Core, 16 GB
Nvidia GTX 670 @ 3240x1920
FreeOrion Build: Latest Windows Test Build

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Universe Generation Errors

#3 Post by MatGB »

Guess: when Vezzra added 'disc' and renamed a few the random function wasn't updated.

Edit: just tested, exact same error on Linux compiled today
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Universe Generation Errors

#4 Post by Vezzra »

The "random function" isn't the problem here, it's written in a way that "automatically" adjusts if you add/remove/change galaxy shapes. The error also doesn't happen during system placement, but, as the error message indicates, when the planets get generated. It must have been around for a very long time now, I assume since the GALAXY_SHAPE_MOD_TO_PLANET_SIZE_DIST universe table has been introduced, because this is what fails: it doesn't contain an entry for the "random" shape, as "random" isn't really a shape, but an instruction for the universe generation process to randomly pick one of the shapes.

Which the system placement function does, but the picked shape does not get written back to the galaxy setup options data structure. When the function that generates the systems contents reads the galaxy shape from that data structure, it gets "random" again of course. This is passed that to the function that determines the planet size, which promptly fails when trying to access the entry for "random" in the GALAXY_SHAPE_MOD_TO_PLANET_SIZE_DIST, as it doesn't exist. Apparently that didn't trigger any error with the old universe table implementation, I assume when no matching entry was found in a universe table, it just failed silently and returned a default value (0 I guess).

But with the new implementation, when Python tries to reference an index value not present in that table (which is now a Python map), an exception is triggered. It gets caught in the universe generation code and fails "safely" by continuing with a default value of 0 (which isn't a problem, as that table contains only 0 values anyway), but it doesn't fail silently anymore, it registers and logs an error.

When universe generation finishes it checks if any errors have occurred, and if so, the message box UrshMost has seen is displayed. In this case it can be safely ignored, as the error doesn't make any difference. But of course this must be fixed.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Universe Generation Errors

#5 Post by Vezzra »


Post Reply