Skip to content
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

Improve random system generation, load custom systems from JSON #5622

Merged
merged 29 commits into from
Oct 8, 2023

Conversation

sturnclaw
Copy link
Member

@sturnclaw sturnclaw commented Sep 6, 2023

This is a prerequisite PR for the system editor which happens to bring some nice standalone features to the table. I've significantly improved the way custom system definitions are loaded and used in system generation, made several opinionated changes to improve the results of system generation, and added JSON as the preferred format for loading custom systems.

Custom System Improvements:

I've mostly focused on reducing the amount of cruft and duplicated effort in custom system handling (as a natural consequence of adding an in-engine editor for custom system files). This results in reproducible round-trip loading and saving of custom system files (in JSON only) and reduces the amount of "knock on" changes tweaking a parameter has on random generation.

As part of this effort, all systems and bodies now receive a seed value for increased determinism in random generation instead of using the system or body index (which would create an implicit dependency on the rest of the sector or system). The number of randomly generated parameters in a system definition are reduced and responsibility for generating "missing" parameters in a Lua system definition file is now handled during the loading phase rather than the system generation phase. (Json files require that all parameters are specified and does not perform standalone generation.)

System Generation Changes:

SystemBodies are now responsible for calculating atmospheric parameters, moved from Planet.cpp. Additionally, SystemBody now has a proper parameterization for Argument of Periapsis, allowing it to fully express a proper orbit.

Bodies now generate in a more realistic fashion in an attempt to relax the behavior of cramming 5-10 gas giants within 5 AU of the primary star. Several scaling factors are applied to body generation, more satellites are generated around gas giants (referencing Jupiter), and a factor is applied to prevent extremely dense stars from generating large numbers of high-mass satellites in a very small orbit.

JSON Custom Systems:

As part of the system editor work, I've added a JSON-based format for loading and saving custom system definitions. This enables repeatable round-trip serialization, potentially higher performance with 100s of custom systems, and is a much easier and less bug-prone format for the engine to import and export. This comes at the cost of the ability to hand-edit the file (unless you want to do fixed-point format conversion by hand as well), though the files remain readable and easy to diff.

This new format makes Lua-based custom systems officially deprecated, as it is much better at representing all of the parameters that make up a system. (When compared to the Lua format, where 50% or more of body parameters were completely implicit and changed based on the order the system was loaded in.)

This new format is 100% fully editable with the upcoming System Editor, which provides a fully visual edit interface to adjust all parameters of a system, provides procedurally-assisted body generation, and can calculate derived parameters like surface gravity and atmosphere height in real-time. Plus undo. Who doesn't like undo?

Sneak peek:

2023-09-04.03-43-02.mp4

(MSAA has been added since...)

The JSON-based format is not end-user testable in this PR without the system editor - this code has been developed in the system editor branch however, and is reasonably bug-free.

TODO:

  • Autoload custom systems from JSON during galaxy generation
  • Load "partial" custom systems from JSON (for e.g. local_stars, hyg database)
  • Override "partial" custom system definitions with fully-defined custom systems (e.g. local_stars.lua)
  • Prefer JSON custom systems to Lua custom systems

I'm requesting "review" from @fluffyfreak and @Gliese852 to take a quick look at the description and PR and let me know feedback/thoughts on the general direction. Overall, I'm pretty happy with the code quality and effect of the PR, but more eyes are always welcome!

@fluffyfreak
Copy link
Contributor

I'll get on it, though it might take me a week 👍

@sturnclaw sturnclaw mentioned this pull request Sep 8, 2023
@sturnclaw sturnclaw mentioned this pull request Sep 8, 2023
@impaktor
Copy link
Member

Was going to test it, but crashes (window frame is rendered, but then crashes):

Info: Lua 5.2
Info: Found mod Vgr_battlecruiser, enabled: true
Info: 	source: /home/karlf/.pioneer/mods/Vgr_battlecruiser.zip
Info: Found mod longnose0.4, enabled: true
Info: 	source: /home/karlf/.pioneer/mods/longnose0.4.zip
Info: Loaded mods:
Info: 	Vgr_battlecruiser
Info: 	longnose0.4
Warning: couldn't read language file 'lang/core/.json'
Warning: couldn't load language resource core/, trying core/en
Info: --------------------
Info: SDL Version (build) 2.28.2
Info: SDL Version (dynamic) 2.28.2
Info: SDL Versions match
Info: SDL_image Version (build): 2.6.3
Info: SDL_image Version (dynamic): 2.6.3
Info: SDL_image Versions match
Info: Assimp Version: 5.2.0
Info: FreeType Version: 2.13.1
Info: GLEW dynamic version: 2.0.0
Info: --------------------
Info: 
Info: Initialized OpenGL 3.1, with extensions, renderer
Info: Created shader vtxColor (address=0x560b7346cbd0)
Info: Initializing joystick subsystem.
Info: Loaded PiGui fonts from disk:
Info: font console:0
Info:   - Inpionata.ttf 1.0
Info:   - DejaVuSansMono.ttf 1.2
Info:   - wqy-microhei.ttc 1.0
Info:   - icons/icons.svg 16x19
Info: font icons:0
Info:   - PionilliumText22L-Medium.ttf 1.0
Info:   - icons/icons.svg 16x19
Info: font orbiteer:0
Info:   - Orbiteer-Bold.ttf 1.0
Info:   - DejaVuSans.ttf 1.2
Info:   - wqy-microhei.ttc 1.0
Info:   - icons/icons.svg 16x19
Info: font pionillium:0
Info:   - PionilliumText22L-Medium.ttf 1.0
Info:   - DejaVuSans.ttf 0.9285714
Info:   - wqy-microhei.ttc 1.0
Info:   - icons/icons.svg 16x19
Info: Created shader ui (address=0x560b7346e4b0)
Warning: No SVG data available to rasterize icon font icons/icons.svg
Warning: No SVG data available to rasterize icon font icons/icons.svg

@sturnclaw
Copy link
Member Author

A backtrace would be useful 😉

Unsure about the crashing - the code should be functional but was cherry-picked out of a larger branch so it's possible I missed an implicit dependency that's present in the full system-editor branch.

Copy link
Contributor

@fluffyfreak fluffyfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this all looks good, I'm guessing savegame bump and that it cahnges the universe quite a lot.

Approved

@fluffyfreak
Copy link
Contributor

fluffyfreak commented Sep 12, 2023

I get a crash in testing x64|Debug looks like it's trying to load CityOnPlanet Dome1

vcruntime140d.dll!00007ffd0ff11416() Unknown
pioneer.exe!std::_Char_traits<char,int>::copy(char * const _First1, const char * const _First2, const unsigned __int64 _Count) Line 67 C++
pioneer.exe!std::string::_Construct_lv_contents(const std::string & _Right) Line 2917 C++
pioneer.exe!std::string::basic_string<char,std::char_traits,std::allocator>(const std::string & _Right) Line 2421 C++
pioneer.exe!std::_Default_allocator_traits<std::allocatorstd::string>::construct<std::string,std::string const &>(std::allocatorstd::string & __formal, std::string * const _Ptr, const std::string & <_Args_0>) Line 683 C++
pioneer.exe!std::vector<std::string,std::allocatorstd::string>::_Emplace_reallocate<std::string const &>(std::string * const _Whereptr, const std::string & <_Val_0>) Line 777 C++
pioneer.exe!std::vector<std::string,std::allocatorstd::string>::emplace_back<std::string const &>(const std::string & <_Val_0>) Line 734 C++
pioneer.exe!std::vector<std::string,std::allocatorstd::string>::push_back(const std::string & _Val) Line 744 C++
pioneer.exe!Assimp::IOSystem::PushDirectory(const std::string & path) Line 286 C++
[External Code]
pioneer.exe!Assimp::Importer::ReadFile(const std::string & pFile, unsigned int pFlags) Line 645 C++
pioneer.exe!SceneGraph::Loader::LoadMesh(const std::string & filename, const std::vector<SceneGraph::AnimDefinition,std::allocatorSceneGraph::AnimDefinition> & animDefs) Line 353 C++
pioneer.exe!SceneGraph::Loader::CreateModel(SceneGraph::ModelDefinition & def) Line 260 C++
pioneer.exe!SceneGraph::Loader::LoadModel(const std::string & shortname, const std::string & basepath) Line 203 C++
pioneer.exe!SceneGraph::Loader::LoadModel(const std::string & filename) Line 136 C++
pioneer.exe!ModelCache::FindModel(const std::string & name) Line 25 C++
pioneer.exe!Pi::FindModel(const std::string & name, bool allowPlaceholder) Line 1172 C++
pioneer.exe!CityOnPlanet::LoadBuildingType(std::basic_string_view<char,std::char_traits> key, const nlohmann::basic_json<std::map,std::vector,std::string,bool,__int64,unsigned __int64,double,std::allocator,nlohmann::adl_serializer> & buildingDef, CityOnPlanet::BuildingType & out) Line 106 C++
pioneer.exe!CityOnPlanet::LoadCityFlavour(const FileSystem::FileInfo & file) Line 214 C++
pioneer.exe!CityOnPlanet::Init() Line 245 C++
[External Code]
pioneer.exe!StartupScreen::RunNewLoader() Line 628 C++
pioneer.exe!StartupScreen::Update(float deltaTime) Line 607 C++
pioneer.exe!Application::Run() Line 195 C++
pioneer.exe!SDL_main(int argc, char * * argv) Line 180 C++
[External Code]

@fluffyfreak
Copy link
Contributor

fluffyfreak commented Sep 12, 2023

For me, on Windows x64|Debug in VS2019 using CMake it fails with Assimp loading models/buildings/vlastan/Dome1LQ.obj

EDIT: this also fails within the ModelCompiler when asked to build that file, or to batch process everything.
EDIT EDIT: This works with x64|Release, it appears that it could be the Assimp Debug library. Able to run the game and play seemingly ok briefly (lunchbreak) without issues 👍

@sturnclaw
Copy link
Member Author

sturnclaw commented Sep 12, 2023

@fluffyfreak ...I haven't rebased this PR onto master since the PR that fixes Assimp in debug mode was merged. That'd be the cause of the crash.

- Disable 1.25x multiplier to atmospheric density in StarSystemCustomGenerator
- Should be replaced with changes to individual system definitions
Avoiding the system index allows generating a system without needing to know the context of how many other systems exist in the sector, which is important for consistent results in the SystemEditor.
SystemBody did not have any concept of Argument of Periapsis, limiting the orbits that could be specified.

Random generation has not been adjusted to generate orbits with random argument of periapsis.
- Add JSON-based serialization to SystemBody and StarSystem.
- Will replace lua-based serialization for custom systems
- Move responsibility for generating body orbit to SystemBody
- Hacked in support for using both Lua and Json-based custom system formats; intend to fully deprecate Lua-based
Codepath was never exercised, assumed fixed number was serialized as numerator/denominator. Corrected to load whole/fractional parts as intended.
- Generate all "missing value" random body parameters using consistent per-body hash value.
- Avoids implicit dependency on system load order or body layout order.
- Semantically separates body parameters which the game should generate for gameplay reasons from body parameters which were not listed in the lua custom system definition.
Add several new heuristics controlling generation of planets and moons around primaries.
- Scale body mass and orbit eccentricity based on its distance from the primary; generates more "realistic-looking" results.
- Start generating bodies closer to primary (moons of gas giants look closer to Jupiter/Saturn)
- More straightforward Hill Radius handling for generating moons.

Add orbit generation method for inserting a new body between two existing bodies
- Designed to be consumed by the SystemEditor for "random guided" body creation.

Generated body orbits are fully parameterized with offset, inclination, and argument of periapsis.
- Now supports (rare) retrograde orbits
- SystemBody is now responsible for information about its atmospheric pressure, density, and height of tropopause (0.01 atm height)
- Removed old implementation from Planet.cpp
- Ensure body satellite shell density is reproducible outside the initial generation pass.
- Add std::initializer_list constructor/seed operation to Random.h
- Avoid segfault if asking for satellite shell density for a gravpoint without children
- Increase realism of body arrangements generated through additional post-processing factors.
- Fix overflow in mass_from_disk_area (don't take the cube of the orbit apoapsis when not needed)
- Fix dense stars generating large numbers of unnaturally-close gas giants
- Increase mass falloff towards edge of body satellite radius
- Load other_names from custom system definition
- Move random generation of system lawlessless to PopulateStarSystemGenerator
- Removes all random generation from StarSystemCustomGenerator
- Ensure bodies are loaded with exactly the same values as they were serialized with
- Remove latitude/longitude fields from CustomSystemBody
- Starports in starting systems have "wandered" due to implicit seed changes affecting placement algorithm. Attempt to control that by restoring old seed value.
- SystemBodyData can now be copied by value for use in CustomSystemBody
- SystemBody retains the same public interface.
- All data handled via SystemBodyData child
- Per-member setters removed from StarSystemGenerator
- Random rings now determined during CustomSystem load step
@sturnclaw
Copy link
Member Author

Rebased onto master (should now run in Win64 Debug), and refactored CustomSystemBody to use a new shared base class SystemBodyData. This massively simplifies code in both CustomSystem and StarSystemGenerator - thanks for the reminder/nudge in that direction!

Still procrastinating on hooking up JSON custom systems to galaxy generation, but will try to get that done soonish.

@fluffyfreak
Copy link
Contributor

Yep that all works for me in Debug and Release 👍

@impaktor
Copy link
Member

impaktor commented Sep 14, 2023

A backtrace would be useful

I just tried again, on current state 47f484b. Got this trace, which I don't think amounts to much:

GDB Log trace
gdb ./build/editor                                                                                 
GNU gdb (GDB) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/editor...
(gdb) run
Starting program: /home/karlf/usr/src/pioneer/build/editor 

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.archlinux.org>
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Info: Lua 5.2
Info: Found mod Vgr_battlecruiser, enabled: true
Info: 	source: /home/karlf/.pioneer/mods/Vgr_battlecruiser.zip
Info: Found mod longnose0.4, enabled: true
Info: 	source: /home/karlf/.pioneer/mods/longnose0.4.zip
Info: Loaded mods:
Info: 	Vgr_battlecruiser
Info: 	longnose0.4
[New Thread 0x7ffff5e1c6c0 (LWP 83499)]
[New Thread 0x7ffff561b6c0 (LWP 83500)]
[New Thread 0x7ffff4e1a6c0 (LWP 83501)]
[New Thread 0x7fffeffff6c0 (LWP 83502)]
[New Thread 0x7fffef7fe6c0 (LWP 83503)]
[New Thread 0x7fffeeffd6c0 (LWP 83504)]
[New Thread 0x7fffee7fc6c0 (LWP 83505)]
[New Thread 0x7fffedffb6c0 (LWP 83506)]
[New Thread 0x7fffed7fa6c0 (LWP 83507)]
[New Thread 0x7fffecff96c0 (LWP 83508)]
[New Thread 0x7fffcbfff6c0 (LWP 83509)]
[New Thread 0x7fffcb7fe6c0 (LWP 83510)]
[New Thread 0x7fffcaffd6c0 (LWP 83511)]
[New Thread 0x7fffca7fc6c0 (LWP 83512)]
[New Thread 0x7fffc9ffb6c0 (LWP 83513)]
[New Thread 0x7fffc97fa6c0 (LWP 83514)]
[New Thread 0x7fffc8ff96c0 (LWP 83515)]
[New Thread 0x7fffaffff6c0 (LWP 83516)]
[New Thread 0x7fffaf7fe6c0 (LWP 83517)]
Warning: couldn't read language file 'lang/core/.json'
Warning: couldn't load language resource core/, trying core/en
[New Thread 0x7fffae5ff6c0 (LWP 83521)]
Info: --------------------
Info: SDL Version (build) 2.28.2
Info: SDL Version (dynamic) 2.28.2
Info: SDL Versions match
Info: SDL_image Version (build): 2.6.3
Info: SDL_image Version (dynamic): 2.6.3
Info: SDL_image Versions match
Info: Assimp Version: 5.2.0
Info: FreeType Version: 2.13.1
Info: GLEW dynamic version: 2.0.0
Info: --------------------
Info: 
[New Thread 0x7fffaddfe6c0 (LWP 83524)]
[New Thread 0x7fffad5fd6c0 (LWP 83525)]
[New Thread 0x7fffacdfc6c0 (LWP 83526)]
[New Thread 0x7fff8bfff6c0 (LWP 83527)]
[New Thread 0x7fff8b7fe6c0 (LWP 83528)]
[New Thread 0x7fff8affd6c0 (LWP 83529)]
[New Thread 0x7fff8a7fc6c0 (LWP 83530)]
[New Thread 0x7fff89ffb6c0 (LWP 83531)]
[New Thread 0x7fff897fa6c0 (LWP 83532)]
[New Thread 0x7fff88ff96c0 (LWP 83533)]
[New Thread 0x7fff67fff6c0 (LWP 83534)]
[New Thread 0x7fff677fe6c0 (LWP 83535)]
[New Thread 0x7fff66ffd6c0 (LWP 83536)]
[New Thread 0x7fff667fc6c0 (LWP 83537)]
[New Thread 0x7fff65ffb6c0 (LWP 83538)]
[New Thread 0x7fff657fa6c0 (LWP 83539)]
[New Thread 0x7fff64ff96c0 (LWP 83540)]
[New Thread 0x7fff47fff6c0 (LWP 83541)]
[Thread 0x7fff47fff6c0 (LWP 83541) exited]
[Thread 0x7fff64ff96c0 (LWP 83540) exited]
[New Thread 0x7fff64ff96c0 (LWP 83542)]
[New Thread 0x7fff47fff6c0 (LWP 83543)]
Info: Initialized OpenGL 3.1, with extensions, renderer
Info: Created shader vtxColor (address=0x555555cf9df0)
Info: Initializing joystick subsystem.
Info: Loaded PiGui fonts from disk:
Info: font console:0
Info:   - Inpionata.ttf 1.0
Info:   - DejaVuSansMono.ttf 1.2
Info:   - wqy-microhei.ttc 1.0
Info:   - icons/icons.svg 16x19
Info: font icons:0
Info:   - PionilliumText22L-Medium.ttf 1.0
Info:   - icons/icons.svg 16x19
Info: font orbiteer:0
Info:   - Orbiteer-Bold.ttf 1.0
Info:   - DejaVuSans.ttf 1.2
Info:   - wqy-microhei.ttc 1.0
Info:   - icons/icons.svg 16x19
Info: font pionillium:0
Info:   - PionilliumText22L-Medium.ttf 1.0
Info:   - DejaVuSans.ttf 0.9285714
Info:   - wqy-microhei.ttc 1.0
Info:   - icons/icons.svg 16x19
Info: Created shader ui (address=0x555555cc72a0)
Warning: No SVG data available to rasterize icon font icons/icons.svg
Warning: No SVG data available to rasterize icon font icons/icons.svg
[Thread 0x7fff47fff6c0 (LWP 83543) exited]
[Thread 0x7fff64ff96c0 (LWP 83542) exited]
[Thread 0x7fff657fa6c0 (LWP 83539) exited]
[Thread 0x7fff65ffb6c0 (LWP 83538) exited]
[Thread 0x7fff667fc6c0 (LWP 83537) exited]
[Thread 0x7fff66ffd6c0 (LWP 83536) exited]
[Thread 0x7fff677fe6c0 (LWP 83535) exited]
[Thread 0x7fff67fff6c0 (LWP 83534) exited]
[Thread 0x7fff88ff96c0 (LWP 83533) exited]
[Thread 0x7fff897fa6c0 (LWP 83532) exited]
[Thread 0x7fff89ffb6c0 (LWP 83531) exited]
[Thread 0x7fff8a7fc6c0 (LWP 83530) exited]
[Thread 0x7fff8affd6c0 (LWP 83529) exited]
[Thread 0x7fff8b7fe6c0 (LWP 83528) exited]
[Thread 0x7fff8bfff6c0 (LWP 83527) exited]
[Thread 0x7fffacdfc6c0 (LWP 83526) exited]
[Thread 0x7fffad5fd6c0 (LWP 83525) exited]
[Thread 0x7fffaddfe6c0 (LWP 83524) exited]
[Thread 0x7fffaf7fe6c0 (LWP 83517) exited]
[Thread 0x7fffaffff6c0 (LWP 83516) exited]
[Thread 0x7fffc8ff96c0 (LWP 83515) exited]
[Thread 0x7fffc97fa6c0 (LWP 83514) exited]
[Thread 0x7fffc9ffb6c0 (LWP 83513) exited]
[Thread 0x7fffca7fc6c0 (LWP 83512) exited]
[Thread 0x7fffcaffd6c0 (LWP 83511) exited]
[Thread 0x7fffcb7fe6c0 (LWP 83510) exited]
[Thread 0x7fffcbfff6c0 (LWP 83509) exited]
[Thread 0x7fffecff96c0 (LWP 83508) exited]
[Thread 0x7fffed7fa6c0 (LWP 83507) exited]
[Thread 0x7fffedffb6c0 (LWP 83506) exited]
[Thread 0x7fffee7fc6c0 (LWP 83505) exited]
[Thread 0x7fffeeffd6c0 (LWP 83504) exited]
[Thread 0x7fffef7fe6c0 (LWP 83503) exited]
[Thread 0x7fffeffff6c0 (LWP 83502) exited]
[Thread 0x7ffff4e1a6c0 (LWP 83501) exited]
[Thread 0x7ffff561b6c0 (LWP 83500) exited]
[Thread 0x7ffff5e1c6c0 (LWP 83499) exited]
[Thread 0x7fffae5ff6c0 (LWP 83521) exited]
[Inferior 1 (process 83496) exited normally]

@sturnclaw
Copy link
Member Author

@impaktor you're trying to run the editor, which a) isn't functional in this PR (only the system generation changes are available for testing here), and b) requires you to pass --system to enter the System Editor mode.

- Json Merge-Patch completely overwrites arrays rather than modifying them
- Top-level keys in a .patch file starting with '$' can use Json Pointer semantics to refer to an object to modify
- Patched values are applied using merge-patch semantics
- Migration path for old 02_local_stars.lua
- CustomSystem definitions use nicer storage values for sector position
- Loads full system definitions from systems/custom
- Loads partial system definitions from systems/partial
- Add example Json-based partial system def
@sturnclaw
Copy link
Member Author

Implemented all TODO items and migrated 00_sol.lua to JSON for testing purposes. Feel free to change names etc. in the file and ensure it's being loaded properly when starting a game at Mars.

If no further issues arise on this PR, will most likely merge it by end-of-week.

Copy link
Contributor

@Gliese852 Gliese852 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for inviting me to look at your code, it was very interesting and informative, and I managed to find a few things to pick on!

data/systems/custom/00_sol.json Show resolved Hide resolved
src/galaxy/CustomSystem.cpp Show resolved Hide resolved
data/systems/partial/02_local_stars.json Show resolved Hide resolved
src/JsonUtils.cpp Outdated Show resolved Hide resolved
src/Random.h Outdated Show resolved Hide resolved
src/galaxy/StarSystemGenerator.cpp Show resolved Hide resolved
src/galaxy/SystemBody.cpp Show resolved Hide resolved
src/galaxy/SystemBody.cpp Show resolved Hide resolved
src/galaxy/SystemBody.cpp Show resolved Hide resolved
src/galaxy/CustomSystem.cpp Show resolved Hide resolved
@sturnclaw
Copy link
Member Author

@Gliese852 thank you very much for the detailed and comprehensive review of the code! I'll make the appropriate changes to address the review feedback soon - I've left explanations/comments where needed; feel free to ask further questions if I've not answered something clearly / satisfactorily.

- Fix some unintended divide-by-zero occurrences
- Remove leftover code from debugging
- Ensure system lawlessness value is correctly setup
@sturnclaw
Copy link
Member Author

I've addressed all review feedback comments except regarding the assert(b >= a) issue. I'm unsure at this time how to address that problem; I've added a minor patch to get_disc_density that prevents a divide by zero but in general I'm unsure what the original intended purpose or application of the function was supposed to be.

@sturnclaw
Copy link
Member Author

I've also added a few extra syllable fragments to the name generator lists in a very non-exhaustive fashion, which hopefully improve the uniqueness of generated system names slightly. (It also means we can generate systems named Dune now, which was impossible before.)

@sturnclaw sturnclaw merged commit f07bbc1 into pioneerspacesim:master Oct 8, 2023
4 checks passed
@sturnclaw sturnclaw deleted the custom-system-gen branch October 8, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants