### Terraforming Costs (advanced)

Posted:

**Thu May 01, 2008 4:00 pm**This is the in-depth information for terraforming costs, see

viewtopic.php?f=157&t=58

for the basics

-------------------------------------------------------------

-------------------------------------------------------------

First of all, I've found a very useful global multiplier for terraforming costs. It's located in trek.exe, starting position 0x0017d3c8, length 4 bytes. The default value is 0.1, and this leads to the expanded formula:

[terraforming cost] = 10 * [global multiplier] * [planet's population capacity] * ( [planet type coefficient] + [planet atmosphere coefficient] )

If the sum of the 2 coefficients is 0 or negative AND the planet's atmosphere is "oxygen rich" or "thin oxygen" (maybe also "none", but there's no way to test it yet), then the planet does not need to be terraformed at all, and it's class letter will appear green on the system screen.

In all other cases, the result of the expanded formula is cut at the decimal point and then taken modulo 65536 so that it's within the interval [0 ; 65535]. This can make the planet "green" by accident (if it hits 0), regardless of atmosphere.

I've found the coefficients for all atmosphere types except "none" in trek.exe:

coefficient for "thin oxygen" atmosphere

starting position: 0x0017d3a8

length: 8 bytes

default value: -1.0

coefficient for "sulfuric" atmosphere

starting position: 0x0017d3b0

length: 8 bytes

default value: +1.25

coefficient for "rich oxygen" atmosphere

starting position: 0x0017d3b8

length: 8 bytes

default value: -1.5

coefficient for "methane" atmosphere

starting position: 0x0017d3c0

length: 8 bytes

default value: +1.5

I haven't found the planet classes' coefficients yet, also the coefficient for atmosphere type "none" is missing. It's 1.0 by default, so maybe it's not stored at all.

viewtopic.php?f=157&t=58

for the basics

-------------------------------------------------------------

-------------------------------------------------------------

First of all, I've found a very useful global multiplier for terraforming costs. It's located in trek.exe, starting position 0x0017d3c8, length 4 bytes. The default value is 0.1, and this leads to the expanded formula:

[terraforming cost] = 10 * [global multiplier] * [planet's population capacity] * ( [planet type coefficient] + [planet atmosphere coefficient] )

If the sum of the 2 coefficients is 0 or negative AND the planet's atmosphere is "oxygen rich" or "thin oxygen" (maybe also "none", but there's no way to test it yet), then the planet does not need to be terraformed at all, and it's class letter will appear green on the system screen.

In all other cases, the result of the expanded formula is cut at the decimal point and then taken modulo 65536 so that it's within the interval [0 ; 65535]. This can make the planet "green" by accident (if it hits 0), regardless of atmosphere.

I've found the coefficients for all atmosphere types except "none" in trek.exe:

coefficient for "thin oxygen" atmosphere

starting position: 0x0017d3a8

length: 8 bytes

default value: -1.0

coefficient for "sulfuric" atmosphere

starting position: 0x0017d3b0

length: 8 bytes

default value: +1.25

coefficient for "rich oxygen" atmosphere

starting position: 0x0017d3b8

length: 8 bytes

default value: -1.5

coefficient for "methane" atmosphere

starting position: 0x0017d3c0

length: 8 bytes

default value: +1.5

I haven't found the planet classes' coefficients yet, also the coefficient for atmosphere type "none" is missing. It's 1.0 by default, so maybe it's not stored at all.