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

@Arikah

Which is kinda strange buddy, as the stock images are all 860x540 32bit, averaging 300-450kb in size?

Will have another play with it tonight and see if I get anywhere, lol.

Thx again for your tests

 

*Edit*

Nope. Nothing works for me. I can't get ANY image to show, no matter what size, shape, colour or content.

I notice you have your directory structure different? Any reason for that?

on May 14, 2015

@trumpeter87

You wouldn't believe what the issue was. The tech itself is and was fine all along (other than being unable to add a fifth tree); it's the components I put in ShipComponentDefs_Iman.xml that sent the whole thing into a death spiral. For any future readers, you cannot add more than 5 components to any one researchable tech, or your game will crash. I discovered this by accident when I changed the tech internal/generic names and forgot to change the reference in shipcomponentdefs, so the game simply wasn't loading or allowing me to build the custom components because it didn't see the prereq techs. But with these components out of the equation I could see the research tree and play just fine, so lesson learned. If you need to have a tech unlock more than 5 components, you must set the ReasearchCost to 0, so that the game UI will not attempt to display the tech within the tree, thus avoiding crashing.

 

@scara

I modified the image dimensions again, and when using the same dimensions as the default ones in the game, it turns out quite well:

 

I get similar results with all images I try at the dimensions of 960x540. Here is the image I am using, drop it into your Mods\Dalek\Gfx\Factions\LeaderFGs folder and give it a shot. Rename the file Dalek_FG3 and update your factiondefs file to reflect the new filename (Dalek_FG3.png).

on May 14, 2015

Nope, still nothing shows up?

Beginning to think there is something wrong with my installation, but have verified all files, and all OK.

on May 14, 2015

Copy your Dalek folder somewhere else like the desktop, and go to My Games and rename the GalCiv3 folder "GalCiv3.old". Run the game once, it'll nuke your settings, enable mods within settings and quit, then copy the Dalek folder back and see if it does the same thing again.

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!

 

that is what i`m talking about   the splashscreen is the same way now has been for a while!!! even the new one pic  will not show just the one I was using before what ever happen happen and it is not even on the PC any more!! (that pic.)

on May 14, 2015

[quote who="Ronnar!! +1" reply="124" id="3549406"]
Copy your Dalek folder somewhere else like the desktop, and go to My Games and rename the GalCiv3 folder "GalCiv3.old". Run the game once, it'll nuke your settings, enable mods within settings and quit, then copy the Dalek folder back and see if it does the same thing again.
[/quote]

Yup, did all that, guess what? still don't work, lol????

on May 14, 2015

econundrum1

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.

 

 

yeah I did all that thanks!! BTW copy and paste copy and paste!! when I am naming Pics Planets tech ships Icon LOL that one got me a few times in testing!!

I name them then copying name and paste where relevant. And Yes I`ve been blurry eyed not seeing the typo or > missing come back later and BINGO!! LOL

all in FUN tho all in FUN!! 

on May 14, 2015

Psiyon


Quoting 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!

 

I do not see this xsd anywhere, nor can I find any xsd that refers to what is exposed for actions to create new racial abilities say in abilitydefs.xml

on May 14, 2015

scara_monga


Yup, did all that, guess what? still don't work, lol????

Reduced 29%
Original 1920 x 1200


Look closely at the picture, underneath the weakness textbox - I can see the dude's chin, so the original picture (large 1080, with him on the left) is still active. When I change the reference to the leaderFG picture in FactionDefs_Dalek (ie use a different filename), the results are immediate for me, my game isn't caching anything. I've even started a new game under 1.0 with as many custom races as I could find (so like 6 of them...) and when I encounter/trade with them, the picture that I posted shows up, though it's a little strange because they are off center.

Dunno what to say? You're sure you haven't put any file named Dalek_FG.png in the game's root/gfx folder, or don't have copies of it floating around in places that the game normally looks (ie other mod folders)?

on May 14, 2015

Ok, got it sussed.

The image in \GalCiv3\Mods\ModName\Gfx\Factions\LeaderFGs\whatever.FG.png shows up on the faction select screen, AND when the game loads on start screen, and its the same for your mod also, I just tested, it gets used twice.

The image in \GalCiv3\Mods\ModName\Gfx\Leaders\StartGameWhatever.png does nothing whatsoever, as in, it does not show at all, which is why, when you remove the defining line in FactionDefs that points to it, it makes no difference, as the actual image that is loading, is the one in \GalCiv3\Mods\ModName\Gfx\Factions\LeaderFGs.

Sure enough, when I put the Davros image in the \LeaderFGs\ directory, then it shows in game, but in two locations as stated above.

Which begs the questions?

What does <StartupImage>StartGameImage.png</StartupImage> do?

Can't one have a differing image in both those locations?

 

on May 14, 2015

Oh, haha I thought you knew about that already. Yeah the Leader_FG.png is by far the most important graphic asset (okay maybe logo is tied), it is what you see when talking to leaders in trades/talks, at the UP, on the game loading, and at the new game setup menu. As far as I can tell the startup image does nothing, I have one in my mod too and I've never seen it - at first I thought it might appear when loading up a saved game, but nope. Leader_BG appears in your tech tree as the background, as well as in the UP.

on May 15, 2015

I'm trying to make a little mod that allows all the specializations to be researched like in beta ... 4 .. I think .. because overpowered ships ftw

I found the tech xml's and I can see what links the specializations together, I just can't find how the game prevents the others to be developed.

Is this something build in to the engine and do I just have to ungroup the specializations or is it some option I am overlooking ?

on May 15, 2015

Consequator

I'm trying to make a little mod that allows all the specializations to be researched like in beta ... 4 .. I think .. because overpowered ships ftw

I found the tech xml's and I can see what links the specializations together, I just can't find how the game prevents the others to be developed.

Is this something build in to the engine and do I just have to ungroup the specializations or is it some option I am overlooking ?

 

You can't quite just take off the <Specialization> tag, because it kinda breaks everything. What happens is that it does remove the specializations, but the tech tree continues on each of those specializations. This makes thousands of branches in the Tech Tree, which is too much for the game to handle.

 

What I've done is to leave the specializations as-is, but create duplicates that unlock after choosing a specialization. It's messy, especially when trading, but it works.

You can check out how I've done it: https://forums.galciv3.com/463831/page/1

 

on May 15, 2015

lol!

Well after some graphic jiggery, I got what I wanted

I didn't want the same image showing in both, so I used a transparent cut & join layer method. This way, the image is separated into 2 layers. Both layers are seen on faction select screen (Davros & Daleks) as one image, whilst on start screen, only one layer is shown (the Dalek).  I then swapped the images defined in FactionDefs to make sure that the correct order is loaded.

Result is pretty good

We get there in the end, lol!!

on May 15, 2015

Nastytang

ok I  played with this race here a few pics

 

Reduced 44%
Original 1280 x 720



 

Here it teal you wanted it is in the ColorDefAlts.xml file  it is called  AltTeal.

Reduced 44%
Original 1280 x 720



 and here the screen just before you go to your Planet! with what you gave us this is what i did.

Reduced 44%
Original 1280 x 720



 

 

Sorry On the ship I had no luck with It. I wonder if it is restricted because of tech or hull size or if there another file we have yet to learn about.

 

I had to rebuilded the factiondefs.xml file to get this to work.

 

Download Link Please?

 

Download Link Please?

12 PagesFirst 7 8 9 10 11  Last