Galaxy Map Generation Parameters

Is there any info/help available on what the values in the MapSetupDefs.xml actually mean?

By that I mean how they actually affect the map generating algorithm. Obviously the parameter name refers to the object it targets, and most values seem to be probabilities which is confirmed by getting less stuff towards 0 and more stuff towards 1 but nothing noticeable above 1. So, yes, I *did* experiment. :)

Specifically, what I'm after is "if I set this probability value to P, I get more or less about ~X amount of these things". The map size affects the amount (duh), so I'm guessing the map generating algorithm goes "through the map putting stuff into it" giving you naturally more stuff with more hexes.

This started as an idea to "stretch the map". I wanted to have a huge map but that would still have star systems and other stuff as if it were a medium map. Essentially, I'd have rescaled the map so that a hex would represent a smaller distance. Everything would be further away from everything else in terms of hexes and traveling time but it would still be a medium map in terms of available systems and resources. By guessing and trying out I can get galaxies that at least look like they have the number of stars about right, but it's a pain to count them from the minimap and as it's a random process you need to do it a few times to get an average, and this is just the number of stars... :(

Any better way of doing this? The actual distribution algorithm formula would be nice but any help or suggestions is appreciated.

8,243 views 3 replies
Reply #1 Top

Well, here's what I was able to find out: Using the Tiny, Small, and Medium maps I generated galaxies with the value of "Stars" in MapSetupDefs.xml running from 0.1 to 1.0. Galaxy type was scattered. Number of opponents was the minimum possible (Major=1, Minor=0) and all resources were set to NONE. These latter because the map generator seems to either create or guarantee a star for each opponent and the nebulae, black holes and asteroids presumably take up space from the stars.

With each value of MapSetupDefs.Stars (both with Tiny and Small) I run the map generator 10 times except when the number of resulting stars got so large (~50) that my eyes couldn't make an accurate count any more. Nevertheless, the result indeed presented a pattern:

Tiny / Small / Medium

0.1 : 3 stars / 6 stars / 11 stars

0.2 : 6 stars / 12 stars / 22 stars

0.3 : 9 stars / 19 stars / 33 stars

0.4 : 12 stars / 25 stars / 44 stars

0.5 : 16 stars / 32 stars / 55 stars

0.6 : 19 stars / 38 stars / *

0.7 : 21-22 stars / 40-44 stars / *

0.8 : 23-25 stars / * / *

0.9 : 24-27 stars / * / *

1.0 : 21-26 stars / * / *

The range 0.1-0.6 always resulted in the same number of stars every time of the 10 tries sample. When the MapSetupDefs.Stars value hit 0.7+ the number started to vary and also it didn't seem to grow any more, either.

I interpret the results to mean that the map generator *first* calculates the number of stars using the value of MapSetupDefs.Stars as a straight percentage instead of a probability, and then tries to place them on the map to random positions (presumably adjusted by the galaxy shape choice). At the percentage position around 2/3 the stars likely start "bumbing" into each other (some minimum distance between systems, I think) and/or possibly hitting the other non-resource map stuff i.e. gas clouds and radiation storms, the result being that not all of the theoretical maximum of the stars could be placed on the map which we then see as the random variation in their number from that point upwards.

Would anyone know the map sizes? My guess is that the "max number of stars" formula is something like:

NumberOfStars = NumberOfHexesOnTheMap * MapSetupDefs.Stars * AdjustmentFactor

where the "AdjustmentFactor" is related to the "size of the star system" i.e. the minimum distance between stars so that all the planets and asteroids fit comfortably around their parent stars without hitting their neighbors.

Reply #2 Top

If you mean map sizes as in the number of hexes:

Tiny            2791
Small          4921
Medium      10981
Large         15769
Huge          27361
Gigantic      97741
Immense   173521
Excessive   253171
Insane      434341

Taken from Bamdorf's thread https://forums.galciv3.com/463642/page/1/#3538947 . Updated the Large and Huge since those have changed since his post.

Reply #3 Top

haven't looked into this myself but consider your adjustmentfactor to consider the edge of the map as well, i assume a star system can only spawn close enough to the edge to spawn the entire system