Terraformer for Final Frontier Plus

Adding my planet Mod to Final Frontier Plus 2.3

I've played one game on the latest available version on marathon.

Note that I won rather due to blitzkrieg with bombers than due to having a developed warship producton, there was only one typical siege with high losses only due to system being out of range of bombers- AI had no fighters and destroyers, I often see AI without any protection like that even if I extensively use bombers (it only builds SDN).

About planets I haven't really used buildings added by this mod except d class because I haven't researched required technologies- I haven't made it even into exploration era.
Maybe they are available a bit too late?
A feature that would be helpful when conquerng systems would be an option of rebuilding basic building provided by colonization- mining facility and greenhouse. I thinkt that it was developed in kek mod but not finished.
I found one another bug, I don't know whether it is solved in final frontier plus- I can build on planet I can't build on
View attachment 717823
I'll have a look. Maybe you need to build a interplanetary beacon on your homeworld?
 
Here is the latest version
Wonders -
National wonder - Zero G sports facility - which helps with happiness
The Titanic Elevated Glasshouse is now a wonder - and provides +2 food and +1 health to all your colonies
Texture changes
Mars and desert planets now have oceans added when you build the water management
Pink moon fixed
Most planet textures enhanced
Planets
All planets bar Home worlds, gia's and swamps have 1 less food
Gray (Class D), Ice (P), Toxic (N/Y), and Lava(G) worlds get +1 food with their outposts
Mars and Desert worlds start with 2 food, but they need the water management systems to get their +1
Citizens now require 2 food instead of 1.
Buildings
3 different kinds of silo to help with growth (only 1 of each allowed in the system, depending on what planets you have)
Herbal facility for swamp worlds
Penal colonies to help with maintenance
Buttons
Fixed the background so they blend in now with the original buttons - hope you like the artwork - pity its limited to 56x56 after the border is added - perhaps there is scope to modify the tech panels to add artwork. The 3d space in the pedia is mostly blank


I think I've added enough buildings for now, so I'm going to focus on
Units - Flanking
Kek mod addition
 

Attachments

I've played one game on the latest available version on marathon.

Note that I won rather due to blitzkrieg with bombers than due to having a developed warship producton, there was only one typical siege with high losses only due to system being out of range of bombers- AI had no fighters and destroyers, I often see AI without any protection like that even if I extensively use bombers (it only builds SDN).

About planets I haven't really used buildings added by this mod except d class because I haven't researched required technologies- I haven't made it even into exploration era.
Maybe they are available a bit too late?
A feature that would be helpful when conquerng systems would be an option of rebuilding basic building provided by colonization- mining facility and greenhouse. I thinkt that it was developed in kek mod but not finished.
I found one another bug, I don't know whether it is solved in final frontier plus- I can build on planet I can't build on
View attachment 717823
This version needed you to build outpost just to use the planets, that's why it appeared to be a bug sorry. I've changed the dynamic for the latest release, so hopefully this wont appear
 
Last edited:
I get this error when running v2.1
Spoiler :

1739095412958.png


Fix:
Line 713 in CvGameUtils.py should be:
if (eBuilding == iintelcenter):
 
thanks Aradziem, updated. Does the game soldier on, or crash out?
 
Last edited:
Does the game soldier on, or crash out?

As far as I played this error was the only one that appeared.

p.s. Can you quote only the part of text you are referring to instead of whole message? That could make your messages easier to understand.
 
OK, finally got the basic planets and artwork to load into final frontier plus
I'm thinking about a name for the mod - how does Terraformer sound?

I've basically edited the following 4 files for now, and of course added the solar system nifs and planet texture files

XML/CIV4ArtDefines_Feature
Python/CvSolarSystem.py
Python/Screens/CvMainInterface.py
Python/Screens/CvPlanetinfoScreen.py

I've left #PLANETMAKER comments in all the python code so you can see the changes if you want

Note that you must install ff+modificaltions supplied kindly by Aradziem earlier in the thread first before installing the version attached

Now I need to figure out how to add the buildings. At the bottom of the old cvsolarsystem file there is

# Buildings

g_aiBuildingYieldIncrease = []
g_aiBuildingPopCapIncrease = []
g_aszBuildingDummyTags = []

# Hardcoded (This is Bad)
for iBuildingLoop in range(84):
g_aiBuildingYieldIncrease.append([0,0,0])
g_aiBuildingPopCapIncrease.append(0)
g_aszBuildingDummyTags.append("")

g_aiBuildingYieldIncrease[1][0] = 1 # Atmospheric processor
g_aiBuildingYieldIncrease[2][1] = 1 # Mining Facility
g_aiBuildingYieldIncrease[3][2] = 1 # Road Network
g_aiBuildingYieldIncrease[4][2] = 2 # Mag Lev Network
g_aiBuildingPopCapIncrease[5] = 1 # Habitation Center


...etc

This is how I added all the building planet yield increases, I see all this is removed from the new final frontier plus so I'll have to figure out where its gone... shouldn't take too long... unless it still works as is...
 

Attachments

Note that you must install ff+modificaltions supplied kindly by Aradziem earlier in the thread first before installing the version attached
I recommend installing final frontier plus then 1.9 then kek-mod then my modifications to it and then terraformer because I haven't supplied whole final frontier plus.
I think someone should provide whole final frontier plus as one file because installing newest version is getting long and complicated.


I've found a bug in your version planet mod(2.1):
Python:
                # Has yield, add to the total
                if (aaiPlanetYields[iPlanetType][iYieldLoop] > 0):
                    aiTotalYield[iYieldLoop] += aaiPlanetYields[iPlanetType][iYieldLoop]
                  
                    if (aaiPlanetYields[iPlanetType][iYieldLoop] > aiMaxPlanetYield[iYieldLoop]):
                        aiMaxPlanetYield[iYieldLoop] = aaiPlanetYields[iPlanetType][iYieldLoop]
Planets may have negative yields but they won't be accounted during solar system generation. This may lead to too weak solar systems.

I'm working on moving some of final frontier plus solar system to dll to make use of c++ speed and AI features implemented there.
 
I recommend installing final frontier plus then 1.9 then kek-mod then my modifications to it and then terraformer because I haven't supplied whole final frontier plus.
I think someone should provide whole final frontier plus as one file because installing newest version is getting long and complicated.


I've found a bug in your version planet mod(2.1):
Python:
                # Has yield, add to the total
                if (aaiPlanetYields[iPlanetType][iYieldLoop] > 0):
                    aiTotalYield[iYieldLoop] += aaiPlanetYields[iPlanetType][iYieldLoop]
                
                    if (aaiPlanetYields[iPlanetType][iYieldLoop] > aiMaxPlanetYield[iYieldLoop]):
                        aiMaxPlanetYield[iYieldLoop] = aaiPlanetYields[iPlanetType][iYieldLoop]
Planets may have negative yields but they won't be accounted during solar system generation. This may lead to too weak solar systems.

I'm working on moving some of final frontier plus solar system to dll to make use of c++ speed and AI features implemented there.
This is John's original code. It was not designed for use with so many planets. I have added the 3rd orbit rings checker, and extra checks later on. We have two choices here:

Modify the code to include negative yields and then add checks and balances with them later.
Or replace the random generator with something completely new, a scripted generator
Please see spoiler for pseudo code idea (unfinished work in progress)

Spoiler :

Quick reminder of classes

M: Earth like planets (green, home1-4)
Mg: Gia planets some building restrictions (gia1-4)
Ms: Swamp planets many building restrictions (Swamp1-4)

D: gray worlds (Gray, Gray1-16)
L: Brown planets (Brown1-4)
H: Desert planets (Desert1-4)
K: Mars planets (Mars1-4)
P: Ice planets (Ice1-8)
G: Lava planets (Red,Lava1-4)
N/Y: Venusian/Toxic planets(Toxic1-8)

J: Large Gas Gaints
S: Very Large Gas Giants
T: Huge Gas Giants

gas giants have a secondary class for its main moon type eg SD is Large gas giant with Gray moons


planets slots 1 -3

random number of planets 1-3 (if starting system 2-3)

if 1,
M in position 3 (30%) (Situation 1Aa)
or best K in position 3 (10%) (Situation 1Ab)
or Mg in position 2 (20%) (Situation 1Aa)
or Ms in position 2 (20%) (Situation 1Ac)
or best H in position 1 (10%) (Situation 1Ab)
or best H in position 2 (10%) (Situation 1Ab)
*note free interplanetry beacon on mars, swamp and desert worlds or they will get stuck quickly without any values*

if 2,
starting systems
good M(44% of starting systems), Mg(20% of starting systems) or Ms(20% of starting systems) in position 3
with G or L or productive D or JD in position 1 (chances with M 25%, Mg 35%, Ms 40%) (Situation 1Ba)
or same but non gas giant only in position 2 (chances with M 25%, Mg 25%, Ms 50%) (Situation 1Bb)
or mild N/Y (toxic3,4,7 or 8) in position 2 (chances with M 50%, Mg 40%, Ms 10%) (Situation 1Bc)
or best H in position 2
with productive D in position 1 (4% of starting systems) (Situation 1Bc)
or productive L in position 3 (4% of starting systems) (Situation 1Bc)
or best K in position 3
with D (gray12 or gray16) in position 1 (4% of starting systems) (Situation 1Bd)
or good L in position 2 (4% of starting systems) (Situation 1Bd)
non starting system
1 M in positions 2 or 3, D,L,H,N/Y or G in position 1 or 2 but no gas giants (40%) (Situation 1Ca)
or Ms in position 2, D in position 1 or 3 (30%) (Situation 1Cb)
or H in position 1 or 2, D in position 2 or 3 (30%) (Situation 1Cc)

if 3,
starting systems
good M in postion 3 (70% of systems)
with G in 1 and good D in 2 (Situation 1Da)
or good D in 1 and extreme N/Y (toxic1,2, or 6) in 2 (our solar system start...) (Situation 1Db)
or extreme G in 1 and commercial D in position 2 (Situation 1Dc)
good gia in position 2 (30% of systems)
with JN/Y in position 1 and good D in position 3 (Situation 1Dd)
or G in position 1, productive D or L in position 3 (Situation 1De)

non starting systems
Ms in position 2 and anything goes but with at least 1 planet with production 2 in positions 1 and 3 (Situation 1Ea)
or M or Mg in position 3 and D,L,H,N/Y, or G in 1 and 2 but with at least 1 planet with commerce 3 (Situation 1Eb)
or desert in 1 or 2 and anything goes in the other slots but with at least 1 planet with production 2 (Situation 1Ec)
*note no P in positions 1 - 2, rarely in 3

Planet slots 4 - 6
situation 1Aa: 3 planets D,L,K, or G, but with at least 1 gas giant and 1 planet with 2 or more production
situation 1Ab: 3 planets D,L,K, or G, but with at least 2 gas giants and 1 planet with 2 or more production and 5 or more commerce
situation 1Ac: 3 planets D,L, or G, but with at least 2 gas giants and 1 planet with 2 or more production and 5 or more commerce

Situation 1Ba: Positions 4 and 5 planets D,L,K or G, but with at least 1 gas giant with 4 or more commerce, P in position 6
Situation 1Bb: Positions 4 and 5 planets D,L,K or G, but with at least 2 gas giant 1 with 4 or more commerce, D in position 6
Situation 1Bc: Positions 4 and 5 planets D,L,K or G, but with at least 2 gas giants and 1 planet with 2 or more production, P in position 6
Situation 1Bd: Positions 4 and 5 planets D,L,K or G, but with at least 1 gas giant and 1 Ms, D in position 6

Situation 1Ca: 2 planets (50% of systems), D,L,K or P but with at least 1 gas giant and one N/Y
or 3 planets (50% of systems), D,L,K or P but with at least 1 gas giant and one toxic
Situation 1Cb: 2 planets (50% of systems), anything goes, but with at least 1 gas giant and one toxic and 1 planet with 2 or more production
or 3 planets (50% of systems), anything goes, but with at least 1 gas giant and one toxic and 1 planet with 2 or more production
Situation 1Cc: 2 planets (50% of systems) 1 productive M or Mg in position 4, 1 toxic gas giant in position 5 or 6
or 3 planets (50% of systems)1 productive M or Mg, 2 different gas giants

Situation 1Da:

Planet Slots 7 - 8
D(25%),P(25%),L(10%),K(5%) or any Gas Giant(30%). Systems have a 70% chance of both slots being full (90% if only 1 planet in slots 1 -3)


 
Now I need to figure out how to add the buildings. At the bottom of the old cvsolarsystem file there is

# Buildings

g_aiBuildingYieldIncrease = []
g_aiBuildingPopCapIncrease = []
g_aszBuildingDummyTags = []

# Hardcoded (This is Bad)
for iBuildingLoop in range(84):
g_aiBuildingYieldIncrease.append([0,0,0])
g_aiBuildingPopCapIncrease.append(0)
g_aszBuildingDummyTags.append("")

g_aiBuildingYieldIncrease[1][0] = 1 # Atmospheric processor
g_aiBuildingYieldIncrease[2][1] = 1 # Mining Facility
g_aiBuildingYieldIncrease[3][2] = 1 # Road Network
g_aiBuildingYieldIncrease[4][2] = 2 # Mag Lev Network
g_aiBuildingPopCapIncrease[5] = 1 # Habitation Center


...etc

This is how I added all the building planet yield increases, I see all this is removed from the new final frontier plus so I'll have to figure out where its gone... shouldn't take too long... unless it still works as is...
It's in XML
e.g. mining facility:
XML:
<iCostModIncrease>2</iCostModIncrease>
<PlanetYieldChanges>
<iYield>0</iYield>
<iYield>1</iYield>
<iYield>0</iYield>
</PlanetYieldChanges>
<TraitPlanetYieldChanges>
<TraitPlanetYieldChange>
<TraitType>TRAIT_THE_FORGE</TraitType>
<PlanetYieldChanges>
<iYield>0</iYield>
<iYield>1</iYield>
<iYield>0</iYield>
</PlanetYieldChanges>
</TraitPlanetYieldChange>
</TraitPlanetYieldChanges>
habitation system:
XML:
<iCostModIncrease>2</iCostModIncrease>
<iPlanetPopCapIncrease>1</iPlanetPopCapIncrease>
 
I've ran into a problem. On a plot with a solar system there is always a city that isn't initialized (and is detected by plot->isCity()). It's not NULL but 0xfeeefeee.
1739476730948.png

I don't know how to solve this, writing
&&
(m_pArray[iIndex].pData != 0xfeeefeee) in first if doesn't help
. It crashes game whenever I continue.
Attached c++ files I modified and whole python and XML folders. Install this onto kek-mod files (not terraformer).
 

Attachments

Last edited:
My knowledge of C++ is like my python, very low. But a quick search on 0xfeeefeee shows that it is free memory, perhaps C++ is deleting the class too quickly? Or the null city doesn't yet have its text structures?
 
Last edited:
I figured it out. You are right c++ deleted it too quickly. In my solar systems creating functions I assigned classes to variables instead of assigning pointers. This caused deletion of classes after a function has ended so memory was released. Then something tried to access these deleted classes but they didn't exist, so exceptions occured (memory access violations - program tried to access memory but it had no permission to access this part of it). There were so many exceptions that game couldn't work.
Now it looks like I've done something about plot wrongly so I'll have to fix this.
 
Last edited:
Terraformer has a misleading sentence in installation manual. Don't install Planetfall - it's not compatible.Last sentence should be:
Install Terraformer for Final frontier Plus overwriting files
 
OK, so here it is. sorry for the delay
It seems to work, but somehow I've broken the panoptican and prism array buildings, civ 4 has errors when loading them :(
any ideas?
 

Attachments

Last edited:
Patch 1.01
Building Fixes
Panoptican and Prism array no longer show errors on loading, but most of their text information is missing - (I cant find the text entries in any of the patches)

Solar system minor changes/fixes
If your start (best) planet is ice with less than 0 production it is changed - this prevents 0 production starts (ice1-4 to ice5-8)
No ice gas giants in position 1
 

Attachments

My focus now:

Consistency in Help texts, language descriptions
Solar system generation revamp - adding the scripting and perhaps making it a choice in map generation - default (Modified random system generation by John) or scripted generator
 
I' ve made working solar system generation code in c++, but I haven't made most of code that allows using them, if you want it I can share current state.

1.01 has one faulty file. It is attached to this message. Place it here: Final Frontier Plus\Assets\XML\Buildings
 

Attachments

Last edited:
Back
Top Bottom