Get the inside scoop on my doings at Stardock.
Releasing Your Inner Slartibartfast
Published on February 7, 2006 By CaretFarmer In Modding

If you've been itching to make your own dream planet and don't mind doing a little minor surgery on the game's data files, read on! It's not difficult, but it does require rudimentary knowledge of XML and basic file editing skills. For this example, I'll be changing the appearance of the Yor's home star system and planets, but the steps can be applied to any of the game's races (including the custom race). I won't cover every little detail, but by the time you've finished reading this article, you should have enough information to go forth and create your own custom planets.

Before you do anything else, you should make backup copies of the files you're going to be editing, namely, CustomPlanets.xml and RaceConfig.xml. You'll find these files in the Data\English directory of the game's install directory. It is possible to make the game unplayable if you mess up these files, so save yourself a tech support call by backing up these files! Also, make sure you're editing the normal game data files and not the Metaverse data files--changing the Metaverse data files in any way could very well make it so that you can't submit games to the Metaverse!

Now that you've backed up those files, open CustomPlanets.xml in notepad. I recommend using notepad because it won't try to add strange text formatting tags or other XML junk that can derail the game's XML parsing code. If your favorite editor doesn't add anything more than what you type, you can use that too.

In CustomPlanets.xml, find the StarSystem node whose Name attribute is "Icos". This node defines the data used to describe the Yor's star system. I edited mine to look like this:

<StarSystem Name="Custom Yor">

<DisplayName>Lapeer</DisplayName>

<Planet Name="Almont">

<DisplayName>Almont</DisplayName>

<Class>15</Class>

<RAWTerrain>Strange.raw</RAWTerrain>

<Rings>gfx/planets/R03.png</Rings>

</Planet>

<Planet Name="Lapeer II">

<DisplayName>Lapeer II</DisplayName>

<Class>0</Class>

</Planet>

<Planet Name="Lapeer III">

<DisplayName>Lapeer III</DisplayName>

<Class>0</Class>

</Planet>

<Planet Name="Lapeer IV">

<DisplayName>Lapeer IV</DisplayName>

<Class>4</Class>

</Planet>

</StarSystem>

Here's what I changed from the standard Yor star system:

1. In this example, I've taken away one of the (useless) class 0 planets that the Yor would normally start out with. Feel free to add or remove planets as you like, but to avoid undesired behavior, stars should always have between 1 and 5 planets (inclusive).

2. I've changed the Name attributes and DisplayName tags so that the Yor's star is named "Lapeer" and their home planet is named "Almont". The other planets in the system are named "Lapeer II", "Lapeer III" and "Lapeer IV".

3. I bumped up the initial quality of the Yor's home planet from 10 to 15 by changing the value of the Class tag. Planet classes can range from 0 to 26, but you should make sure the home planet is usable (i.e., is at least class 3).

4. Finally, I gave the home planet a custom surface by specifying the name of a raw bitmap file. More on that a little later.

Save your changes and open RaceConfig.xml. Find the Race tag with a Name attribute of "Yor Collective". Change the value of the Homestar tag from "Icos" to "Lapeer" and the value of the Homeworld tag from "Iconia" to "Almont". Save your changes. You're two thirds of the way there!

 

The final step in creating your own custom planets is to make a height map that describes the planet surface. For this purpose, GalCiv 2 uses 384x192 8-bit grayscale images saved out as raw (i.e., headerless) data. The simplest way to create a height map is to use an off-the-shelf paint program to "paint" a height map. I use Paint Shop Pro, the programmer's paint program, but Photoshop will probably do the trick too. Basically, the whiter a pixel is, the higher the elevation in the generated terrain. So, pure black pixels will appear as deep oceans and pure white pixels will appear as snow-covered mountain peaks. What happens in between depends on the planet's class, but those details would probably bore you and they're apparent enough when you see what happens in the game. Once you've created your height map, save it to the Data\HeightMaps directory of the GalCiv2 install directory. For our example, I named my height map file Strange.raw.

If you made these changes with the game running already, you'll need to exit the game and restart it for your changes to take effect. Start a new game playing as the Yor and enjoy your handiwork!


Comments (Page 1)
7 Pages1 2 3  Last
on Feb 07, 2006
a smal question biside..do you don't think is a massiv cheet to your self when you do this? Stardock mabye don't say nothing ..it realy dosent matter is not a multiplayer game but with this changes you take out the implementet balancing between the races...i don't like to cheeting my self when i not able to win with this race normaly i am not good playing or don't understand something with this change i will be able to win easylest ..why shut i play than???
on Feb 07, 2006
Yes you can cheat in a way, or make it harder or take a balanced approach, like give all the start planets a bump up from 10 to 15 PQ. It would also be a start of modding, since having correct system names is a must. Fooling around with the custom races you can make an uber race or something if thats not your cup of tea, then you don't have to mess with it. Also in the example above that was modding one of the races. You can always let the computer play it for a challenge.

I use notepad++ that I found off of Sourceforge.. Which is pretty darn nifty for modders.

Also to be safe, I backed up the entire data directory not just 2 files. I did learn something as I hadn't made my own custom planet yet graphic wise. Thanks.

Mod on!
on Feb 07, 2006

It's not cheating to change the appearance of a planet, but changing its class or giving a home star system more usable planets definitely make the game easier to win.  Therefore, I'd agree with you and say that, yes, doing everything I outlined in this article makes it easy to cheat the game.  But, as you say, you're only cheating yourself.  If you don't want to cheat, then don't do it.  And if all you want to do is change the appearance of some of the planets in the game, don't make the change to the home planet class that I did in my example and you won't imbalance or cheat the game in any way.

on Feb 08, 2006
Thanks CaretFarmer, this ought to spice up the game a bit more (even though it doesnt need any more spicing up).
on Feb 08, 2006
Don't missunderstand me for me is the work from the programmers of Stardock art to manipulate something what not implementet from stardock is ...like to paint a beart on Mona Lisas face...
on Feb 08, 2006
I for one welcome the ability to do stuff like that as easy as that (long live XML!). One of the biggest "flaws" of GalCiv for me was always the planet names. Some of those are just a bit too wacky. I like to name 'em myself, so this is really helpful for me. Thanks, CaretFarmer!
on Feb 08, 2006
Last I checked, one of the bullet points of GalCiv2 was its MOD-ABILITY! The fact that we can see how easy it is to mod a planet before the game is even released, just shows us this is another area where Stardock has been upfront with us.

NICE CHANGE FROM OTHER DEVELOPERS!

BTW complaining about it seems trite. Stardock has assured us that the Metaverse is NOT MODABLE, so cheaters beware!! I am inclined to believe them about this too.

Chris.
on Feb 08, 2006
Ah... combine modding with player ship design.
The possibilities are limitless.
on Feb 08, 2006
Can I ask what the specs are for leader portraits? I imagine I could change a custom races portrait by changing the reference in the xml file but how big are the portraits ? What about the other graphic ? The one that represents your race ?

Also how hard is it to modify a map or make a custom one ?

Regarding star names theres two text files in the data directory, one called stars.txt and one stars.lst. Does the game use them both? If we want to toss in some of our own names which one to use ?
on Feb 08, 2006
The race portraits are simply 256x256 PNG images named after the format RaceImageXX.png (where XX is a two digit number not used by another image) and placed in the Gfx/Races directory. Race logos are likewise 128x128 PNGs named RaceLogoXX.png in the same location.

Maps are not really editable yet. Hopefully there will be a map editor eventually, but even now the devs have commented it's a real pain at the moment
on Feb 09, 2006

Regarding star names theres two text files in the data directory, one called stars.txt and one stars.lst. Does the game use them both? If we want to toss in some of our own names which one to use ?

Stars.txt is the file used by the game.  Stars.lst should no longer be there when you do a clean install of 1.0.

on Feb 11, 2006
I would personally like to see a Dev journal on why custom maps are so hard to do. I just dont see why it would be a pain, and I like to learn, so if they could clear that up for me and others that are also curious, that would be great
on Feb 13, 2006
So, how do you add rings or asteroids. How do you add artifacts, special soil, ect.

Chris.
on Feb 13, 2006
Thanks CaretFarmer. Kudos for the modding support.
on Feb 14, 2006

I would personally like to see a Dev journal on why custom maps are so hard to do. I just dont see why it would be a pain, and I like to learn, so if they could clear that up for me and others that are also curious, that would be great

It's not hard, it's just that the map editor utility is a little, um, tempermental at the moment.  Stardock plans to release the map editor utility eventually but right now it's just too difficult to work with.

7 Pages1 2 3  Last