RESOLVED : HomeWorlds being created on moon Bug.

[RSS]
Author: bearclaw
Date: Mar 17, 2022 2:18 AM
Category: Spaceport
Posts: 6
#1
Alright, after a LOT of testing and a LOT of input from bunches of people, the Homeworld bug has been identified!!!

Here's what happens: There is a bug in the code. When a map is generated using data files NOT in the default stock data folder, it ignores the Planet Size field in the SystemTypes.txt file and every planet ends up using the ANY setting for the size.

I was able to confirm this by copying the stock data files, creating a "mod" with no changes and sure enough, this is exactly what happens.

When I do the reverse and copy a modded version to the default Data folder (backing up first, of course) then map generation follows the settings of the mod for planet sizes.

In short, if you want maps that will avoid the HomeWorld Bug, generate it from the Default Data Folder, NOT a mod data folder.

***JUST BE SURE TO BACKUP YOUR STOCK DATA FILES!***

This primarily affects mods using FQM because it adds a lot of moons to planets but it will happen to any Mod, even if using Stock system/planet generation files.

Why does this happen?
Heres what we've been able to discover.

The game randomly generates a map and then randomly assigns starting systems. It seems to search within 1 warp point for an appropriate planet size, type, and atmosphere for that player (that seems to be why sometimes you can start with more than home system seen).

Here's the problem: the game checks for ALL planets (including moons) for a match, however, it appears to be hardcoded that home world's cannot be on a moon (xxx A, xxxx B, etc). But if a moon was the match that's when the error happens and the game forces the HomeWorlds to be in the wrong planet.

Not sure if that makes a lot of sense, but there you go.

I have a modified SystemTypes.txt file for FQM (not Mod specific) that makes changes so that moons cannot be larger than their mother planet, but it only will work correctly if maps are generated from the Default Stock Data folder.

Not a fix, but at least it's a solution that works.

Replies

Commenter: TheCulture
Date: Mar 17, 2022 6:14 AM
RESOLVED : HomeWorlds being created on moon Bug.
#2
Excellent sleuthing Bearclaw.
TheCulture
Commenter: Cipher
Date: Mar 17, 2022 8:50 AM
RESOLVED : HomeWorlds being created on moon Bug.
#3
Hear. Hear. I'm very glad we finally know the answer.
Commenter: bearclaw
Date: Mar 17, 2022 11:35 AM
RESOLVED : HomeWorlds being created on moon Bug.
#4
I can't take credit for this. Spoon (Spork), The Chin, marhawkman, MysticVoid7x9 (Discord), and MageKing17 (Discord) all provided insights and assistance in finding this bug. It wasn't an easy one to find.

But, now that its known, I want this to be as well known as possible to help everyone still playing this awesome game to have better results when creating games and maps.

SPREAD THE WORD!!
Commenter: Kamar
Date: Mar 17, 2022 9:28 PM
RESOLVED : HomeWorlds being created on moon Bug.
#5
What an awesome community team effort! Thanks for sharing. You guys rock (or gas or ice... whatever your preference is)!
Edited 1 time(s). Lasted edited Mar 17, 2022 9:28 PM.
Commenter: NeuroCPU
Date: Mar 18, 2022 9:07 AM
RESOLVED : HomeWorlds being created on moon Bug.
#6
".. search within 1 warp point for an appropriate planet size, type, and atmosphere for that player (that seems to be why sometimes you can start with more than home system seen)."

neighbour systems (withing 1 warp point) are included as candidates if starting planet number >1 (game settings). Neighbours of neigbour are included (i.e. within 2 warp points) if total system count of generated galaxy is bigger than 60% of galaxy max system number (game settings)

".. if a moon was the match that's when the error happens and the game forces the HomeWorlds to be in the wrong planet."

each game empire (besides homeplanettype and atmospheretype) has system id-position value pair (coordinate, i.e. (5;58)) pointing empire's "true" homeworld (1-1 relation). But system stores it's structure as a list of owned object id's, therefore system-position pair is converted into object id at that coordinate. Conversion sequentually checks system list for position match and non asteroid object - first matching object id is returned as a result.
And if homeworld's position has several planets...
Edited 1 time(s). Lasted edited Mar 18, 2022 9:17 AM.