A trip through the fantasy worlds I enjoy

 

In a prior Developer Blog (https://forums.galciv3.com/461709/page/1/ ) I talked about all the cool stuff you can do in the Custom Race tool. We give you a bunch of images, traits, abilities and settings to create whatever race you want.

But, if you really want to make something unique you can go so much further. In this post I’ll talk about how modding works in Galactic Civilizations III and show you how I used it to make a new faction for the game, the Ghosts of Abbadon.


How does modding work?

Mods are files placed in your My Games/GalCiv3/Mods/ directory. They can include graphic and XML files. You can have as many mods in here as you want, but keep them in their own directories (so if you want to remove one it’s easy to do). The plan is to get some Steam Workshop integration in here to help manage this at some point. But first we are getting the system working.

NOTE: We use a file structure to help with organization, but the game actually just searches all subdirectories when looking for files. So your files must have unique names (even if they aren' in the same directory).

At a high level there are three things you want to do when modding. You either want to add something, modify something or delete something.

  1. Adding things. This is the easiest, just create a new XML file, with a new name. It doesn’t matter what the name is, as long as it isn’t the same as an existing file. Personally I like using the same name that it uses in GC3, but I append the mod name to make sure it is unique. The only other thing that matter is that it is in the right directory. Faction Defs, Star System Defs and Planet Defs are all in the Game folder (because if you look at the XML in the GalCiv’s real directories those files are in the Game folder). You have to match GalCiv3’s file placement so that the modded files load correctly. Add a new file in here with just the new Faction, Star System, Planet, Tech, Improvement, Ideology Trait, etc (there are about 150 moddable xml files in GC3). Anything Paul can add to the game, you can add too.
  2. Modifying things. What if you want to increase the amount of credits the Iridium to start the game with? If you ever want to modify an existing object you just need to copy the file from the GC3 directories and modify what you like, but be sure to keep the name exactly the same. When the game starts if it sees a file with an identical name in your mod directory to one of the base files it uses your mod file instead. This gives you ultimate control over overwriting anything in the base game (without ever having to modify a base game file).
  3. Removing things. Since you can overwrite any of the existing XML files our deletion solution is built right in. If there is a particular global event that annoys you can copy that xml file into your mod directory, delete that event form your copy and voila, it’s gone.

Now let’s use this power to create a new faction, the Ghosts of Abbadon. The Ghosts are unlike any other faction in GC3, and we want to be able to do more with them than the Custom Race tool normally allows. In this case they have ruined their homeworld and used the last of their resources to prepare 3 colony ships to go out and attempt to find a new home.

How do we do this?

1: Copy the FactionDefs.xml file into my new mods \My Games\GalCiv3\Ghost\Game\ directory.

2: Rename it from FactionDefs.xml to FactionDefs_Ghost.xml. (I don’t want to overwrite the existing factiondefs, I just want to add a new one).

3: Open up the file (I use Notepad++ for this) delete the other entries, except maybe one I am about to use as a template, and add the XML for my faction.

There are lots of things set here. But the important things here are that <HomeStarSystem> is set to “DeadSystem” where normal factions have a Colony, Scout and Survey ship in <StartingShips> they have 3 Colony ships instead. We could put anything we want in here, 12 Colony ships, a Battleship, a fleet of flying toasters, etc.

I played with a bunch of options with their starting ships. At first I gave them the extra colony ships in addition to the normal Survey and Scout. But when it was just Colony ships it made them feel a more desperate. They don’t have the luxury of having a scout out finding planets for them, or time spent collecting anomalies. When they choose to set out for a star it becomes a dramatic step, and when there is nothing there it is a tragedy of the time of a very valuable resource wasted. And when they find a worthwhile planet it is a huge joy. The hardest part is finding a mediocre planet, do they keep going, looking for something better, or settle?

I used the Terran definition for most of their art aspects, and I’m using one of the extra faction foregrounds and backgrounds that come with the game (“Devilgirl”) for the leader art. We could create our own versions of any of this. If you had a custom image you wanted to use for your faction you would just reference it here, I think Paul has one for his dog Maggie.

The only custom art I created for them is that I created a new material in <Material1>, Ghost_Ship_Material_01.

To do that I added a new file for my mod, this time in the \Mods\Ghost\Core\ directory. I’ve used it to define a new material that I can use to create ships. Materials aren’t colors (you will want to add appearances to modify ship colors). They define the way that light interacts with the surface of the object and I wanted to try some things out to make the ghost ships look unusual.

I really don’t know what I’m doing here. But I love having lots of levers available to tweak and play with. So I’m not asking any modder to understand what all these options mean. Instead do what I did, make a bunch of new materials with all sorts of values then load up the game and check them out. I’ve created new color schemes and materials, and I will add them to the base game to make it easy for non-modders to play with. But modders can go wild.

For this new material I bumped the Reflectivity to a crazy 10.2. That’s going to make my ship look like it is made from mirrors. It’s hard to appreciate in a still picture, but it looks pretty cool in motion.

 

So I have some cool looking ships and a fun faction to play as. I’m going to go play some Galactic Civilizations III.


Comments (Page 5)
12 PagesFirst 3 4 5 6 7  Last
on Apr 25, 2015

Blocked for me too scara_munga. Getting to it is hard too since you get spammed with adds and buttons you don't want. Might be a good storage site, but sharing???

Anyway, its not your fault or anything. Just saying.

on Apr 25, 2015

scara_monga

Quoting Nastytang,

virus scanner block the page for me scara_monga



 

Dunno how buddy?

It's 'hugefiles', pretty decent storage site

 

"Decent", aside from insane amounts of pop-ups, and quite a few ads.

There are a lot of better file sharing sites out there: Mediafire, Dropbox, DepositFiles, Mega, just to name a few.

 

 

After wading through ads as if the site was made of custard*, I managed to download it.

You should probably have made a new StarSystem instead of changing DeadSystem - otherwise you ruin compatabiliy with other mods. PlanetDefs doesn't need to replace the whole file either

 

*And not just any custard. The real thick kind your gran makes that you need to slice with a carving knife.

on Apr 25, 2015

I have a quick question for the developers:

In regards to culture traits and racial abilities, I see there are a decent number of actions that can be triggered, like:

        <Action>DiscoverNearbyPlanetOfClass</Action>

        <Action>AwardShipOfClass</Action>

        <Action>TerraformTilesOnPlayerPlanets</Action>

etc

I was curious if there is an action that will allow me to award an improvement on the homeworld (or any world, doesn't matter, this is for a minor faction). Something like:

        <Action>AwardImprovementOfType</Action>

       <StringParam>PlanetaryDefenseSystem</StringParam>

I'm guessing something like this doesn't exist, but I thought I'd ask.

Alternatively, would it be possible to see a full list of all possible actions?

Thanks in advance.

on Apr 25, 2015

Niedzielan


After wading through ads as if the site was made of custard*, I managed to download it.

*And not just any custard. The real thick kind your gran makes that you need to slice with a carving knife.

Well, not to be funny, but this is 2015, and I don't have any pop-ups or ads from that site? Must be the way your browser is configured?, or not

 

Niedzielan

You should probably have made a new StarSystem instead of changing DeadSystem - otherwise you ruin compatabiliy with other mods. PlanetDefs doesn't need to replace the whole file either

Criticism noted.  I ain't an expert at this lol, was my first effort, and mostly for fun, I'm just learning, but I thank you for your valuable input, it is much appreciated

BTW, I wasn't sure, as regards links, what the best to post was, so I apologise for that.  Never intended to make things difficult whatsoever.  

Here is Dropbox link regardless, in case anyone else wants to have a laugh.

https://www.dropbox.com/s/26xcf76mtguzaxo/Kerbal.rar?dl=0

Thx all!

on Apr 26, 2015

Psiyon

I was curious if there is an action that will allow me to award an improvement on the homeworld (or any world, doesn't matter, this is for a minor faction). Something like:

        <Action>AwardImprovementOfType</Action>

       <StringParam>PlanetaryDefenseSystem</StringParam>

I'm guessing something like this doesn't exist, but I thought I'd ask.

Alternatively, would it be possible to see a full list of all possible actions?

Thanks in advance.

I'm not at home at the moment, so I cant check which one, but the possible actions are defined in the schemas. Finding where something is defined in the schemas can be quite difficult (there is very little logic to them as far as I can tell). Start off with finding the schema for the xml file you are editing. If it's not defined there, check out the schemas "included" in that schema, the one's "included" in those schemas, and so-on.

on Apr 26, 2015

bkeniry

I'm not at home at the moment, so I cant check which one, but the possible actions are defined in the schemas. Finding where something is defined in the schemas can be quite difficult (there is very little logic to them as far as I can tell). Start off with finding the schema for the xml file you are editing. If it's not defined there, check out the schemas "included" in that schema, the one's "included" in those schemas, and so-on.

Found it, it was in ModifierEffectTypes.xsd. Looks like there is actually an action that awards a free improvement. Awesome stuff, thanks for the help!

on Apr 28, 2015

Sorry for the double post. I thought I'd found the right action, but it turns out the "AwardFreeImprovement" action is just the one from the colonizers ability that grants you a free rushed improvement.

So, action types aside, would anyone know of a way to somehow spawn a new improvement on a planet as a result of a trigger? I've been looking through all the actions and trigger types for the past hour and a half or so, but I haven't had any luck in stringing something together that would get it to do what I want. I'd appreciate any insight, even if it's just "Nope; impossible"

on Apr 28, 2015

Can someone please test this modified version of my mod. Has its own starsystem now, and all seems OK, except I'm getting TWO 'stars' in the system???  Also, is there any way to change colour of planet types?  Like, I want Jool to be green etc.

Many thx for any help guys

https://www.dropbox.com/s/26xcf76mtguzaxo/Kerbal.rar?dl=0

on Apr 28, 2015

scara_monga

Can someone please test this modified version of my mod. Has its own starsystem now, and all seems OK, except I'm getting TWO 'stars' in the system???  Also, is there any way to change colour of planet types?  Like, I want Jool to be green etc.

There are two stars because you've made it a BinaryStar system (Bi- meaning two). Change it to UnaryStar if you only want a single star.

To change the colour of a planet in the build screen, you can edit PlanetArtDefs. There are four sets of RGB-A tags that you can adjust however you want.

To change the colour of a planet in the main map, change BaseLayerGradientFile to point to a different gradient file (which are found in \Steam\SteamApps\common\Galactic Civilizations III\Gfx\planets ). For example, your Jool is Planet_Base_Mars_Gradient_01. If you change it to Planet_Base_Green_Gradient_02, it will look very green. You can, of course, make your own gradiant and use that. You can also change the BaseLayerTextureFile to adjust the texture of the planet.

on Apr 28, 2015

I know there's been a lot of confusion regarding the mod directory structure, so I tried to simplify it to this:  directories are only needed if there is a modified file present. 

For example, in my Zathras mod I modifed the 'FactionDefs.xml' file, renaming it 'FactionDefs_Zathras.xml' and putting it in a 'Game' folder I created in the Zathras mod folder.  Here's a screenshot:

 Mod directory

 

Notice there are only two directories present: 'Game' and 'Gfx'(with it subdirectories).  That is because they are the only directories with modified files.

 

The structure confused me initially, too.  I put 'Core', 'Text', and the others in there, even though they were empty.  Hope this helps, and happy modding!

on Apr 28, 2015

Nimrod13

i modified the factionshipstylesetdefs, shipdefs, shipclassdefs and the factiondefs XML for my race. i put the filename of my models to the ships startingcolony, startingsurvey, constructor, colony and survey.

now the problem. when i start a game with my new race, game crashes. it must be something with the ships, but i dont know how to fix it.

maybe someone could help. did i missed something or is there anything else i have to do before the game accepts my models? why is my surveyship not being shown when i select my shipstyle? do i need to use a special form for the filename?

btw, i created only ship templates, without any modules. could this be the problem?

I've been struggling with this too.

When the game crashes, check out the debug.err file in you MyGames/GalcivIII directory.

When I tried to use ship templates I made in the shidefs/shipclassdefs it threw up an error message (in the debug file) about ship blueprints having to point to "core or modded" ship models.

Going to continue playing around with it tonight so I'll let you know if I figure it out.

on Apr 28, 2015

Damn I feel a fool (again) lol for not noticing that 'star' thing 

 

Thank you Niedzielan!!!

 

Thank you very much

on Apr 30, 2015

How does one change the colour of ships?  I edited the RGB sliders in GC3AppearanceDefs, but that didn't do anything?  Also, lol, I cant seem to figure out the planet positioning correctly, how does that work?

Thanks as ever guys!

on Apr 30, 2015

Hey scara_monga. If by RGB sliders you mean the EngineColor, that doesn't effect the ship's color. I wrote a post on ship colors a while ago, but here is a relevant portion of what I said:


The AppearanceDefs file enables us to create ship color templates--though this seems to be somewhat limited, or I just haven't found the proper xml file to really customize the colors...I played with the values, and discovered a couple useful tidbits.

First, the DiffuseGradientRow1 & DiffuseGradientRow2 elements control color. The colors seem to be mapped from 0-33 with some additional colors in the 240s and 250s. I could not find any rationale or connection between the numeric values and the colors. I would love it if one of the devs or another modder could explain this to me, and if there is a way to create custom colors...

Second, the three LightGradient Rows control light/window color. I believe these are mapped according to the same color scheme as the DiffuseGradient Rows.

Third, SurfaceScale gets bigger the smaller the number--in other words, the texture is finer when the number is bigger.

I hope that helps... maybe someone else has figured out how this works?

on Apr 30, 2015

Also, here is a list of the numbers and the associated colors, though I'm sure the color names aren't exact as I was just approximating. It'll point you in the right direction, at least...

0 - white or very light gray
1 - blue
2 - cyan
3 - another blue
4 - gray
5 - brown
6 - yellow
7 - red
8 - light gray
9 - purple
10 - very light blue (I think)
11 - orange
12 - very light cyan (I think)
13 - light purple
14 - another light gray
15 - black
16 - dark gray
17 - light brown
18 - reddish gray
19 - bright red
20 - goldish
21 - bluish gray
22 - goldish yellow
23 - another goldish yellow
24 - another light gray
25 - light yellow or gold
26 - cyan (I think)
27 - gray (I think)
28 - purplish gray
39 - dark purple
30 - mint-ish green
31 - purple
32 - white
33 - black

Maybe someone has a better/more accurate (or official) list... This was produced with trial and error, so if anyone has anything better, or knows how to make a truly custom color, that would be great!

12 PagesFirst 3 4 5 6 7  Last