Master of Orion

Master of Orion

Unofficial Code Patch Steam Workshop
Cend 2 Oct, 2024 @ 9:19am
Are maximum planets per system hardcoded?
So i was playing around with modding the planetary systems and was trying out what is and isn't possible to do. Even went into the code a bit to clarify what certain things actually do.

I then did several test with how many planets i can get per system and got up to seven. Increasing the amount in the mod further did not go along with an increase in the game.

The output log shows no errors regarding this so the mod should be fine (it still increases planets to 7 even with 10 orbits configured in the various yaml files).

Since i couldn't find any variable changing this my guess it's hardcoded somewhere though i couldn't find it in the code.
I'm an amateur in regards to programming though so i probably overlooked things.

Can anyone confirm this?
< >
Showing 1-15 of 16 comments
Spud Dastardly 2 Oct, 2024 @ 11:26am 
Per the UCP readme

Add.0.0.5.8a: MOD SUPPORT: Increased number of planet orbits from 6 to 12 max to allow for larger solar systems.
Cend 2 Oct, 2024 @ 12:26pm 
I found that as well but no matter what i do, the number of planets stays at 7.

Let me list what i changed so you maybe can see what i missed

globals.yaml:
set ORBITS_PER_STAR to 10
added PLANETARY_ORBITS and spaced them out
reduced MIN_NODE_DISTANCE so it doesn't get stuck because the planets don't fit
increased ORBIT_SECTORS to 10 as well

PlanetSizeTypes.yaml:
reduced the scale of the planets so they don't take up as much space

PlanetSizeChances.yaml:
added additional orbits up to 10

PlanetaryDensityPackages.yaml:
added entries for higher number of planets to each star and added chances to them (they should add up to 100 if i didn't mess that up)

StarTypes.yaml:
added orbitChances for the higher orbits
added the Orbit entries as well

I think that's all
Last edited by Cend; 2 Oct, 2024 @ 12:48pm
Spud Dastardly 2 Oct, 2024 @ 1:14pm 
I see that two other modders have already attempted this, and both ended up at 7:
https://steamproxy-script.pipiskins.com/sharedfiles/filedetails/?id=2483620274
https://steamproxy-script.pipiskins.com/sharedfiles/filedetails/?id=2091347253

You could try asking either of them for insight as to why it will not go beyond and compare their files with yours. I haven't worked with this myself but I vaguely recall this being an issue, but we don't know why it's not allowing more.
Last edited by Spud Dastardly; 2 Oct, 2024 @ 1:16pm
Cend 2 Oct, 2024 @ 2:54pm 
I'll try asking them but since they're still at 7 i'll probably have to do a deep dive into the code for star system creation.
Cend 2 Oct, 2024 @ 4:44pm 
Ok so on a weird hunch i went ahead and added the orbit name suffixes (with quotation marks bracketing them) directly to the csv of the mod since i was getting an error from Backend.Galaxy.Planet.getName() when using 12 orbits (none appeared at 10) for fun and because i was a bit frustrated and lo and behold it works. Should have worked before as UCP mod is active and has the orbit name suffixes as well but somehow it didn't...

from galaxy: https://ibb.co/37MsjX4
system view: https://ibb.co/cLYZHt1

So for anyone else interested in this topic: nope it's not hardcoded, just behaves a bit weirdly.
Last edited by Cend; 2 Oct, 2024 @ 4:52pm
Spud Dastardly 2 Oct, 2024 @ 5:07pm 
Awesome, you solved it! It's not often new functionality is discovered in this game. Are you going to post a mod in the workshop? I think you would just need to configure the planetary density settings and star types for all the orbits to make it balanced.
Last edited by Spud Dastardly; 2 Oct, 2024 @ 5:08pm
Cend 3 Oct, 2024 @ 11:17am 
Yes i'll post it soon. It's married to my Even Bigger Planets unfortunately since i started tinkering with that one and i'm currently too lazy to divide them.
The density settings and star types are already done.
Had some fun thinking up a function for that density spreading since i didn't just want to use a gaussian curve.

On another note: do you know how to give a free tech that has a dependancy on another tech without a perk to jump off of?
I made a building (or a lot of buildings, like the toxic condenser in 5x noUCP with a visible dummy in the tech tree) that increases max pop to the next sized planet (since there is no way i know of that actually increases planet size, which would be much preferred since it would also increase tiles) but i didn't want to just give it from the start.
I am currently using a 0 point perk while also adding that perk to all races.
Spud Dastardly 3 Oct, 2024 @ 2:10pm 
Originally posted by Cend:
On another note: do you know how to give a free tech that has a dependancy on another tech without a perk to jump off of?
I made a building (or a lot of buildings, like the toxic condenser in 5x noUCP with a visible dummy in the tech tree) that increases max pop to the next sized planet (since there is no way i know of that actually increases planet size, which would be much preferred since it would also increase tiles) but i didn't want to just give it from the start.
I am currently using a 0 point perk while also adding that perk to all races.
Easiest way would be to just have one building that increases the max population and put it in the node directly. By default, the amount of population to increase to the next size is always +4, though I guess you may have modded that away, so you want to have a building for each size, all unlocked at once, but not at the beginning, and without an extra perk. The solution is to put all of the buildings in one tech app, with the dummy as the first one in the list, and then just put the techapp in the node where you want it to unlock. When it unlocks, it should unlock all buildings but only show the dummy on the unlock screen.
Last edited by Spud Dastardly; 3 Oct, 2024 @ 2:11pm
Spud Dastardly 3 Oct, 2024 @ 2:23pm 
Originally posted by Cend:
There we go:
https://steamproxy-script.pipiskins.com/sharedfiles/filedetails/?id=3342449037
Cool, I wonder if the increased radius causes galaxy generation problems on the largest circle galaxies where things are packed tightly together. I would be curious how many stars the output log reports generating compared to the modelled galaxy data settings.
Cend 3 Oct, 2024 @ 3:52pm 
I just tested it with Brobdingnagian and it only created 172 of the targeted 320 and actually didn't finish because separation is not achievable. I'll see if i can get it to work with smaller orbit sizes.

Ok so orbit size down to 1 on the outermost again works fine though the twelve planet systems look a bit crowded now

https://ibb.co/Xb9PrWZ

https://ibb.co/GdmxgzM

I also did what you recommended concerning the techapp (though i still have to test if i didn't mess up).
Thanks!
Last edited by Cend; 3 Oct, 2024 @ 4:00pm
Spud Dastardly 4 Oct, 2024 @ 7:37am 
There's this conflict between the star system size and the planets. If the system size is too large, the stars don't all fit and distances get messed up as you can shortcut through systems. If it's too small, the planets don't all fit and can overlap. It's a delicate balance, and finding the right middle ground with 12 planets is going to be hard. It might be that some of the largest galaxies aren't going to work with it
Cend 4 Oct, 2024 @ 8:02am 
I reduced orbit sizes maximum to 1.00 again and it works fine now - haven't had a "stuck in loading screen" since and i've tested dozens of different combinations.
Spud Dastardly 4 Oct, 2024 @ 8:38am 
I had a look at your mod files. I don't see why BiomeChances is included. As far as I can tell, DSMP and the custom assets package are not required for this mod. I did a test with just 5X, UCP, and 5XCPC, and it generated fine.
Cend 4 Oct, 2024 @ 11:04am 
They're included because black holes can now have things around them as well - mostly asteroid belts.

Concerning DSMP and custom assets: they're not really needed. Since i never tested that, i included them as well :) . I think i used something from custom assets - probably an icon. Might be on my other (local) tinkering mod though.
Last edited by Cend; 4 Oct, 2024 @ 12:08pm
< >
Showing 1-15 of 16 comments
Per page: 1530 50