Random planet resources within Planet.entity

-or- how to randomize resources???

First post, so let me just say this game is fantastic.  Way to go!

Ok, now for my question.  I've been playing around a bit with the various entity files and 'Sins-Plus' mod, great job by the way.  What I've done is added some new Galaxy Defs, and corresponding String entires, to have more control over random planet creation.  For example, I've got an entry that reads "Mostly Terran," which creates 50% Terran, 10% Desert, 10% Ocean, 10% Forest exec, 10% Rock, 10% desert.  I've done similar entries for every terrestrial planet.

This works great, now I have more control over types of planets in random stars.  BUT, what I don't have control over is what resources each planet type generates with.  As it stands right now, every instance of each planet will have the same resource number and types, such as 2 metals and 1 crystal.  It seems that within each planet's entiy file, under the 'planetResourceSetupInfo' section, the various min/max[counts] for metal and crystal asteroids only control the resources for the planet type, instead of each planet individualy.  Thus, if I set TerranHome's min/max for metal to 3 and 6, respectively, when I start a new game each TerranHome will have identical metal asteroids between 3 and 6.  If there were 10 TerranHome planets, and the randomizer decided on 4, every single TerranHome would have 4 metals instead of each TerranHome having a random resource between 3-6.  (Some might have 3,4,5,6 metals in that case)  Am I correct in assuminng that this section of the Planet.entity files is somehow broken, or is there something else I'm missing?  If it is broken, I think the workaround would be to copy each planet entiy, change the resources, and add them to the galaxy defs, but would be a pain in the...

-Thanks in Advance.
2,597 views 7 replies
Reply #1 Top
Well, I can say for absolutely sure that this doesn't occur with the other planets. I've seen the same planet type next to each other with a different number of Resources 'roids. However, if you have only been testing with Home planets then that is probably where the problem lies. It would be unfair if one Home started with 6, when another starts with 3.
Reply #2 Top
That is very interesting. I've been testing with every planet, both vanilla and in 'Sins Plus.' Not sure whats going on then, I'll check it out some more.
Reply #3 Top
Here's a test I tried with the regular desert planet. No matter what I did, I could only affect what every desert planet starts with, rather than each desert individually, in a random map of 1 star with 20 desert planets.

Inside PlanetDesert.entity I changed the totalMaxResourceAsteroids and the [min/max]Count for both metal and crystal resource Setup. Buy upping totalMaxResourceAsteroids to 6 and setting the minCounts to 0 and maxCounts to 6, the game gave me 20 desert planets with 3 metals and 3 crystals each... for 10 random games. Changing these numbers did indeed change the number of 'roids, but again the planets were still identical, just with fewer or more resources. I still have no clue what I've done wrong, but it seems I messed up a config file somewhere to keep planets static.

-Default-
planetResourceSetupInfo
asteroidSpawnAngleVariance 3.141593
totalMaxResourceAsteroids 3
metalResourceAsteroidSetup
minCount 1
maxCount 2
extractionRate 0.400000
refineryRate 0.060000
maxRefineryCount 3
crystalResourceAsteroidSetup
minCount 1
maxCount 2
extractionRate 0.400000
refineryRate 0.060000
maxRefineryCount 3
Reply #4 Top
Right, I just tried it, and you are correct. This looks to have been put in for 1.03 because I am 100% sure that this didn't occur before. And I also have no idea how to fix it. They must have done it for balance, or something :NOTSURE:
Reply #5 Top
Well, glad to see I'm not crazy. Too bad about the change, but maybe next patch we'll get a fix. Anyway, what I've done in copied all terrestrial planet entity files and change the resources for each one individually, adding these 'new' planets to the galaxyDef. Thus there 5 of each Terran/Desert/Volcano/Forest/Ocean/Rock/Ice planet with different resources, effectively randomizing planet resources in each map.
Reply #6 Top
A long winded way, but apparently the only way (:(
Reply #7 Top
I've concluded this must be a bug, as when I went through the entries for each planet, they all had a min/max set to allow for random values. Hopefully this will get fixed, in the meantime I've got most of the planet entities copied and their resource values changed to simulate the intended min/max random values prior to 1.03.