2.1.06

The MOO2 map generator

Some time ago I collected a lot of statistics about the map generator used in Master of Orion 2. Using some custom tools to dump game map data, and a lot of savegames of just started games, I gathered some data that could be used to understand how it works.

This is mostly statistical analysis, made with several assumptions to simplify the math; my assumptions seem to match the collected data, but Im not completely sure they are valid. First, some basic premises:

  • I assume that the number of players in the game does not affect the map generation
  • I assume that information about players (race, color, whatever) does not affect the map generation, except for obvious things like homeworld climate, size and gravity.
  • I assume that game difficulty does not affect the map generation


OK. First step in the map generation seems to be star layout. Black holes are considered like another star kind for this purpose. The number of stars depends on the map size in this way:

  • small: 20 stars or bh
  • medium: 36 stars or bh
  • large: 54 stars or bh
  • huge: 71 stars or bh


The above are averages. I expected 72 for huge galazies, but the result was 71. The numbers above are averages. There is a small variation of 1 or 2 stars, but I didn't measure that. The galaxy map has a physical proportion of 1.4 to 1 (i.e., 10 parsecs tool for each 14 parsecs wide). I didn't have a tool to measure sizes, but from some gameplay I have the following approximations:

  • small: 20 parsecs wide
  • medium: 27 parsecs wide
  • large: 33 parsecs wide
  • huge: 38 parsecs wide


After that, I assumed that galactic size does not affect the map generation in any other way. I might be wrong on this. The following data were all collected in huge galaxies, with 8 player games.

MOO2 stars have a size which doesn't seem to affect gameplay or anything else about the star or its planets. It just gives some stars that look bigger or smaller in the game display. Anyway, the data is in the savegame, and I've got 26.5% small stars, 44.5% medium stars, and 29% large stars. That was a small sample, I'm guessing that the right numbers, assuming the developers used simple rules for random generation (they seem to have done that in several similar places) are 30%, 40% and 30%.

Stars are assigned specials (like pirate caches, wormholes, lost hero). Note that
each star can have at least one special, so you will never find a lost hero at the endpoint of a wormhole. One possible star special is the "Planet special", which means that one planet in the system will get something like artifacts, splinter colony, natives, etc. Note that only one planet will have this, and in this case the star will not get any other special. This can be deduced from the savegame format, it is not just statistical analysis

The probabilities for different kind of specials seems to be independent of any other consideration (this is half a guess, so might be wrong again). Assuming that, the vaules are:

  • 78% No special
  • 10% Any Planet special
  • 5% Wormhole
  • ~2% Ship Debris
  • ~2% Pirate cache
  • ~2% Lost hero


There is also the "Orion special" which will be set in exactly one star system called Orion, of course. I don't know if all planet specials have the same chance of appearing or not.

Another part of star generation is setting their colors (and setting some of them as blackholes). This depends on the galactic age. According to that, the chances are:

For average aged galaxies

  • Black hole: 4%
  • Blue-white: 10.5%
  • White: 14.5%
  • Yellow: 13.6%
  • Orange: 14.4%
  • Red: 40.4%
  • Brown: 2.6%


For organic rich galaxies

  • Black hole: 7%
  • Blue-white: 4%
  • White: 4%
  • Yellow: 30.5%
  • Orange: 19.5%
  • Red: 32.7%
  • Brown: 2.3%


For mineral rich galaxies

  • Black hole: 3%
  • Blue-white: 18.5%
  • White: 22%
  • Yellow: 9.7%
  • Orange: 8.9%
  • Red: 37.2%
  • Brown: 0.7%


After creating stars and setting their color and specials, planets are put around them. The chances of having something in a given orbit seems to depend only on the star kind. For each orbit, the chances of having something are independent. The "somethings" I am talking about are not just planets, but also asteroid fields and gas giants. For each orbit, you have the following chance of having something:

  • blue-white: 20%
  • white: 15%
  • yellow: 23%
  • orange: 25%
  • red: 15%
  • brown: 15%


Once you have something in orbit, there is 20% of getting an asteroid field, a 20% chance of getting a gas giant, and 60% of getting a planet.

If it is a planet, the size seems independant of other considerations (orbit, star kind, galactic age). Chances are:

  • tiny: 10%
  • small: 20%
  • medium: 40%
  • large: 20%
  • huge: 10%


I also assume that planet gravity and mineral richness depend only on the star color, which seems quite reasonable when checking the data. Notably, I verified that gravity appears to be quite independent of planet size. With that assumption we get the following table about chances of getting different levels of gravity:


low medium high
4.2 66.9 28.9 # Blue-white
10.6 70.1 19.3 # White
13.8 70.3 15.9 # Yellow
22.1 71.2 6.7 # Orange
29.6 66.2 4.2 # Red
13.6 77.3 9.1 # Brown


So, for example, planets at orange stars are 71.2% of the time of normal gravity, 22.1% low gravity, and 6.7% high gravity.

Update, Jan 12: hoserboy posted a comment noting that gravity is actually a function of planet size and richness. The gravity table is


Richness
UP P AVG R UR
Tiny l l l m m
S Small l l m m m
i Medium l m m m h
z Large m m m h h
e Huge m m h h h


The above table does not applies to homeworlds, orion, or other planets with monsters or specials.

There is a similar table for mineral richness:


upoor poor normal rich urich
0 0 39.7 41.6 18.5 # Blue-white
0 19.5 41.2 29.4 9.8 # White
0 30.3 40.4 20.7 8.5 # Yellow
10.4 40.2 39.0 10.3 0 # Orange
18.6 38.3 42.3 0 0 # Red
5.0 11.0 61.0 18.0 5.0 # Brown


The only missing aspect about planets is climate. Climate assignment depends on the galactic age, and on the kind of star. You can get probabilities for the different planet climates based on this table:

For average aged galaxies


# toxic radiated barren desert tundra ocean swamp arid terran gaia
16.3 48.6 27.2 6.9 0 0 0 0 0 0 # Blue-white
16.6 36.8 27.1 6.0 4.3 1.7 1.0 2.6 3.2 0.7 # White
12.7 26.8 30.2 5.9 7.7 4.4 3.8 3.1 4.2 1.2 # Yellow
16.7 17.4 22.8 8.2 7.1 5.7 6.9 6.3 7.5 1.4 # Orange
16.2 12.9 49.7 3.0 6.6 2.2 2.3 2.5 4.0 0.6 # Red
20.8 29.2 10.0 20.0 10.0 2.0 2.0 2.0 3.0 1.0 # Brown


For organic rich galaxies


# toxic radiated barren desert tundra ocean swamp arid terran gaia
13.0 37.0 22.2 26.7 .6 0 0 0 0 0 # Blue-white
7.1 25.5 20.6 21.3 6.3 2.2 3.5 6.4 6.4 .7 # White
8.8 17.5 17.6 15.9 13.8 6.4 5.8 6.2 6.0 2.0 # Yellow
7.0 10.7 15.0 11.9 17.3 9.2 7.9 10.0 8.1 2.9 # Orange
12.8 6.6 37.0 6.4 23.6 3.6 3.2 3.2 3.5 0 # Red
20.0 30.0 10.0 20.0 10.0 2.0 2.0 2.0 3.0 1.0 # Brown


For mineral rich galaxies


# toxic radiated barren desert tundra ocean swamp arid terran gaia
12.9 54.2 26.0 5.7 .7 0 0 0 0 0 # Blue-white
13.2 33.9 34.5 5.0 4.5 2.0 2.2 1.4 3.0 0 # White
13.5 23.0 30.9 6.7 7.0 4.9 3.0 4.0 6.3 .7 # Yellow
11.7 17.5 29.0 5.6 10.0 4.3 6.1 6.1 7.7 2.0 # Orange
17.4 14.0 45.2 4.1 8.7 2.8 2.0 1.8 3.7 0 # Red
20.8 29.2 10.0 20.0 10.0 2.0 2.0 2.0 3.0 1.0 # Brown


The last tables might be slightly biased because homeworlds were taken into account for the stats, and homeworld attributes are set after map generation. So probabilities for medium gravity, medium terran planets may be slightly higher than the real game values.

8 comments:

siron said...

I disabled haloscan since they delete old comments. Some old comments:

Many thanks for your contribution, TrixX.

(There is already feedback of his work in this thread.)

We play mainly large galaxy on kali (1vs1 or 4ways) but I agree that there should not be significant differences in the results.
siron | 01.03.06 - 1:16 pm | #

I always thought planet gravity was directly related to planet size and mineral abundance (and no other factors):

Tiny planets are low-G for U-poor, poor, normal, and normal-G for rich and U-rich.
Small planets are low-G for U-poor and poor, and normal-G for normal, rich, and U-rich.
Medium planets are low-G for U-poor, normal-G for poor, normal, and rich, and heavy-G for U-rich.
Large planets are normal-G for U-poor, poor, and normal, and heavy-G for rich and U-rich.
Huge planets are normal-G for U-poor and poor, and heavy-G for normal, rich, and U-rich.

If put in table form it has a nice symmetry to it.

There are some exceptions. Of course, Orion is always normal-G depsite being huge and U-rich. Planets with other planet specials can have arbitrary gravity regardless of size and mineral abundance. Also, both random events that change a planet's mineral abundance (+2 and -1) does not change that planet's gravity. Finally, artificial planets always have normal-G.
hoserboy | 01.11.06 - 5:39 pm | #

Gravatar Welcome hoserboy,
many many thanks for your post. I assumed that there was some correlation between the variables size class, minerals and gravity, but I was also unaware that the gravity is actually determined by the other both variables. I just watched some galaxies with an omni race (Planets Screen) and by using the button ?no enemy presence? it is quite easy to see that your statement is true. Amazing. I guess many play this game almost a decade....and they are unaware of this relationship.
I was going to ask trixx for the exact data to calculate these correlations....you have saved me a lot of work. Thanks!

With respect to the variables gravity, size class and minerals we have now just 25 different types of planets when we exlcude Orion and monsters. This could be interesting for trixx: When he could modify his tool (exclusion of Orion and monsters) we could better analyze if climate is independent of the other 3 above-mentioned variables. Or he could use his tool (which already excludes homeworlds) and generate a new sample of galaxies with the monsters=0 and noorion switches.

I hope we see a nice extension of this work!

Best regards
siron
siron | 01.12.06 - 7:26 am | #

hoserboy: That's cool. As I said I took some assumptions about independence of variables, so some relations were lost.

I posted an update mentioning your information. Thanks a lot
trixx | 01.12.06 - 11:07 am | #

Sorry for the off topic post, Siron, but it's high time you turned your great powers of analysis towards spying! No one seems to know what the formula is, or therefore what the optimal solution to spy allocation. Basically, how does the spying percent differential relate to the number of spys/defenders? I'm seeing games turn on these questions, so I'm surprised no one's answered them yet! Please help!
HooverDamned | 01.16.06 - 8:08 pm | #

Gravatar Hello Hoover,
I have no real clue about the spying system. About 1 year ago I started to build a hotseat save, where one race had all techs except spy techs and the other races were spying with a different number of spies....but you need several saves...and thats really work...because you have to play 100 turns or so to gain some useful information. So you need some weekends not playing moo2 online :P.
These map issues are really interesting and there are still a lot of questions...
...see also this new post by LordBrazen.
siron | 01.17.06 - 4:33 am | #

Anonymous said...

cxi might have a comment on the spy system. as a general rule spies seem to need an "insertion time" which seems to vary highly and depend on your techlevel and number of deployed spies. If this is true, that means the hide switch in the races screen DOES give you a benefit if you use it for some time. i am quite sure that it does give your offensive agents a roll bonus when the enemy defending agents try to catch them. Also i had better results efficiency-wise using few spies on the offense, even only 1 on many turns. the Darlocks used to be my favorite race in moo1 and i still like to use spies in moo2. too bad the sending of agents into specific colonies of the enemy didnt make it into the final version of moo2. the moo1 spying model is superiour to that of moo2.

siron said...

Interesting hypothesis. I will try to test this in the next weeks (but currently no idea how to do this efficiently).

Nyphur said...

I tested the assumptions in this article and found some of them to be faulty. I implemented the map generation tables described in this article and planetary distribution did not turn out like systems generated in-game.

It is more likely that the planet distribution in MOO2 is the product of a more complex set of rules and using only the final aggregate probabilities to generate planets is not sufficient. For example, constraints on empty star systems aren't taken into account.

I implemented a new set of rules making sure that certain system colours are never empty and certain ones always have at least one habitable planet. The results more closely resemble those in the game. That said, large parts of the post are spot-on and were very helpful. Thanks for taking the time to do it.

Eric said...

If you numbers are right, it is a nice (and probably almost never seen) touch, that the older galaxy (organic rich) has a higher probabilty of black holes.

siron said...

Nyphur,
if you want, you can mail me your map generator. We have far more details now, how the map is generated, so I can correct some of your probabilities.

Daniel said...

Thanks for the helpful information about number of stars and planet composition. I used it to help make a galaxy reflector to give everyone the same planets for fair games where no one gets an extra lucky start

Save game galaxy reflector

Anonymous said...


blue-white: 20%
white: 15%
yellow: 23%
orange: 25%
red: 15%
brown: 15%

This can't be right. If the numbers were correct there would be an average of less than one planet per star. Could you have mixed up the probabilites for getting 'something' with something else?