0 - Arctic
1 - Barren
2 - Desert
3 - Gas Giant
4 - Jungle
5 - Oceanic
6 - Terran
7 - Volcanic
Beforehand, the only way to add a new-class was to replace one of these old classes. But with a little bit of creative tinkering, it is possible to add a new class while retaining the presence of ALL the existing ones. Key to this, is the somewhat enigmatic (until now) Gas Giant slot (03).
Gas Giants are (were) pretty useless. I know Tethys with his Galaxies mod has tried making them more interesting. But most of all they serve as just cosmetic 'backdrop'. It was little more than an animation of a Gas Giant planet spinning in space. It didn't add anything to gameplay beyond that. And the Gas Giant slot couldn't really be modded, not very cleanly, because the slot was 'wired' to Gas Giants and behaved differently to everything else (ie, they couldn't be inhabited or even terraformed).
So what I did, initially, was to change the Gas Giant to another class. It's not as crazy as you think, not when you consider the plethora of moons, mostly icy moons, that our own solar system's Gas Giants have in orbit. In the changes I've made, Gas Giants are treated as P-class (arctic) planets, even though they themselves aren't P-class worlds, they remain the same, as the spinning animations they always were, but it's their moons here that are actually the arctic world, and terraformable assets the same as any other P-class world.
All this was pretty basic stuff to change in UE. Go to Edit > Galaxy > Planets, select 'Gas Giants' from the drop down menu, and simply change 'type' to arctic, and their size preferably to 'small'. I also gave them 'thin oxygen', and in the planet name (in this example) changed 'Saturn' to 'Saturn (moons)', indicating moons are available to terraform. Once this was done, I updated the animations to include a graphical representation for these moons being present. A thread on this here
The moons shown here are just static additions to the existing animations. I lined them up like that just to 'show' that moons are present, and that they can be terraformed. I even managed to (kind of) get the terraforming overlay to line up.
What all this means is, you can keep Gas Giants in the game, in no real different shape than they already were (in fact better, because we can terraform these moons), and at the same time free up a planet slot. Because what we are presented with, after making Gas Giants P-class, is free up the old, now vacated, Gas Giant slot, ripe for exploitation.
I'm sure you can think of many new planet types you'd like to add. Such as a variable K-class or N-class worlds, Mars-types, or even demon-class. The choice is yours. For my experiment (deciding there were enough variable, adaptable planet-types already) I decided to add another kind of terran, M-class planet, much in accordance with what has already been observed in reality, namely Gliese 581c, a 'super-earth', 5,5 times the mass of earth, and located some 20ly away (https://en.wikipedia.org/wiki/Gliese_581_c)
First thing I needed to do was to get the planet to behave like a terran class. Gowron supplied the solution to this in his thread Planet Bonus Types.
Planet Bonus >
Code: Select all
0x3E264 E9 gas giant
habit.bin is the file in question here. Further info about it here: Habitability Values
Open habit.bin in your hex editor. Set to 8 bytes per row.
I wanted to change the Gas Giant defaults to Terran.
Code: Select all
bytes 48 to 55 >> 03 08 00 00 00 00 00 00 << 03 0A 09 0A 0A 09 07 0A
Many thanks to Thunder for this information. This fix effectively skips the 'Uninhabitable' textual call for the given planet, replacing it with normal population and growth rate.
Code: Select all
At 0xfc332 >> 0xfc332 66 3D 03 00 0F 84 FA 03 00 00 << 0xfc332 90 90 90 90 90 90 90 90 90 90
Open file environ.est in your hex editor.
I swapped out this code and changed it to the terran defaults, found further down the list. Note, I gave my new super-earth planet type the designation 'Super-M'.
Planet Order >
"03" (gas giant) at position 0xB38C1 -- change to 08 to disable check.
I believe this works as intended. It basically means that your new class won't be placed on the outer edge of a system like a Gas Giant usually would be.
'Gas Giant' is found in multiple places in trek.exe. Edit the following locations:
Class Letter >
Gas Giants are B-Class. You'll probably be wanting to change that for any new planet you introduce.
The Class Letter for Gas Giants ('B') is listed in trek.exe at 0x180550.
Note on Special Characters:
Bear in mind, that only letters A - Z are supported in this system. I wanted to call my new super-earth 'M+'. For that '+' to show up, I had to get Thunder's help. His solution was to edit the *9.fnt files for all the major empires, because '+' is not included. This thread is important in learning how to do this.
Below is a blown-up example of the file human9.fnt
Thanks to Thunder for this also: The lettering of B-Class in Solar System view for Gas Giant was blue, unlike any other planet type. This was to illustrate that the planet was uninhabitable. A fix for this:
Code: Select all
0x0fb20f >> B9 00 00 FF 00 BA 50 27 58 00 89 4C 24 68 0x0fb20f >> 90 90 90 90 90 BA 50 27 58 00 90 90 90 90
This was the key, and the final hurdle in getting this to work. Up until this point, any new planet-type you create for this slot CAN be populated, but only when located in a system with other planets. Once those other planets are terraformed, the system is colonized as normal, and the population of your new planet will be included in the max pop. BUT, by themselves, any new planet type using the Gas Giant slot, cannot be colonized by itself.
I tried to figure it out, Thunder tried to figure it out. We knew there had to be a control/switch/exclusion somewhere in the assembly code that the game used to skip firstly the terraforming process (because Gas Giants cannot normally be terraformed ofc), and secondly, that your new replacement planet can in fact be colonized (unlike a Gas Giant, which the game always wants to treat as a Gas Giant - ie, uninhabitable.).
That's where QD came in and saved the day. He found it in the subroutine called Game_SolarAPI_IsSystemEmptyAndHabitable subsection checkPlanetHabitable. Here, the hard-coded check for Gas Giants could be be disabled.
Code: Select all
Habitable Gas Giants, by QuasarDonkey >> 0x447d1 80 79 48 03 74 EA << 0x447d1 90 90 90 90 90 90
Many thanks to Thunderchero and QuasarDonkey for their invaluable help in getting this to work!