Adding a New Planet-Type (workaround)

Adding a New Planet-Type (workaround); support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Dafedz
Lieutenant-Commander
Lieutenant-Commander
Posts: 109
Joined: Mon May 05, 2008 2:00 am

Adding a New Planet-Type (workaround)

Post by Dafedz » Sat Jul 11, 2015 1:31 pm

This might be considered just a small enhancement to game-play, but it's worth sharing here. The current planet-types are, as we know:

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).

Image

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.

Image

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.

Image

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. :grin:

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
'E9' is Energy. Change this to F6 (Food).

Habitability >
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
Next, open trek.exe in the hex editor

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
Environment >
Open file environ.est in your hex editor.

Image

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'.

Image

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.

Designation >
'Gas Giant' is found in multiple places in trek.exe. Edit the following locations:
0x176c81
0x17d398
0x17d798
0x17dad0

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

Image

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
One other thing: Gas Giants are also mentioned in UE > Edit > Text > Lexicon. So remember to change those entries.

Colonization >
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
And that should be it. This is a picture of my ultra rare super-terran planet in UM5, operating alongside a Gas Giant whose slot it now occupies.

Image

Many thanks to Thunderchero and QuasarDonkey for their invaluable help in getting this to work! :grin:

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6056
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Adding a New Planet-Type (workaround)

Post by thunderchero » Sat Jul 11, 2015 2:22 pm

very nice addition. as you said it opens many possibilities. :up:

thunderchero

User avatar
Raider Echo3
Cadet 3rd Year
Cadet 3rd Year
Posts: 14
Joined: Wed May 27, 2015 11:58 am

Re: Adding a New Planet-Type (workaround)

Post by Raider Echo3 » Fri Jul 17, 2015 5:09 am

This is great and I am pretty sure it will find its way into mans mods. ;)

User avatar
Axis
Lieutenant-Commander
Lieutenant-Commander
Posts: 142
Joined: Sun Aug 16, 2015 8:28 am

Re: Adding a New Planet-Type (workaround)

Post by Axis » Fri Aug 21, 2015 5:59 am

I think this is absolutely marvelous discovery!

I mean, after playing the Master of Orion II I thought that this "Gaia"-type of planets was fascinating.

And after reading this post, I thought I`d add my own "X-class" (X for exotic) planet type almost like this M+ class.

It won`t be green as in MoO 2, but I thought it would have a turquoise tone to it
(I think the gases in its atmosphere are slightly different and cleaner than the regular Terran worlds have, that`s also why it can support more lifeforms and plant life of any kind on it).

Update : And here it is now!
Gaiasystem.jpg
Gaiasystem.jpg (33.6 KiB) Viewed 2626 times

User avatar
Axis
Lieutenant-Commander
Lieutenant-Commander
Posts: 142
Joined: Sun Aug 16, 2015 8:28 am

Re: Adding a New Planet-Type (workaround)

Post by Axis » Fri Feb 05, 2016 7:39 am

And here's a tip for anyone reading : I made the planet animations wider for my new 1920 x 1080 project (they looked too tightly packed in the first version), now the dilithium and such are also more visible in this wider presentation.
System 1920 x 155.jpg
System 1920 x 155.jpg (103.14 KiB) Viewed 2466 times

User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Adding a New Planet-Type (workaround)

Post by EnPhreg » Fri Jul 22, 2016 7:32 am

sry, useless post. can be deleted.

Post Reply

Return to “Adding a New Planet-Type (workaround)”

Who is online

Users browsing this forum: No registered users