Closed BenjaminAmos closed 1 year ago
@IsaiahBlanks, would you be interested in verifying this change? I'm not very familiar with the new world generation, so I might have made some mistakes somewhere.
These changes appear to work and are an improvement over the previous behaviour, so I see no issues in merging this right away.
Description
When #607 was merged, it broke the determinism of world generation. This means that continuing an existing save would often end-up generating a completely different system than the one that was present when the game was saved. The precise reason for this issue is because the ordering of types returned by
ModuleEnvionment::getSubtypesOf
is undefined. I often found that the exact ordering of types in the returned list changed every time the game was run. The galaxy generation code is very sensitive to the ordering of these lists.A simple solution to this problem would be to sort the lists by type name. This would not help though if additional feature generators were added later-on, since they could change the list ordering and size again. Because of this, I decided to save the generators used with the world configuration instead. This does mean that you will have to start a new game to see any new system/feature generators in use though.
I also updated some occurences of publicly-facing
ArrayList<T>
methods to the more genericList<T>
inGalaxyBuilder
, since I was modifying that code anyway.It appears that some world generation tests were commented-out in #622. This pull request also restores those stubbed tests with working implementations again.
Testing
Notes