Children of the Galaxy

Children of the Galaxy

Not enough ratings
Modding
By Empty Keys
This guide is about modding of the game.
   
Award
Favorite
Favorited
Unfavorite
Guidelines and structure
!!!!!!!!!! This guide is still work in progress. !!!!!!!!!!

  • Do not modify content files in the steam game directory. Use Documents\EmptyKeys\CoG.
  • Use UTF-8 encoding with BOM for XML and behavior files.
  • Be careful when replacing build-in game content. It can change in the future.
  • Use unique IDs and keys for data.
  • Use preview.png as.the thumbnail image on the Steam after upload.

All your mods are in Documents\EmptyKeys\CoG\Mods directory. Every mod should have an unique folder. There is a specific structure in the Content\Gameplay directory. You can see that structure in the content directory (steam\steamapps\common\Children of the Galaxy\Content\Gameplay) of the game.

  • AI - behavior scripts for AI
  • Configurations - gameplay XML configuration files
  • Missions - behavior scripts for missions
  • NewGameSetup - behavior script for the new game
  • Technologies - behavior scripts for technologies
  • Tutorial - behavior scripts for tutorials

If you want to create 3D/2D graphic content, you will have to install the Xenko engine[xenko.com] version 1.10.
Create and Upload Mod
Start the game and go to Mods section, Create Mod tab.


Select title, folder and tags and press Create Mod button. Go to the Management tab. You should see your new mod listed as Active Mod.


Go to Documents\EmptyKeys\CoG\Mods\ directory on your computer. There should be folder for your mod. Add some content and upload your mod (Upload Mod button).

Go to Steam Workshop and add some description.Change Visibility to Public, when you are ready.
Gameplay Configurations
Diplomacy
  • NeutralRelationValueMin - min value for Neutral relation level
  • NeutralRelationValueMax - max value for Neutral relation level
  • FriendlyRelationValueMin - min value for Friendly relation level
  • FriendlyRelationValueMax - max value for Friendly relation level
  • HostileRelationValueMin - min value for Hostile relation level
  • HostileRelationValueMax - max value for Hostile relation level
  • UnitKillRelationChange - unit kill relation value change
  • SiegePlanetRelationChange - siege planet relation value change
  • WarDeclarationCooldown - cooldown (in turns) after war declaration
  • PeaceCooldown - cooldown (in turns) after peace declaration
  • BordersChangeCooldown = cooldown (in turns) after borders control change
  • LostPlanetScorePoints - lost planet score change

Factory
This is a list of all units and constructions in the game. There are 3 factory item types - Unit, Static Unit and Planet Upgrade.

Factory Item values
  • Id - unique Id, use 10000 or higher
  • FactoryTypeName - class type name
  • BaseProductionCost - production cost
  • ItemType - item type (Unit, StaticUnit, PlanetUpgrade)
  • RaceId - race id
  • EnergyCostMultiplier - energy cost multiplier
  • ModelRaceIdOverride - Race Id override
  • IsStartUpItem - if item is available on the start of the new game
  • ModelIdOverride - Id override
  • RareResourceCostModifiers
UnitConfig
  • HullMax
  • MaintenanceCost
  • TotalEnergy
  • EnginesEnergyPct
  • ShieldsEnergyPct
  • ShieldsRechargeRate
  • WeaponsEnergyPct
  • SensorsEnergyPct
  • WarpSpeed
  • WarpEngineEnergyRechargeRate
  • WeaponDamage
  • AvailProduction
  • BaseInfluence
  • DockSize
  • MaxDockSize
  • WeaponShieldDamage
  • Actions
  • AttackState
  • KillScorePoints
PlanetUpgradeConfig
  • Modifier
  • ModifierType
  • MaintenanceCost
  • IsRemovable
  • AutoUpgrade

Galaxy
  • StarSystemChance
  • MinNebulaRadius
  • MaxNebulaRadius
  • MinNebulaNumberOfStars
  • MinEmptySpaceRadius
  • MaxEmptySpaceRadius
  • UnitInfluenceTimeFalloff
  • UnitInfluenceDistanceFalloff
  • UnitInfluenceMinimum
  • EnvInfluenceTimeFalloff
  • EnvInfluenceDistanceFalloff
  • EnvInfluenceMinimum
  • GalaxyInfluenceFalloff
  • GalaxyInfluenceMinimum
  • PathPlanetEnergyCost
  • PathAsteroidEnergyCost
  • PathUnitEnergyCostMultiplier
  • PathBaseEnergyCost
  • ResourceCostGalaxyModifier
  • BlackHoleGravityPull
  • BlackHoleGenerationChance
  • RoguePlanetGenerationChance
  • AsteroidsGenerationChance
  • AsteroidsBaseInfluence
  • AnomalyGenerationChance

Missions
  • Id - unique Id, use 10000 or higher
  • BehaviorName
  • MissionType
  • IsRepeatable

Planets
  • ResearchPopulationCoefficient
  • ProductionPopulationCoefficient

Planet Types
  • Radius
  • Mass
  • PlanetTypesProportion
  • BaseResourceCoefficient
  • BaseProductionCoefficient
  • BaseEnergyCoefficient

Races
  • Id - unique Id, use 20 or higher, up to 254
  • ResearchBehaviorName
  • DefaultRelationValue
  • TradeBehaviorName
  • Name
  • Description
  • StateName
  • IsPlayable
  • ExcludeInRandomSelection
  • CoreBehaviorName
  • DiplomacyBehaviorName
  • UnitUpgrades
  • FactoryItems
  • PlanetTypePreferences

Resources
  • ResourceType
  • PlanetTypeProportions
  • SpectralTypeProportions
  • AsteroidProportion

Spectral Types
  • SpectralTypesProportion
  • SpectralTypesMinMaxValues

Star System
  • DaysPerTurn
  • HexDistanceCoeficient
  • AsteroidSizeCoeficient
  • MinPlanetsPerSystem
  • MaxPlanetsPerSystem
  • MinHexesFromStar
  • SystemMargin
  • MinMapRadius
  • MinAsteroidMass
  • MaxAsteroidMass
  • AsteroidPropability
  • MinHexesBetweenPlanets

Technologies
  • Id - unique Id, use 10000 or higher
  • BaseResearchCost
  • Parents

Trade
  • BaseMaxTradePointDistance
  • BaseTradePercentage
  • BaseExpiration
  • BonusDistanceDenominator
  • ExpirationDistanceDenominator

Upgrades
  • Id - unique Id, use 100 or higher up to 254
  • xsi:type
  • AvailRank
  • Modifier
  • UsageLimit
The AI and behaviors
All the important info about the AI modding is on GitHub[github.com] including API Documentation[emptykeys.github.io].

The core of the AI is a behavior tree with utility and decision based AI extensions. Every behavior in the game has unique name. To avoid replacing some existing behavior use some format with the name of your mod in it ( my_new_mod_XYZ etc.).

Example: - BuildBalanced.beh file
<?xml version="1.0"?> <Behavior Name="BuildBalanced" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Sequence> <Behaviors> <PlanetHasConstructionSlot /> <Inverter> <PlanetIsBuilding /> </Inverter> <DecisionTree> <Branch Name="Root" GoalPercentage="1" > <Children> <PlanetDecisionLeaf UpgradeModifier="Energy" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="Production" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="Population" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="Resources" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="Research" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="Intelligence" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="TradeRoutesCount" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="UnitsStartingRank" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="UpgradeMaintenanceCost" GoalPercentage="0.125"/> <PlanetDecisionLeaf UpgradeModifier="RepairCost" GoalPercentage="0.125"/> </Children> </Branch> </DecisionTree> <PlanetBuildFactoryItem /> </Behaviors> </Sequence> </Behavior>


Modding art
It's possible to create a mod with custom 3D or 2D art. There are two sources, which will help you. There is Custom Mod Data project on the GitHub[github.com], which contains an example of the custom ship and UI images. This project was used to create Example Configuration Mod. Xenko project helps you build mod.bundle files with compiled version of your assets. Both files has to be in the root of your mod so the game can load them.

There is directory structure inside Xenko bundle based on unique IDs (race and factory item etc.). So follow that structure. Names of prefabs are very specific too. See Custom Mod Data on GitHub.
Localization
The localization file is a XML file with keys and values. There should one file for each language (two languages at this moment) - Localization_en.xml and Localization_cz.xml. If you don't know how to translate to some language just make a copy of the english version.

Example:
<?xml version="1.0"?> <LocalizationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Strings> <LocalizedString Key="FactoryItem_1000_Name">Fighter</LocalizedString> <LocalizedString Key="FactoryItem_1000_Desc">Fighter description</LocalizedString> </Strings> </LocalizationData>

Keys have specific format for factory items, missions, unit upgrades etc. The unique ID of the item is a part of the key. Replace {ID} with the unique ID.

Keys for an unit upgrade
UnitUpgrade_{ID}_Name
UnitUpgrade_{ID}_Desc

Keys for a factory item
FactoryItem_{ID}_Name
FactoryItem_{ID}_Desc

Keys for a mission
Mission_{ID}_Name
Mission_{ID}_Desc

Keys for a technology
Technology_{ID}_Name
Technology_{ID}_Desc