News

[Guide] How to create a custom Star System for custom Factions.

Posted on Monday, June 20, 2016

This is a modding guide for those who wish to create thier own Starter Systems for thier custom factions. I will try to explain the Replace method and the Append method.

I am going to assume you know how to edit and create XML documents.

 


Replace Method

First and for most make copys of the StarDefs.xml, StarSystemsDefs.xml, PlanetDefs.xml & PlanetArtDefs.xml and place them in the ExampleMod/Game folder(Or create you own Mod folder) located in ...Documents/My Games/GalCiv3/Mods. You will then add the below code to the top of each file.


Step One: Creating the Star

Open StarDefs.xml and locate this line: <!--Fixted Sytem Stars--> . We are going to start our code underneath this:-

    <Star>
        <InternalName>FedStar</InternalName>
        <DisplayName>Sol</DisplayName>
        <ObjectType>Star</ObjectType>
        <Type>YellowStar</Type>
        <ArtDefine>SunArt</ArtDefine>
        <SFXDefine>STAR_AMBIENT</SFXDefine>
    </Star>

Save the File.


Step Two: Creating the Planets

Open PlanetDefs.xml and locate this line: xsi:noNamespaceSchemaLocation="../Schema/PlanetDefs.xsd"> . We are going to start our code underneth this:-

    <Planet>
        <InternalName>PlanetMercuryFED</InternalName>
        <DisplayName>Mercury</DisplayName>
        <PlanetType>Dead</PlanetType>        
        <PlanetClass>0</PlanetClass>        
        <ArtDefine>MercuryArt</ArtDefine>
    </Planet>

    <Planet>
        <InternalName>PlanetEarthFED</InternalName>
        <DisplayName>Earth</DisplayName>
        <PlanetType>Habitable</PlanetType>
        <PlanetClass>16</PlanetClass>        
        <ArtDefine>EarthArt</ArtDefine>
    </Planet>
    
    <Planet>
        <InternalName>PlanetVenusFED</InternalName>
        <DisplayName>Venus</DisplayName>
        <PlanetType>Habitable</PlanetType>
        <PlanetClass>12</PlanetClass>
        <ArtDefine>VenusArt</ArtDefine>
    </Planet>

    <Planet>
        <InternalName>PlanetMarsFED</InternalName>
        <DisplayName>Mars</DisplayName>
        <PlanetType>Habitable</PlanetType>
        <PlanetClass>7</PlanetClass>
        <ArtDefine>MarsArt</ArtDefine>
    </Planet>
    
    <Planet>
        <InternalName>PlanetJupiterFED</InternalName>
        <DisplayName>Jupiter</DisplayName>
        <PlanetType>GasGiant</PlanetType>
        <PlanetClass>0</PlanetClass>
        <ArtDefine>JupiterArt</ArtDefine>
    </Planet>

Save the File.


Step Three: Creating the Planet Art Defines

Open PlanetArtDefs.xml and locate this line: <!-- PlanetArtDefs.xml --> . We are going to start our code underneth this:-

  <ArtDefine>
    <InternalName>VenusArt</InternalName>
    <Radius>18</Radius>
    <RotationSpeed>-0.06</RotationSpeed>
    <ModelFile>gfx/planets/planet_globe_with_seams.sdf</ModelFile>
    <AxisTilt>0.5</AxisTilt>
    <AtmosphereTextureFile>Planet_Atmosphere_Clouds_Generic_Yellow_L.dds</AtmosphereTextureFile>
    <BaseLayerTextureFile>Planet_Base_Rock_Generic_02_Merged.dds</BaseLayerTextureFile>
    <BaseLayerGradientFile>Planet_Base_Brown_Gradient_01.png</BaseLayerGradientFile>
    <AltLatGradientTextureFile>Planet_Generic_Continent_Gradient_Yellow_01.png</AltLatGradientTextureFile>
    <PolarCapTextureFile>Planet_Cap_Generic_Lava_01.dds</PolarCapTextureFile>
    <BaseLayerDiffuseColor>
      <Red>255</Red>
      <Green>255</Green>
      <Blue>102</Blue>
      <Alpha>255</Alpha>
    </BaseLayerDiffuseColor>
    <EmissiveColor>
      <Red>255</Red>
      <Green>255</Green>
      <Blue>153</Blue>
      <Alpha>255</Alpha>
    </EmissiveColor>
    <PolarCapTintColor>
      <Red>255</Red>
      <Green>204</Green>
      <Blue>204</Blue>
      <Alpha>255</Alpha>
    </PolarCapTintColor>
    <AtmosphereColor>
      <Red>255</Red>
      <Green>255</Green>
      <Blue>102</Blue>
      <Alpha>255</Alpha>
    </AtmosphereColor>
    <PolarCapSize>0.2</PolarCapSize>
    <ContinentSqueezeFactor>0.2</ContinentSqueezeFactor>
    <BaseGloss>0</BaseGloss>
    <BaseSpecularIntensity>0</BaseSpecularIntensity>
    <BaseMetal>0</BaseMetal>
    <TerrainGloss>0</TerrainGloss>
    <TerrainSpecularIntensity>0</TerrainSpecularIntensity>
    <TerrainMetal>0</TerrainMetal>
    <ShadowBuffer>0.1</ShadowBuffer>
    <Ambient>0.05</Ambient>
    <HaloIntensity>0.5</HaloIntensity>
        <HaloEffect>
            <RotationSpeed>5</RotationSpeed>
            <FadeSpeed>4</FadeSpeed>
            <MinIntensity>0.7</MinIntensity>
            <MaxIntensity>1</MaxIntensity>
            <Alternating>false</Alternating>
            <Scale>1.15</Scale>
        </HaloEffect>
        <HaloEffect>
            <RotationSpeed>2</RotationSpeed>
            <FadeSpeed>2</FadeSpeed>
            <MinIntensity>0.2</MinIntensity>
            <MaxIntensity>0.7</MaxIntensity>
            <Alternating>false</Alternating>
            <Scale>1.25</Scale>
        </HaloEffect>
  </ArtDefine>

Save the File.


Step Four: Building the System

Open StarSystemDefs.xml near the top of the file locate this line: <InternalName>FactionStart</InternalName> . We are going to star our code on the line underneath this:-

      <StarSystem>
          <InternalName>FedSystem</InternalName>
          <DisplayName>Sol F</DisplayName>
          <Description>Federation Home System</Description>
          <OrbitLane>
              <LaneType>Star</LaneType> <!-- We place the Star we made here -->
              <Body>
                  <BodyType>UnaryStar</BodyType>
                  <BodyDef>FedStar</BodyDef>
              </Body>
          </OrbitLane>
          <OrbitLane>
              <LaneType>DeadZone</LaneType> <!-- We place the dead planets we made here -->
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetMercuryFED</BodyDef>
              </Body>
          </OrbitLane>
          <OrbitLane>
              <LaneType>HabitableZone</LaneType> <!-- We place the habitable Planets we made here -->
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetEarthFED</BodyDef>
                  <IsHomeworld>true</IsHomeworld>
                  <Position>5</Position>
              </Body>
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetVenusFED</BodyDef>
              </Body>
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetMarsFED</BodyDef>
              </Body>
          </OrbitLane>
          <OrbitLane>
              <LaneType>NoRandom</LaneType> <!-- We place the Gas Giant planets we made here -->
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetJupiterFED</BodyDef>
              </Body>
          </OrbitLane>
      </StarSystem>

Save the File.

Thats it! Boot up the game and see your newly created system!


 


Append Method

You will need to create four new xml documents and name them however you wish, it is however common practice to keep your files similar to how SD do thier's, eg :- MyMod_StarDefs.xml. You will then have to place these in the ExampleMod folder (or create you own) and place the below code in the corresponding files. This Method will only work for factions that you have created via xml.


Step One: Creating the Star

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<StarList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/StarDefs.xsd">
 
  <!--Fixed System Stars-->

    <Star>
        <InternalName>FedStar</InternalName>
        <DisplayName>FedSystem_Name</DisplayName>
        <ObjectType>Star</ObjectType>
        <Type>YellowStar</Type>
        <ArtDefine>SunArt</ArtDefine>
        <SFXDefine>STAR_AMBIENT</SFXDefine>
    </Star>

</StarList>

Always remember that the Internal Name has to be Unique for every Star you create. We will save this as a new xml document: MyMod_StarDefs.xml


Step Two: Creating the Planets

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<PlanetList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/PlanetDefs.xsd">

    <Planet>
        <InternalName>PlanetMercuryFED</InternalName>
        <DisplayName>Mercury</DisplayName>
        <PlanetType>Dead</PlanetType>        
        <PlanetClass>0</PlanetClass>        
        <ArtDefine>MercuryArt</ArtDefine>
    </Planet>

    <Planet>
        <InternalName>PlanetEarthFED</InternalName>
        <DisplayName>Earth</DisplayName>
        <PlanetType>Habitable</PlanetType>
        <PlanetClass>16</PlanetClass>        
        <ArtDefine>EarthArt</ArtDefine>
    </Planet>
    
    <Planet>
        <InternalName>PlanetVenusFED</InternalName>
        <DisplayName>Venus</DisplayName>
        <PlanetType>Habitable</PlanetType>
        <PlanetClass>12</PlanetClass>
        <ArtDefine>VenusArt</ArtDefine>
    </Planet>

    <Planet>
        <InternalName>PlanetMarsFED</InternalName>
        <DisplayName>Mars</DisplayName>
        <PlanetType>Habitable</PlanetType>
        <PlanetClass>7</PlanetClass>
        <ArtDefine>MarsArt</ArtDefine>
    </Planet>
    
    <Planet>
        <InternalName>PlanetJupiterFED</InternalName>
        <DisplayName>Jupiter</DisplayName>
        <PlanetType>GasGiant</PlanetType>
        <PlanetClass>0</PlanetClass>
        <ArtDefine>JupiterArt</ArtDefine>
    </Planet>

</PlanetList>

Remember that the Internal Names for your planets have to be Unique for each Planet you create. We will save this as a new xml document: MyMod_PlanetDefs.xml


Step Three: Creating the Planet Art Defines

The game already has existing art for Mercury, Mars, Earth and Jupiter so we have used the art defines for them in the Planet code above. However Venus has no art dfine so will will have to make one for it. (You can use existing art for any planet or create new art for any planet)

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<PlanetArtList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/PlanetArtDefs.xsd">
<!-- Created with the Gal Civ 3 Editor -->
<!-- PlanetArtDefs.xml -->

  <ArtDefine>
    <InternalName>VenusArt</InternalName>
    <Radius>18</Radius>
    <RotationSpeed>-0.06</RotationSpeed>
    <ModelFile>gfx/planets/planet_globe_with_seams.sdf</ModelFile>
    <AxisTilt>0.5</AxisTilt>
    <AtmosphereTextureFile>Planet_Atmosphere_Clouds_Generic_Yellow_L.dds</AtmosphereTextureFile>
    <BaseLayerTextureFile>Planet_Base_Rock_Generic_02_Merged.dds</BaseLayerTextureFile>
    <BaseLayerGradientFile>Planet_Base_Brown_Gradient_01.png</BaseLayerGradientFile>
    <AltLatGradientTextureFile>Planet_Generic_Continent_Gradient_Yellow_01.png</AltLatGradientTextureFile>
    <PolarCapTextureFile>Planet_Cap_Generic_Lava_01.dds</PolarCapTextureFile>
    <BaseLayerDiffuseColor>
      <Red>255</Red>
      <Green>255</Green>
      <Blue>102</Blue>
      <Alpha>255</Alpha>
    </BaseLayerDiffuseColor>
    <EmissiveColor>
      <Red>255</Red>
      <Green>255</Green>
      <Blue>153</Blue>
      <Alpha>255</Alpha>
    </EmissiveColor>
    <PolarCapTintColor>
      <Red>255</Red>
      <Green>204</Green>
      <Blue>204</Blue>
      <Alpha>255</Alpha>
    </PolarCapTintColor>
    <AtmosphereColor>
      <Red>255</Red>
      <Green>255</Green>
      <Blue>102</Blue>
      <Alpha>255</Alpha>
    </AtmosphereColor>
    <PolarCapSize>0.2</PolarCapSize>
    <ContinentSqueezeFactor>0.2</ContinentSqueezeFactor>
    <BaseGloss>0</BaseGloss>
    <BaseSpecularIntensity>0</BaseSpecularIntensity>
    <BaseMetal>0</BaseMetal>
    <TerrainGloss>0</TerrainGloss>
    <TerrainSpecularIntensity>0</TerrainSpecularIntensity>
    <TerrainMetal>0</TerrainMetal>
    <ShadowBuffer>0.1</ShadowBuffer>
    <Ambient>0.05</Ambient>
    <HaloIntensity>0.5</HaloIntensity>
        <HaloEffect>
            <RotationSpeed>5</RotationSpeed>
            <FadeSpeed>4</FadeSpeed>
            <MinIntensity>0.7</MinIntensity>
            <MaxIntensity>1</MaxIntensity>
            <Alternating>false</Alternating>
            <Scale>1.15</Scale>
        </HaloEffect>
        <HaloEffect>
            <RotationSpeed>2</RotationSpeed>
            <FadeSpeed>2</FadeSpeed>
            <MinIntensity>0.2</MinIntensity>
            <MaxIntensity>0.7</MaxIntensity>
            <Alternating>false</Alternating>
            <Scale>1.25</Scale>
        </HaloEffect>
  </ArtDefine>

</PlanetArtList>

Remember to keep the Internal name unique for each Planet art define you create. We will save this as a new xml document: MyMod_PlanetArtDefs.xml. You will reference this in the PlanetDefs.xml:-

<ArtDefine>VenusArt</ArtDefine>


Step Four: Building the System

We need to create a system for our Star and Planets. In the Planet code above we defined Mercury as a Dead World so we will place this planet in the DeadZone of our system. We defined Mars, Venus and Earth has Habitable Planets so they will be placed in the HabitableZone. And finaly Jupiter we defined as a GasGiant so we will place this in the 'OuterZone' (NoRandom).

We will create a new SystemGroup for our system, this InternalName has to be Unique so we will call it MyFactionsMain

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<StarSystemList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/StarSystemDefs.xsd">
<!-- Created with the Gal Civ 3 Editor -->
<!-- StarSystemDefs.xml -->
   <!-- System Group -->
  <StarSystemGroup>
    <InternalName>MyFactionsMain</InternalName>
      <StarSystem>
          <InternalName>FedSystem</InternalName>
          <DisplayName>FedSystem_Name</DisplayName>
          <Description>FedSystem_Dec</Description>
          <OrbitLane>
              <LaneType>Star</LaneType> <!-- We place the Star we made here -->
              <Body>
                  <BodyType>UnaryStar</BodyType>
                  <BodyDef>FedStar</BodyDef>
              </Body>
          </OrbitLane>
          <OrbitLane>
              <LaneType>DeadZone</LaneType> <!-- We place the dead planets we made here -->
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetMercuryFED</BodyDef>
              </Body>
          </OrbitLane>
          <OrbitLane>
              <LaneType>HabitableZone</LaneType> <!-- We place the habitable Planets we made here -->
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetEarthFED</BodyDef>
                  <IsHomeworld>true</IsHomeworld>
                  <Position>5</Position>
              </Body>
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetVenusFED</BodyDef>
              </Body>
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetMarsFED</BodyDef>
              </Body>
          </OrbitLane>
          <OrbitLane>
              <LaneType>NoRandom</LaneType> <!-- We place the Gas Giant planets we made here -->
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetJupiterFED</BodyDef>
              </Body>
          </OrbitLane>
      </StarSystem>
  </StarSystemGroup>
</StarSystemList>


Remember to keep each Systems, InternalName unique for every system you create. We will save this as a new xml document: MyMod_StarSystemDefs.xml.

If you wanted to have Asteroids in you newly created system we would add them in the same Lane as Jupiter. So Jupiters Lane would look like this:-

          <OrbitLane>
              <LaneType>NoRandom</LaneType> <!-- We place the Gas Giant planets we made here along with any asteroids we require-->
              <Body>
                  <BodyType>Asteroid</BodyType>
                  <BodyDef>NormalAsteroid</BodyDef>
                  <Position>0</Position>
              </Body>
              <Body>
                  <BodyType>Planet</BodyType>
                  <BodyDef>PlanetJupiterFED</BodyDef>
              </Body>
          </OrbitLane>

Step Five: Creating the Text Entries

You will notice that I used Tags for the Display Names and Descriptions these tags point to a Text.xml, now, you need not do this, You can Just type in your system name and description if you want rather than using Tag's like I did (FedSystem_NameFedSystem_Dec).

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<StringTableList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../Schema/Lib/StringTable.xsd">
<!-- Created with the Gal Civ 3 Editor -->

<!-- FACTION SYSTEMS -->

    <StringTable>
        <Label>FedSystem_Name</Label>
        <String>Sol</String>
    </StringTable>
 
    <StringTable>
        <Label>FedSystem_Dec</Label>
        <String>The Federation Capitol system, containing a class 16, a class 12 and a class 7 world.</String>
    </StringTable>

</StringTableList>

We will save this as a new xml document: MyMod_SystemText.xml.

Because we defined a new SystemGroup name this system will not display in the available start systems list that is in the ingame faction creator. You will have to manualy create a faction using xml and enter this system as the factions "HomeSystem".