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 8)
12 PagesFirst 6 7 8 9 10  Last
on May 13, 2015

scara_monga, your mod doesn't work for me either. 

Having a quick look as to why, it may be that some things are still needed. Maybe a FactionAssets.xml and a Portraits folder with a Portrait image. 

I haven't the time to go through and get it working, but I will share a faction that I have made that works so you can compare things. Its still a bit rough around the edges (or a lot IDK) and the images and story text are just place holders at the moment for when I get the artwork finished.

Anyway hopefully it can help you out. 

My mod

on May 13, 2015

scara_monga: the image you are using is too large. Yeah it shouldn't matter but for some reason it does. In my mod the leader_fg image is a 1024x600px png @ 350kb filesize. It seemed like yours was too big for the game to load? So when I smushed it down to roughly the same size as mine it works (and produces similar results, the left side of the image is obscured/clipped by the text box). So compress, smush, and flip your image horizontally.

 

I am having a hell of a time getting custom tech tree branches to work. When I create them, I nest them correctly under TechTree:

<Prerequ>
<Techs>
<Option>TechTree</Option>
</Techs>
<TechAge>
<Option>AgeOfExpansion</Option>
</TechAge>
</Prerequ>

however they never show up. I figured well alright, I can just go off an existing branch, say Colonization... but doing that causes the game to crash since 97.7. What's worse is that I eventually figured out that in .97.7 having said custom techs at anything other than <ResearchCost>0</ResearchCost> causes the game to crash upon entering the tech tree screen, it doesn't matter what node they are attached to. 

So right now I have my custom techs "active" from the start of the game, without having to research anything, because I can't actually see any of them to begin with. I actually had them nested under the Colonization branch just fine in .95, but something changed and they didn't/don't work that way any more.

on May 14, 2015

scara first off Let me say you know your way around the files and your mod is solid. your mod is a nice complete mod of UI colors map colors and the ships too.

I did not get the sartup pic to work.

the startup pic and the diiplomacy report pic used the same pic.

 

I`ll play a little more with it but i`m running out of ideals I even used a all red png and still got just a black pic.

 

My Race pics I compromise  because it work out ok. I`ll post my latest pics,

scara it is nothing you are doing. I think after so many attempts the game just refuses to update the pics.

 

We need  a way to clean out the game cache with having to run CCleaner and integrity scan!

everything else seem to be working. good job on your race setup!! 

on May 14, 2015

Arikah

scara_monga: the image you are using is too large. Yeah it shouldn't matter but for some reason it does. In my mod the leader_fg image is a 1024x600px png @ 350kb filesize. It seemed like yours was too big for the game to load? So when I smushed it down to roughly the same size as mine it works (and produces similar results, the left side of the image is obscured/clipped by the text box). So compress, smush, and flip your image horizontally.

 

I am having a hell of a time getting custom tech tree branches to work. When I create them, I nest them correctly under TechTree:

<Prerequ>
<Techs>
<Option>TechTree</Option>
</Techs>
<TechAge>
<Option>AgeOfExpansion</Option>
</TechAge>
</Prerequ>

however they never show up. I figured well alright, I can just go off an existing branch, say Colonization... but doing that causes the game to crash since 97.7. What's worse is that I eventually figured out that in .97.7 having said custom techs at anything other than <ResearchCost>0</ResearchCost> causes the game to crash upon entering the tech tree screen, it doesn't matter what node they are attached to. 

So right now I have my custom techs "active" from the start of the game, without having to research anything, because I can't actually see any of them to begin with. I actually had them nested under the Colonization branch just fine in .95, but something changed and they didn't/don't work that way any more.

 

I've been working on a TechTree with no such problems. I change one tech (or two) at a time, modifying the tech, any improvements, starbase modules, or projects as needed along with all corresponding text.

I'm not sure what exactly you are trying to accomplish with your tech tree mod; for me, I'm not just changing the flavor, nor the order of the techs, but several of the techs are being completely reworked to provide different improvements altogether (which I have had to create).

Problems I've run in to:

1) changing the generic name without changing the subsequent tech's prerequ. For example, when I change a tech in order to provide a different improvement, I add the race name to the beginning of the tech's generic name. If this isn't done to the prerequ of the next tech in the tree, the rest of that branch will not display.

2) changing the internal names and tech specializations without adding the techspecializationdefs file causes problems, I think.

The process I've used (successful, so far):

1) copy a tech tree and rename all the internal names, but nothing else.

2) change the tech tree name and link to it in the factiondefs file.

3) test it out.

4) make a small change (for example, change the generic name of the colonization tech branch and then the prerequ of the industrialization and planetary improvement techs).

5) test it out.

6) repeat 4 and 5.

I'd offer more details, but I'm not sure exactly what issue you are running into... What are you trying to change?

One last suggestion, and I know this may be a pain in the butt, but have you tried starting over with a newly copied tech tree (i.e., save a base tech tree as a new file then work through your mod, transferring one tech over at a time into the new file)?

Hope this helps some! I'm super excited to see everything people are making, and I look forward to finishing my mod to share with you all!

on May 14, 2015

Yup, that is exactly what I did - copied the Terran tech tree and it's corresponding specialization, ctrl+f <InternalName>Terran and replace it with <InternalName>Iman . What I'm really confused about is that when .97.7 rolled out I thought they might have changed internal structure of the file, so I deleted the techdefs file and did a fresh copy again from the terrans, like you suggested. It was working just fine in .95 so I'm stumped. Here is the custom, brand new tech entry causing problems, and I can't see a reason for it. Note that the root node of my tech tree still has the GenericName "TechTree". With the requirement being solely TechTree this should create a brand new node/branch, but I can't verify if this is happening or not because opening the research button causes CTD with this entry as it is. Like I said before, the only way I've been able to dodge the CTD is by making the researchcost 0. I can verify that the tech is actually in the game and active because of the bonus that it provides, as well as being able to build a couple custom components that require the tech.

 

<Tech>
<InternalName>ImanHeavyMilitaryTech</InternalName>
<GenericName>ICFHeavyMilitary</GenericName>
<DisplayName>Super Weapons Research</DisplayName>
<TechTree>Iman_Tree</TechTree>
<ShortDescription>Allows super-weapons to be built and equipped on ships.</ShortDescription>
<Description>Allows super-weapons to be built and equipped on ships. Very powerful, should only be used as a deterrant. Takes a while to research. </Description>
<ColorDef>TechRed</ColorDef>
<Icon>GC3_Weapons_Tech_Icon.png</Icon>
<Bink>GC3_lndustrail_Temp.bk2</Bink>
<ResearchCost>4000</ResearchCost>
<AICategoryWeight>
<Military>12</Military>
<Growth>20</Growth>
<Tech>18</Tech>
<Diplomacy>6</Diplomacy>
<Expansion>16</Expansion>
<Wealth>8</Wealth>
<Influence>10</Influence>
<Fortification>14</Fortification>
</AICategoryWeight>
<Stats>
<EffectType>Military</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.10</Value>
</Stats>
<Prerequ>
<Techs>
<Option>TechTree</Option>
</Techs>
</Prerequ>
</Tech>

 

I do wonder if the game is keeping a cache somewhere and loading (old) stuff in, like nasty above thinks is happening with the pictures.

on May 14, 2015

Why not try adding this as a tech within the military branch? So instead of making a fifth branch, this would make an additional branch within the military branch... Then to get the bonus +10% to military, add the stat bonus to the base military tech. This should have the same effect and may fix the problem.

UPDATE: for grins I copied the colonization branch and first tech and gave them new internal and generic names. This didn't cause a crash, but it didn't add a fifth branch, either. What happened was the new branch bumped the last branch, the CommunicationsTech branch, into oblivion. So it seems that the game forces only four main tech branches... or adding a fifth branch requires additional modding that I'm not aware of.

on May 14, 2015

Nastytang

scara first off Let me say you know your way around the files and your mod is solid. your mod is a nice complete mod of UI colors map colors and the ships too.

I did not get the sartup pic to work.

the startup pic and the diiplomacy report pic used the same pic.

 

I`ll play a little more with it but i`m running out of ideals I even used a all red png and still got just a black pic.

 

My Race pics I compromise  because it work out ok. I`ll post my latest pics,

scara it is nothing you are doing. I think after so many attempts the game just refuses to update the pics.

 

We need  a way to clean out the game cache with having to run CCleaner and integrity scan!

everything else seem to be working. good job on your race setup!! 

Yeh! its a bit of a mystery. I have experimented with the Image changing bit depth and removing transparency. I really don't think its likely the image . I tried copying the Drengin Startup Image there and renamed it to the same as the Dalek startup image. I don't think its likely cache's save somewhere either, since its can't be in our machines from before we first installed the Mod.

I have also tried putting in a FactionAssets.xml that I suggested earlier, but alas, that's not it either.

 I agree with Nasty about your mod, nice work! I look forward to playing it. There's got to be something there we're all missing.

on May 14, 2015

I was going to say could be the images, I assume you've checked the dimensions and file type all of that already, sounds like you have.

 

Check there isn't some slight typo either in the reference to the image in you XML files or in the actual file-name, then get someone else to check it to. After years of programming I can tell you I've sometimes spent ages looking at code until my head aches looking for the cause of odd behavior only to find in the end it's down to a typo in the name of a variable that I have looked at 100 times and just not spotted.

 

on May 14, 2015

Thanks for looking into it guys, and the kind words

Yeah, its got me stumped has that one?, lol.

It could well be cache related though, as I ran a little test with another of my mods, in which the start up image works just fine. I removed the reference to its start up image in FactionDefs, and deleted the image also from within its folder, guess what?, the game still shows that very image, despite the fact it has been removed altogether??  Even more strange, is the fact that, referencing any other image, whether stock, or from a new image, still shows the original image in game, as in, the one I removed?

I'll keep on it.

Ah the fun of modding, lol

Thx again guys!

on May 14, 2015

Well, I have made a bit of a discovery. There has been an image loading in there, but its the LeaderFG not the StartupImage. I'm thinking now that the StartUpImage may be for the game loading screen before you get to the choosing faction part or something else. The reason it appeared nothing was showing is because the LeaderFG (Davros) has the coverage to the far left of the canvas, and the start off screen, where almost nothing was showing, only picks up the centre portion of the image where in this case it is transparent.

Scara_monga, you may need to shift Davros closer to the centre of the LeaderFG image.

Edit; there may be another way using a "StartUpPopupWnd.xml" in the Screens folder, to re-arrange the Start game screen, but I'm not sure how yet.

So is a StartGameImage even necessary? Either not at all and this is now redundant, or its not working as intended. This may also be true of the "InsertFactionName"_Image.png, that's in with the StartGameImage in the Leaders folder. Maybe the whole "Leaders" folder is not needed IDK. ... bit confused now.

on May 14, 2015

In_stasis

Well, I have made a bit of a discovery. There has been an image loading in there, but its the LeaderFG not the StartupImage. I'm thinking now that the StartUpImage may be for the game loading screen before you get to the choosing faction part or something else. The reason it appeared nothing was showing is because the LeaderFG (Davros) has the coverage to the far left of the canvas, and the start off screen, where almost nothing was showing, only picks up the centre portion of the image where in this case it is transparent. Scara_monga, you may need to shift Davros closer to the centre of the LeaderFG image.

So is a StartGameImage even necessary? Either not at all and this is now redundant, or its not working as intended. This may also be true of the "InsertFactionName"_Image.png, that's in with the StartGameImage in the Leaders folder. Maybe the whole "Leaders" folder is not needed IDK. ... bit confused now.

For my faction, I only include the LeaderBG, LeaderFG, Logos, Portraits files in the Gfx/Factions subdirectory. I think the game auto-generates some of these images. I didn't create an image for the game start screen, for example, but my LeaderFG image is used. Also, I don't include the FactionAssets xml file in the Core directory, and all my images/tech movie load fine. Not sure if I'm supposed to have those files, but I've also never had any issues with the images displaying properly...

on May 14, 2015

trumpeter87


Quoting In_stasis,

Well, I have made a bit of a discovery. There has been an image loading in there, but its the LeaderFG not the StartupImage. I'm thinking now that the StartUpImage may be for the game loading screen before you get to the choosing faction part or something else. The reason it appeared nothing was showing is because the LeaderFG (Davros) has the coverage to the far left of the canvas, and the start off screen, where almost nothing was showing, only picks up the centre portion of the image where in this case it is transparent. Scara_monga, you may need to shift Davros closer to the centre of the LeaderFG image.

So is a StartGameImage even necessary? Either not at all and this is now redundant, or its not working as intended. This may also be true of the "InsertFactionName"_Image.png, that's in with the StartGameImage in the Leaders folder. Maybe the whole "Leaders" folder is not needed IDK. ... bit confused now.



For my faction, I only include the LeaderBG, LeaderFG, Logos, Portraits files in the Gfx/Factions subdirectory. I think the game auto-generates some of these images. I didn't create an image for the game start screen, for example, but my LeaderFG image is used. Also, I don't include the FactionAssets xml file in the Core directory, and all my images/tech movie load fine. Not sure if I'm supposed to have those files, but I've also never had any issues with the images displaying properly...

Yeh! I don't think the FactionAssets file is needed at all now either. Could be, that there is things in there that are not used any more, or just not available to be modded. I was kind of thinking if its xml. then it can be modded, but I don't know any more. I wish I new more about codey stuff.

on May 14, 2015

scara_monga

Thanks for looking into it guys, and the kind words

Yeah, its got me stumped has that one?, lol.

It could well be cache related though, as I ran a little test with another of my mods, in which the start up image works just fine. I removed the reference to its start up image in FactionDefs, and deleted the image also from within its folder, guess what?, the game still shows that very image, despite the fact it has been removed altogether??  Even more strange, is the fact that, referencing any other image, whether stock, or from a new image, still shows the original image in game, as in, the one I removed?

I'll keep on it.

Ah the fun of modding, lol

Thx again guys!

They're not cached. Copies are made to the MyGames/GalCivIII/Factions folder, where custom faction files are save when you use the in - game faction creation option. You can delete them from there also to remove them completely. That got me confused too when I was changing images and logos on the same mod.

Fun indeed!!

on May 14, 2015

The game has an issue if you have two images with the same name I believe even if they are in different folders like a leader image and a startup image, that may be it.

on May 14, 2015

trumpeter87

UPDATE: for grins I copied the colonization branch and first tech and gave them new internal and generic names. This didn't cause a crash, but it didn't add a fifth branch, either. What happened was the new branch bumped the last branch, the CommunicationsTech branch, into oblivion. So it seems that the game forces only four main tech branches... or adding a fifth branch requires additional modding that I'm not aware of.

Interesting that you don't CTD, but that's really good info confirming that it doesn't seem possible to add a fifth tech branch with standard methods. I will try and move it into the military branch and see if that fixes the issues.

@scara, I really do believe it is an issue with the picture being too big in both dimension and size, combined with the other strange cache issues, as well as the duplicate name problem. Here is what I saw when I shrunk your Dalek_FG.png down and flipped the image horizontally - I dunno how big/small it is supposed to be because it still doesn't display right compared to my mod.

 

For a test I copied in a png that I plan to use for a new mod and updated your factiondefs accordingly, and while it is also under 1mb in size it is 3250x1944, bit depth 32. It does display, but it's clearly too big dimension wise because the game is clipping everything but the left eye (supposed to have the entire face):

12 PagesFirst 6 7 8 9 10  Last