Planet maximum population calculations.

Information, How-to's, and discussion about mod'ing Master of Orion II.
User avatar
Lord Brazen
Site Admin
Posts:162
Joined:Mon Jul 18, 2005 10:16 pm
Location:Toronto, Canada
Contact:
Planet maximum population calculations.

Postby Lord Brazen » Thu Oct 13, 2005 4:21 pm

Here how the max pop is calculated (without a mixed pop).

Two tables are used in the calculations.

Planet size multiplier table at offset 0x1F3E5A in orion2.exe. Each value represents a multiplier based on planet size.

Code: Select all

05 0A 0F 14 19
Planet environment multiplier table at offset 0x162B3F in orion2.exe. Each value represents a multiplier based on planet environment. Aquatic races use terran value for tundra/swamp and Gaia value for Terran.

Code: Select all

19 19 19 19 19 19 28 3C 50 64
Tolerant races receive a bonus.

Code: Select all

tol_flag = 0 when not tolerant race = 25 when tolerant race
Next, we lookup the values in the tables and calculate the raw max pop.

Code: Select all

env_mult = tol_flag + value_from_env_able NOTE: env_mult is limited to a maximum of 100. size_mult = value_from_size_table raw_max = (env_mult * size_mult + 50) / 100
Next, the max population is adjusted for Subterranean races and advanced city planning.

Code: Select all

subt_bonus = ( planet_size +1 ) * 2 NOTE: subt_bonus is 0 if race is not subterranean. city_bonus = 5 if Advanced City Planing tech is known. = 0 if not. max_pop = raw_max + subt_bonus + city_bonus
"Stars are holes in the sky from which the light of the Infinite shine through." - Confucius.

User avatar
siron
Posts:504
Joined:Fri Jul 22, 2005 12:35 pm
Location:Hamburg
Contact:

Postby siron » Fri Oct 14, 2005 8:36 am

Nice!

Finally, we can get rid off these 1pop tinies.

Some remarks:

size_mult are the gaia values (whole surface can be used on this planets).
env_mult is the percentage of the surface which is habitable.
raw_max = (env_mult * size_mult + 50) / 100
The added 50 are just a technical issue.
The raw_max (or at least the max_pop-value) is truncated as last step. With this 50 added it works like
env_mult / 100 * size_mult
is rounded up when the decimal place is 5 or above.


Return to “Game Modifications”

Who is online

Users browsing this forum: No registered users and 47 guests