CodeCritter's Blog
Customize the look of the ships created by a Civilization
Published on October 20, 2006 By CodeCritter In GalCiv Journals
Intro
Hello. I've been been on the GalCiv2 team for over a year, but this is my first developer journal. I'd like to share with you one of the exciting new features of Dark Avatar that I've been working on. It's still a work in progress, so some of the screens and information may change from now to the release date.

As you may have heard, in Dark Avatar, you'll be able to customize the opponents you choose to play against. So if you want to play against the Triangle Union, Square Empire, and the Circle Republic, you can.

But wouldn't it be cool if you could make the Triangle Union use triangle shaped ship designs, Square Union use square ship designs, and the Circle Repulic use circle designs?
We thought so too, so, in Dark Avatar, you will have the ability to create "Custom Ship Styles."

A custom ship style consists of two parts. One part describes the ships that the civ makes when the human player plays as that civ. The other part describes the ships that the civ makes when the AI plays as that civ.

The Old Way
In the original GalCiv2, each civ had a "ShipStyle" number associated with it. For example, Terrans had a ship style 0. This corresponds to the S0_ prefix in Terran ship designs. When the human player played as that civ, the ship designs were prefixed with "S0_" and any core ships that had that prefix could be used by the Terrans. Any new designs created in the Ship Designer were also prefixed with "S0_."

When the AI played as the Terrans, it would use hard-coded ship templates, and prefix them with the ship style. For example, AI defender ships would use the S0_Defender1.shipcfg file, as a base template, and then add parts to it.

The New Way
In Dark Avatar, that will all change to a more flexible system. Each race will have a Ship Style associated with it, but these will not be a number. These will be actual ship style xml files in a subfolder of the data folder. You will be able to create your own styles in the game and save them. If you want to share them, you only need to send the ship style xml file to your friend and they can just put the file in the correct data folder.

Each style has a prefix included in it. For the default races, these are set to "S0", "S1", and so on, but there is no reason to keep to that convention. If you wanted you could make your style's prefix "Circle" and then the game would use ship designs that had that prefix, like Circle_Constructor.shipcfg. When you create new designs in the game, they will also get the prefix "Circle." This applies to the ship designs that both the human player uses and the AI. Each style also has a list of ship templates that the AI will use when using that style. It no longer uses hardcoded template names like "Defender1" and "Attacker1."

Using New Ship Styles
Any ship styles in the ship styles data folder will appear in the list of styles on the Race setup screen. You can then choose the style you want to use for your own race (or an opponent) from that list of ship styles.

Creating New Ship Styles
There is a button marked "Custom" which opens the Custom Ship Style screen. This screen allows you to choose which ship template designs you want the AI to use for its designs. The AI will use the designs you choose here and then add parts to them, like weapons, engines, etc. The list on the left is the list of ships that the AI will use, while the list on the right is a list of available templates. The template list shows all avaliable templates including ones you create yourself.

If you want the AI to use the design "Sky Fox" for its attacker ships, you would select "Attacker ship 1" from the list on the left, and then "Sky Fox" from the list on the right. Click the "Change" button and the AI will now use the "Sky Fox" design instead of the default "Attacker Template 1" design. There is a "Reset All" and "Default" button to return the designs to their default states.

There is also a button to save the style so you can use it in another game. If you don't save it, it will only be good for your current game.

Modding Possibilities
The new ship styles allow for new modding possibilities:
For example, let's say you created a bunch of ships for the Circle Republic, and want to upload them to the library. Your friend then downloads them onto his machine. In the old galciv2, the designs would have a set prefix like S0. Let's say he then downloads more Circle Republic ships from the library that were made by someone else. These might have a different prefix than the ones you designed. In Dark Avatar, your friend can rename all the ships to Circle_(ship_name_here).shipcfg and then modify the prefix in the Circle Ship Style.xml file to be Circle. Your friend can then use all of the Circle Ships he has downloaded when he chooses the Circle Ship Style in the race setup screen.

Conclusion
In the end, it's pretty neat to see the AI using the ship designs I've created. It adds some more customizability and variety to the game. Be sure to check out the screenshots below:

Thanks for reading. Stay tuned...

Screen Shot 1
This is the Appearances tab of the Race Setup screen. It lists all of the styles that I have in my data folder.
Free Image Hosting at www.ImageShack.us

Screen Shot 2
This is the Custom Ship Styles screen. It is used to tell the AI what ship templates to use for its ship designs.
Free Image Hosting at www.ImageShack.us

Comments (Page 2)
2 Pages1 2 
on Oct 23, 2006
Could you add the name of the Ship Style to somewhere on the Customize Ship Style screen? That way if you load one or want to save it, you know the name of the style you're modifying/creating.

I also agree with Oldstatesman- having a separate either menu and/or function in the game just to modify/create ships and possibly their section of a Ship Style would be very handy.
on Oct 23, 2006

Could you add the name of the Ship Style to somewhere on the Customize Ship Style screen? That way if you load one or want to save it, you know the name of the style you're modifying/creating.


That's a good suggestion, and we'll be adding the style name somewhere on the screen.
on Oct 25, 2006
This stuff looks excelent! Modders are going to dance lambada and probably the players too

I see many DA things discussed in the journals section. Might I suggest you do one about the Dark Avatar UI changes/improvements. I and probably others have nags about some UI stuff in GC2, but I dont want to hijack this thread.
2 Pages1 2