Master of Orion

Master of Orion

27 ratings
Modding Documentation
By Spud Dastardly
This guide is meant to give detailed documentation on what each parameter does in the most commonly modded yaml files. If you are new to modding, I recommend you read my Modding Basics guide before reading this one. This guide is currently incomplete. If you would like me to provide detailed documentation on any yaml files that I have not included here, let me know in the comments, and I will prioritize that. This documentation is for modding experts, not normal players.
   
Award
Favorite
Favorited
Unfavorite
ColonyStructureTypes.yaml Part 1
This yaml defines all of the structures in the game. I will give a list of each parameter in this yaml in the format "parameter: (input type) description." These are pulled directly from the Assembly-CSharp.dll file, so there are some here that you won't find in the yaml but that you can still use. Types of inputs:
  • (s) string means you can input a name or phrase.
  • (b) boolean means you can input "true" or "false" (without quotes)
  • (i) integer means you can input an integer value
  • (f) float means you can input a decimal value
  • (PlanetMineralRichnessType), (PlanetaryResourceType), etc means you can input a list of keys from the corresponding yaml.
Parameter list:
name: (s) Building name. You can either set it to a value that refers to a name in a .csv file such as COLONY_STRUCTURE_CRUST_PROSPECTING_NAME or give it a name directly using quotes, e.g. name: "Crust Prospecting"

description: (s) The description. Same rules as the name

cost: (f) Production cost

upkeep: (f) BC per turn cost

workingStatus: (b) Developer testing purposes only. No effect

icon: (s) Icon for the building on the build menu and which 3D model to use for the building when it is shown on the actual planet. You can find the available assets in Master of Orion/MasterOfOrion_Data/StreamingAssets/assets/structures.

bonusTiles: (i) I haven't tested this, but it appears to add extra cells to a planet. Requires a list of cell types to add). See structure_asteroid_mines.

spyTrainingTimeModifier: (f) makes spies train in x percent of the time it would otherwise take. Set value between 0 and 1. Used in Espionage Training Facility

compatibleBiomes: (planetBiomeType) restricts so the building can only be built on the specified biomes. Requires a list of biome types

resultingBiome: (s) On completion, converts planet to the specified biome type. Buggy, use ColonyProject instead.

isTransferable: (b) Sets whether this building remains when an enemy captures the planet.

canBuy: (b) Defaults to true if not included. Set to false if you don't want the player to be able to buy this structure. You can overwrite not being able to buy a structure in the vanilla game if you set this parameter to true on a building that originally has it set to false

structurePrefab: (s) For space factory buildings. Specifies the models that can be used on the main screen. For a full list of content prefabs, see here[forum.masteroforion.com]. Accepts any prefab in FleetIconsStarSystem.

structureInProgressPrefab: (s) Sets the model for when a space factory building is under
construction. Always set to ContentPrefabs/FleetIconsStarSystem/fleeticon_build_in_prog.prefab

descriptionStats: (s) unknown, not used

tileBonuses: (string, int) unknown. Presumably specifies bonuses for each tile. Probably uses similar fomatting to bonusTiles.

compatibleRichness: (PlanetMineralRichnessType) Restricts so that the building can only be built on planets with the specified richness. See the crust prospecting sample above.

compatiblePlanetSize: (PlanetSizeType) Restricts so that the building can only be built on planets with the specified planet size.

compatiblePlanetaryResource (PlanetaryResourceType) Restricts so that the building can only be built on planets with the specified resource.

shipList: (ShipHullType) For display only. To actually change what fleetSupportCostReduction affects, you have to set CPAffectedByTechAch: true for the hull in ShipHullTypes.

startingSpyLvl: (i) sets the starting level of all new spies

influencesMinorCivs (s) unlocks this type of influence for minor civs in the same system. Acceptable inputs are "military_outpost_influence" and "capitol_influence" and "space_port_influence" without quotes. See Military Outpost key

upgrades: (ColonyStructureType) determines which structure this building will replace if you build it

structureTypes: (int) Sets what type of structure this is for the purposes of applying filters on the build menu. Types are 0 (Production), 1 (Food), 2 (Research), 3 (Money), 4 (Morale), 5 (Defense), 6 (Pollution).

canBlock: (b) For space factory buildings. Sets whether this building blocks a warp point or allows enemy ships through. Used for military outpost. Default is false if not included

buildBorder: (b) Not sure. Something about whether it defines the border of your empire for AI purposes I think

allowsBattleshipConstruction: (b) Sets whether this building unlocks the ability to build battleships and above at this colony. Used for star base et al.

hasScanner: (b) Used for space factory structures. Determines whether this building detects enemy ships nearby

shipTemplate: (ShipBlueprintTemplate) (or military structures. Determines which ship blueprint this building uses.

baseProductionBonus: (f) Flat production bonus

baseResearchBonus: (f) Flat research bonus

baseLifeSupportBonus: (f) Flat food bonus

populationGrowthMultiplierBonus: (f) Percent population bonus (input as decimal)

workerProductionBonus: (f) Percent production from population bonus. Doesn't work.

workerResearchBonus: (f) Percent research from population bonus. Works.

workerLifeSupportBonus: (f) Percent food from population bonus. Doesn't work.

workerIncomeBonus: (f) Adds a percentage bonus to the income generated by population. Multiplies to tax income only, not BC/pop from other structures.

incomeMultiplierBonus: (f) Same as workerIncomeBonus

pollutionMultiplierReduction: (f) Broken without UCP. With UCP, reduces pollution generated by a percentage.

pollutionCleaningRate: (f) Flat pollution cleanup.

moraleMultiplierBonus: (f) Percent colony morale bonus.

moraleMultiplierBonusSystem: (f) Percent system morale bonus

maxPopulationBonus: (i) Broken without UCP. With UCP, increases max population.

scannerRangeBonus: (f) Increases enemy ship detection range.

fleetSupportBonus: (f) Flat command point bonus. Affected by communications tech.

marinesGenerationRate: (f) Generates this percent of a marines per turn, e.g. 1 every 5 turns for a setting of 0.2.

initialMarinesCount: (i) Gives you this many marines when you build this.

armorGenerationRate: (f) Generates armor barracks units at this rate

initialArmorCount: (i) Gives you this many armor barracks units when you build this.

planetDefense: (i) Determines the number of bomb hits necessary to destroy a planetary shield. Note that bomb damage is irrelevant here.

productionTileBonus: (i) Gives a production bonus to each production worker

foodTileBonus: (i) Gives a food bonus to each farmer

researchTileBonus: (i) Gives a research bonus to each scientist

totalProductionMultiplierBonus: (f) Gives a percent increase to production generation for the planet

workerYieldMultiplierBonus: (f) Gives a percent increase to production generated by workers

totalFoodMultiplierBonus: (f) Gives a percent increase to food generated by the planet

totalResearchMultiplierBonus: (f) Gives a percent increase to research generated by the planet

totalIncomeMultiplierBonus: (f) Gives a percent increase to income generated by the planet

totalEmpireMultiplierBonus: (f) Gives a percent increase to the income generated by your entire empire

foodCarryoverRatio: (f) Broken

shipCostModifier: (f) Reduces the industry cost of ships by a percent. Input as a negative decimal, e.g. -0.30 for 30% decrease in cost

buyoutCostModifier: (f) Reduces the buyout cost of all buildings. Input as a negative decimal

creditIncomeBonus: (i) Gives a flat amount of BC per turn

requiresMoon: (b) sets whether this building requires a moon to build. Default is false if not included

requiresAsteroid: (b) Unused

systemUnique: (b) sets whether this building is system unique

allowGroundDefense: (b) sets whether this building enables ground combat on the planet

empireUnique: (b) sets whether this bbuilding is empire unique
ColonyStructureTypes.yaml Part 2
Due to the character limit, I had to create another section. This list continues the list from part 1.
  • requiresWorker: (bool) (sets whether this building is built by space factories. All space factory buildings need this set to true)
  • requiresWarpGate: (bool) (sets whether this space factory building must be built on a warp gate)
  • needResource: (bool) (Unused. Presumably sets whether a resource is required for a space factory building.)
  • nonBuildable: (bool) (Sets whether this building can or cannot be built. Used for colony base)
  • repairFactor: (float) (Sets what percentage of hull damaged ships repair when in orbit here)
  • canExtractResources: (bool) (Unused. Presumably used to set whether a space factory building extracted resources. Tradeable resources were never implemented)
  • assimilationRateModifier: (float) (Gives a percent bonus to assimilation rate)
  • fleetSupportCost: (float) (Sets how many command points this building costs to maintain)
  • requires: (ColonyStructureType) (Sets what building you need to have built in order to construct this one)
  • allowShipBlueprintUpgrade: (bool) (Sets whether this building enables you to upgrade your ships here)
  • securityBonus: (float) (Provides a percentage security bonus to this colony)
  • requiresColonyInSystem: (bool) (Sets whether a space factory building requires a colony in the system in order to be built)
  • toBeImplemented: (int) (For developer testing only)
  • enableTaxation: (bool) (Once a building with this set to true is built, the colony will start generating tax revenue)
  • systemSecurityBonus: (float) (Provides a percentage security bonus to all colonies in this system)
  • empireSecurityBonus: (float) (Provides a precentage security bonus to your entire empire)
  • fleetSupportCostReduction: (float) (Reduces the command point cost of scouts, troop transports, civil transports, colony ships, frigates, and destroyers only. Specifying different ship types in shipList does nothing.)
  • generatesJumpConnection: (bool) (When set to true, this building acts as a jump gate. Can be used to create jump gate connections on planets.)
This concludes the list. Note that when the game has a boolean value set for that building, in order to override it you have to specify the opposite value, not just delete the line. e.g. to make colony bases buildable, you have to specify nonBuildable: false.

Modding notes:
1. All of the space factory structures are hard coded. If you create a new one, the AI will never build it.
2. The AI prioritizes which buildings to build based on the traits the buildings are given, but not every trait is included in the structure rating formula. If a building has a rating of 0, the AI won't build it until it's built everything else. This is defined in the GetStructureRating. See the GlobalsAI section for the list of traits the AI will use.
3. Upgrades should come after the original building in the yaml file.
Globals.yaml
This section gives a summary of what I personally consider the most useful options from Globals.yaml. To include all of the options would mean writing out the whole yaml here.
- globals: &Backend.Diplomacy.Relationship
The fatigue options control how long the AI will refuse an audience after the diplomatic event.

The dispositionChangeEvents define the disposition change for all diplomatic events. The disposition bar goes from -1 to 1. One tick on the bar is 0.1. Each event will have an initial effect of the weight setting, and it will exponentially decay by discountRate (percentage) per turn.
- globals: &Backend.Civilizations.Civilization
PERK_MAX_SCORE: custom race picks amount
JUMP_GATE_TRAVEL_FACTOR: Travel through jump gates takes this percent as long (so set to 0.75 for 25% shorter trips).
SCRAP_SHIP_VALUE_FACTOR (& STRUCTURE): BC per production point for scrapping
PRODUCTION_GEO_FACTOR: GGP per production
BASE_FLEET_SUPPORT: Base command points
PLAYER_BLUEPRINT_TEMPLATES: List any custom blueprints here and in RaceTypes.
- globals: &Backend.Civilizations.PirateCivilization
RESPAWN_DELAY: Turns between base respawns
MAX_AMOUNT_OF_TURNS_FOR_RESPAWN: # of turns from the start of pirate spawning after which pirates stop spawning
TURN_OF_FIRST_SHIP_DEPLOYMENT: First turn of pirate spawn after initial ships (see below).
TURNS_FOR_NEXT_SHIP_DEPLOYMENT_MIN (& MAX): Next pirate fleet spawns randomly in the min-max range.
TURNS_FOR_FIRST_SHIP_DEPLOYMENT_ON_DISCOVERY: Spawns pirate fleet this many turns after player discovers a base.
PIRATE_DESTROYER_TURN_THRESHOLD (& CRUISER): Turns after starting spawn turn when destroyers/cruisers are sent
INITIAL_SHIPS_COUNT: Ships at the beginning of allowed pirate spawning (first allowed spawn is either triggered by everyone having basic ships/technology or a turn offset in GameStartPoints).
DEPLOYMENT_SHIP_COUNT: # frigates per spawn (doesn't affect initial ships). Similar destroyer/cruiser.
- globals: &Backend.Civilizations.MajorCivilization
BASE_SPY_TRAINING_TIME: Turns to train spies
BASE_SPY_TRAINING_COST & SPY_TRAINING_COST_FACTOR: Cost = base cost + Factor * (1 + current # of spies).
BASE_ESPIONAGE_RATING: Mission risk subtracted per spy level
BASE_SPY_SECURITY: Empire security per spy level for spies on counterespionage
MAXIMUM_SPY_COUNT: Spy cap
SABOTAGE_RESEARCH_MODIFIER: Effect of Hacking mission.
- globals: &Backend.Diplomacy.ResearchTreaty
Treaty cost = Max{BASE_COST, COST_FACTOR * Total RP per turn for both civs}
Reward = REWARD_FACTOR * Total RP per turn for both civs
See LIMIT_FACTOR if using UCP. TRADE_LENGTH available here with UCP. Trade treaty is similiar.
- globals: &Backend.Settlements.Settlement
REPAIR_FACTOR_BASE: Ship hull repaired per turn at base.
- globals: &Backend.Settlements.Colony
POLLUTION_RATE: Pollution per production point
CITIZEN_POLLUTION_RATE: Pollution per population
CLEANUP_RATE: pollution cleaned per production point for pollution cleanup project (see auto cleanup if using UCP)
Max marine capacity = Planet's max population * MAX_MARINE_COUNT_POPULATION_MULTIPLIER. Similar for ARMOR.
TRADE_GOODS_FACTOR: BC per production from trade goods
TERRAFORM_COST_FACTOR: Percent production increase for repeated terraforming
MAX_BULK_COUNT: Max ships you can build in a single stack
The revolt code works, but I haven't looked into how to use it.
- globals: &Backend.Galaxy.Planet
TURNS_TO_DEGRADE_BY_POLLUTION: Turns after hitting pollution limit until planet degrades. Can be 0.
GAS_GIANT_COMPRESSION_LARGE_CHANCE: Probability of getting a large from gas giant compression. Set to 0 for always huge.
- globals: &Backend.Espionage.SpyAgent
SPY_TRAVELLING_SPEED: Turns to recall back to empire
SPY_LEVEL_LIMIT: What it says on the tin
XP to reach next spy level = BASE_LEVELING_EXPERIENCE + EXPERIENCE_FACTOR * Next spy level
Maintenance cost for spies = BASE_MAINTENANCE_COST + MAINTENANCE_FACTOR * Spy level
- globals: &Backend.Fleets.ShipBlueprint
SHIP_COMMAND_POINT_FACTOR: BC penalty per excess command point
SHIP_UPGRADE_FACTOR: BC per production cost for ship upgrade
Dummy values mostly affect tooltips on the blueprints menu but some affect attack/defense values. UCP makes some changes to this, see documentation.
BASE_ENERGY_ACCURACY: Base ship attack
- globals: &Backend.Tactical.TacticalShip
Beam defense bonus from ship speed = ACCURACY_MODIFIER_BY_SPEED * natural log(1 + ship speed)
ARMOR_PENETRATION_LOWER_CAP: Weapon damage can't be reduced below this percentage from armor resilience.
- globals: &Backend.Tactical.Battlefield
Battlefield size is controlled here. I multiplied the values by Sqrt(2) to double the battlefield area.
- globals: &Backend.Leaders.Leader
First leader appears randomly between TURNS_TO_FIRST_MIN and TURNS_TO_FIRST_MAX
Subsequent leaders appear between TURNS_TO_NEXT_MIN and TURNS_TO_NEXT_MAX since the last leader. This range is modified by bonus_general_leaders_appearance_chance.
Max # of leaders per game = MATCH_MAX_COUNT_MIN + (MATCH_MAX_COUNT_MAX - MATCH_MAX_COUNT_MIN) * [(# stars in galaxy * MATCH_MAX_STARS_CANCEL_FACTOR + # of minor & major civs * MATCH_MAX_CIVS_CANCEL_FACTOR - 1) / (MATCH_MAX_STARS_MAX + MATCH_MAX_CIVS_MAX - 1)]
XP_PER_TURN: XP for unhired leaders
XP_PER_TURN_HIRED: XP for unassigned or travelling leaders
Assigned colony leader XP = LEADERS_XP_PER_TURN_ASSIGNED_COLONY + System population * XP_SYSTEM_POPULATION_FACTOR
Assigned ship leader XP = LEADERS_XP_PER_TURN_ASSIGNED_SHIP
Ship leaders get extra XP from events which are controlled by the other values here.
Leader ranks are also defined in this section.




GlobalsAI.yaml
- globals: &AI.T_DiplomacyMajorCiv
The settings in this section control how much value the AI puts on various diplomatic actions. You can also set how long the AI will wait before asking you for more deals here with the TURN_DELAY settings.

The AI evaluates deals items on each side separately. Things you are giving them are evaluated under EvaluateDealItemAsOffer and use all of the OFFER settings, while things they are giving you are under EvaluateDealItemAsDemand and use all of the DEMAND settings here (note: "demand" just refers to who is offering the deal here, not if you are making an actual demand).

The actual numerical values here should be thought of in terms of BC value. So for example, with EVALUATION_DEMAND_TECH_APP_TRADE_PER_RP = 2, this means they will give money for a tech equal to 2 * Number of research points to research the tech, at least as a base value. Conversely, for them to sell you a tech, the multiplier is increased to 4 under the default OFFER setting. This is further modified by your current disposition among other things. While it is in terms of BC value, they will use this valuation in comparing trades between different types of things, like technology in exchange for a war declaration for example.

The DISPOSITION_THRESHOLD values divide the cost of a deal by 2 if your disposition threshold exceeds the specified value. For example, you can see that EVALUATION_DEMAND_ACCEPT_EMBASSY defaults to 10 and DISPOSITION_THRESHOLD_ACCEPT_EMBASSY defaults to 0, and you see in game that with completely neutral disposition (note that disposition ranges from -1 to 1, with 0 being neutral), the AI typically asks for 5 credits if you want them to accept your embassy.
- globals: &AI.Awareness
With this section, you can control how the AI prioritizes their build order. Each of the keys in this section correspond to a set of structure bonuses. Those are the only structure bonuses that the AI will consider when prioritizing when to build, and thus every building should have at least one of the listed bonuses if you want the AI to build it. The categories and bonuses as of UCP 6.2 are:
  • buyout_cost: buyoutCostModifier
  • ship_building_speed: shipCostModifier
  • defense_ground: CanDefend, allowGroundDefense
  • defense_orbital: fleetSupportBonus
  • shields: planetDefense
  • BC_per_pop: workerIncomeBonus
  • BC_flat: creditIncomeBonus, incomeMultiplierBonus, totalEmpireMultiplierBonus
  • morale_flat: moraleMultiplierBonus
  • pollution_absortion: pollutionMultiplierReduction, pollutionCleaningRate
  • food_flat: baseLifeSupportBonus, totalFoodMultiplierBonus, populationGrowthMultiplierBonus (NO UCP)
  • food_per_cell: foodTileBonus, maxPopulationBonus (UCP)
  • population_growth: populationGrowthMultiplierBonus (UCP)
  • terraforming: maxPopulationBonus (UCP)
  • production_flat: baseProductionBonus, totalProductionMultiplierBonus
  • production_per_cell: productionTileBonus, workerProductionBonus
  • research_flat: baseResearchBonus, totalResearchMultiplierBonus
  • research_per_pop: researchTileBonus, workerResearchBonus
  • security: securityBonus, systemSecurityBonus
To decide what to build, the AI looks at what its needs are (weighted by personality settings) and then weights those needs according to the preferences in GlobalsAI. The base_score acts as a multiplier on how much the AI prioritizes that type of building. The other scores further multiply depending on the development state of the economy:
  • early: A colony is considered early stage if it either has less than 2 flat production from buildings or fewer population than food cells (usually <half max pop)
  • developed: not early or mature
  • mature: Population > 80% of max and has at least one structure built that provides a food, research, or production bonus
So using the example
- key: food_per_cell base_score: 7 early: 5 developed: 10 mature: 3
The AI would give a 35* multiplier to food_per_cell for early colonies, an 70* multiplier at developed, and a 21* multiplier at mature.
RaceTypes.yaml
I'll first give a summary of what each personality trait does, and after that I'll list the functions in Assembly-CSharp.dll where those traits are used in case you want to look at the formulas in more detail.

  • chance: Sets the chance of this personality being used. Any number of personalities can be added.
  • territoriality: Higher territoriality settings result in more border tension and more frequent war declarations. It controls how upset the AI gets from violations of their territory.
    Functions: ProcessDispositionEnemyFleetsInMyStars, ProcessDispositionEnemyFleetsInMyPlanets, ProcessDispositionBorderTension, ProcessDispositionOverstretchColonies
  • honorable: Higher honorable results in fewer war declarations (but more colony and tribute demands when they don't like you) and less likelihood to break No Spying agreements.
    Functions: SendWarDeclarations, GetOpportunityRating, GetEspionageTargetColonyRating
  • irascible: Higher irascible means the AI has a lower disposition threshold for when it considers you their enemy.
    Functions: GetBadRelationsThreshold
  • pacifist: Higher pacifist means the AI is less likely to agree to a request to go to war, more likely to offer nonaggression pacts, peace treaties, and alliances. It also means the AI must hate a race more in order to want to go to war with them on their own. Higher pacifist makes them less likely to expand aggressively and more likely to consider you an ally or at least not an enemy given lower disposition with them.
    Functions: EvaluateDealItemAsDemand, EvaluateDealItemAsOffer, GetOpportunityThreshold, GetBadRelationsThreshold, GetDefensiveAllyThreshold, RefreshTargetLocalWars
  • respectful: Higher respectful means the AI is less likely to colonize planets in systems that have already been colonized by other players and the AI is less likely to kill spies it has caught.
    Functions: GetPlanetRating, CalculateSpyKillChances,
  • expansionist: Higher expansionist means the AI will build more colony ships and declare more wars.
    Functions: AllowProductionInColony, GetOpportunityThreshold, RefreshTargetLocalWars, HandleColonyShips
  • opportunist: Higher opportunist means the AI is more likely to colonize planets, more likely to go to war, and more likely to take the ramming action in tactical combat.
    Functions: GetOpportunityThreshold, RefreshTargetLocalWars, CheckKamikazeAction
  • defensiveness: Higher defensiveness means the AI will build a bigger fleet when attacked, will devote more money to espionage (only if defensiveness > espionageAggressiveness), will consider other races a threat more easily, will be more likely to offer an alliance, and will build more security and defense buildings.
    Functions: RefreshLocations, EconomyManager.PreUpdate, EvaluateDealItemAsOffer, GetThreatThreshold, EvaluateNeeds, EmpireUnderThreat, ApplyDefenseLevelMinimal
  • cohesivity: Higher cohesivity means the AI will be more likely to colonize planets near to their empire rather than those that are far away.
    Functions: GetPlanetRating
  • growthInclination: DEPRECATED (doesn't do anything)
  • productivityInclination: DEPRECATED (doesn't do anything)
  • heavyArmy: Higher heavyArmy makes the AI build larger ships.
    Functions: RefreshRequiredArmy
  • espionageAggressiveness: Higher espionageAggressiveness means the AI will devote more money to espionage (only if espionageAggressiveness > defensiveness) and it will more likely to conduct espionage missions.
    Functions: EconomyManager.PreUpdate, GetEspionageTargetColonyRating
  • diplomat: Higher diplomat makes the AI more likely to go for the diplomatic victory, more likely to go for minor civ systems. It makes the AI budget more money for diplomacy and makes them less likely to spy on allies.
    Functions: GetVictoryConditionScore, EconomyManager.PreUpdate, GetIndependentCivilizationAllyRating, GetEspionageTargetColonyRating
  • militarist: Higher militarist makes the AI place a higher value on military techs for trading, makes them more likely to go for conquest or antaran victory, increases the budget for military spending, makes them more likely to ask allies to go to war with their enemies, makes them build more star bases for command points.
    Functions: GetMilitaryProfile, GetVictoryConditionScore, EconomyManager.PreUpdate, GetOffensiveAllyThreshold, EvaluateNeeds, T_BuildArmy.Run
  • ecologist: Higher ecologist makes the AI value social technologies higher for the purposes of trading, makes the AI budget more credits for general use, and makes the AI prioritize building food, morale, and pollution buildings.
    Functions: GetSocialProfile, EconomyManager.PreUpdate, EvaluateNeeds
  • industrialist: Higher industrialist makes the AI value economic techs higher for trading tech, makes the AI more likely to go for the economic victory, makes the AI budget more money for economic uses, makes the AI prioritize building economic and production buildings, and if industrialist > technologist, makes the AI build more asteroid mines than asteroid labs.
    Functions: GetEconomyProfile, GetVictoryConditionScore, EconomyManager.PreUpdate, EvaluateNeeds, EvaluateBuildablePriorityInNode
  • technologist: Higher technologist makes the AI value research techs higher for trading tech, makes the AI more likely to go for the scientific victory, makes the AI budget more money for research uses, and if technologist > industrialist, makes the AI build more asteroid labs than asteroid mines.
    Functions: GetResearchProfile, GetVictoryConditionScore, EconomyManager.PreUpdate, EvaluateNeeds, EvaluateBuildablePriorityInNode
  • boldness: Higher boldness makes the AI more likely to go to war.
    Functions: CalculateWarPossibilityFactor
  • grateful: Higher grateful makes the AI more likely to agree to deals if you've had positive diplomatic relations with them in the past.
    Functions: AffectDisposition
  • resentful: Higher resentful ratings makes the AI less likely to agree to deals if you've had negative diplomatic events with them in the past (such as rejecting their proposals). It also makes them more likely to ram your ships in combat.
    Functions: AffectDisposition, CheckKamikazeAction
  • stellarConverterInclination: Does nothing at all. Doesn't matter what you set it to. (Note: in UCP this gives the AI this *10 % chance of using stellar converter on a planet)
  • bioBombInclination: When set to 10, makes the AI drop bio bombs when attacking a planet. Any other value does nothing. Bio bombs must be added in ShipBlueprintTemplates.yaml (only Silicoid have them by default).
    Functions: RunBombardInvade
  • invasionInclination: invasionInclination allows the AI to invade planets which up to this many stars away from them. It also makes them send a greater number of transports to invade: a 10% increase for each increase in this value.
    Functions: GetInvasionTargetRating, T_Invade.Run
  • retreatInclination: Higher retreatInclination makes the AI more inclined to retreat during battle.
    Functions: GetTacticalProfile
  • tradeInclination: Higher tradeInclination makes the AI budget more money for diplomacy and economic development, make the AI more easily consider a race to be an ally, makes them more likely to ask you to go to war with one of their enemies, makes them ask for share charts, trade treaties, research treaties, and tech trades even when you have low disposition with them.
    Functions: EconomyManager.PreUpdate, GetDefensiveAllyThreshold, GetOffensiveAllyThreshold, GetTradeTreatyThreshold, GetResearchTreatyThreshold, GetTechTradeThreshold, GetShareChartsThreshold
Other notes on RaceTypes:
  1. RGB color changes only work with UCP
  2. racialBiases are how this race feels toward another race
  3. Custom ship hulls should have blueprints added to shipBlueprintTemplates for all AI as well as the player in Globals
  4. Techs listed in preferredTechApplications have their ratings doubled for the purpose of choosing between techs.
WeaponTypes.yaml
This is a list of parameters and what they do in WeaponTypes.yaml. This list of parameters follows the same formatting as the ColonyStructureTypes list. I'm not as familiar with this list, so if you know what any of these parameters do that I'm not sure about, let me know and I'll update the list.
(f) = floating value/decimal
(i) = integer
(b) = boolean (true/false)
(s) = string

List of parameters pulled from Assembly-CSharp.dll:
model: (s) Sets the visual effect for the weapon. See ContentPrefabs found under tactical/weaponeffects/

className: (s) Sets the weapon type, e.g. TacticalBeam, TacticalLaser.

visualScale: (f) Visual weapon size

weaponHP: (f) Missile HP

tacticalCooldown: (f) sets the cooldown on the weapon

rateOfFire: (f) sets the time between volleys. No effect if volleySize=1.

ammo: (i) sets the total max amount of ammunition for a weapon. E.g. if this is set to 10, and a player puts 1 missile on a ship, it'll be able to fire 10 times. If they put 3 missiles on the ship, it'll be able to fire a full volley 3 times then 1 missiles on the fourth volley. Auto resolve doesn't take max ammo into account.

volleySize: (i) Amount of times weapon slot fires

antiWeaponDamage: (f) Lightning field damage

minDamage & maxDamage: (f) Weapon damage is randomly between min and max. If min not set, defaults to max. If max is changed and min=max is desired, min must be changed too unless using UCP 6.2 or later.

bombHitChance: (f) % chance to score a hit when doing planetary bombardment.

weaponStepsDuration: (f) Beam weapons fire multiple "procs" per shot. This sets the total duration of those multiple shots.

weaponSteps: (i) Sets the number of procs per shot.

armorPenetration: (f) Sets armor penetration. This value is divided by armor resilience, and the result is a multiplier on damage.

shieldPenetration: (b) Shield piercing. Default false.

weaponAccuracy: (f) Sets the % chance of this weapon hitting absent any other factors, where 1.0 is 100%. All weapons by default have this set to 1.0

missileAttack: (f Missiles always have a chance to miss. This determines that. The exact formula is % chance to hit = 100/(1+2^((Missile Avoidance-Missile Attack)/16)). Missile avoidance is granted only by jammers.

weaponRange: (f) weapon range

splashArea: (f) Splash radius for plasma web

timeToLive: (f) Missile/torpedo disappears after this many seconds

duration: (f) weapon effect duration

distanceToLive: (f) Distance missile/torpedo travels before disappearing

armTime: (f) Time before artemis system net mine is armed.

damageToShield: (f) Energy absorber bonus value

rangeLoss (f): Accuracy penalty at max range

isToggleable: (b) Sets whether the weapon can be toggled on and off

isTargeteable: (b) Non-functional

rangeDissipation: (b) sets whether or not weapon damage dissipates with range. Default value is True if not included

onUseFunc: (s) weapon effect for special weapons

warmupTime: (f) Time after weapon slot activates before it actually fires

radius: (f) Appears to be unused

physicsEnabled: (b) Not sure. Something about whether it obeys the game's physics engines. Default value is True. All beams and cannons should be set to false.

mass: (f) appears to be unused

acceleartion: (f) weapon speed gained per second

maxVelocity: (f) max weapon velocity

maxVelocityVariance: (f) Actual max weapon velocity is randomly within this percent of maxVelocity.

angularAcceleration: (f) weapon turning speed gained per second

maxAngularVelocity: (f) Max turning speed

velocityFriction: (f) Does nothing

angularFriction: (f) Does nothing

isPDBlockeable: (f) Sets whether targetable by PD

hasFacing: (b) Determines whether the weapon has different facing settings (front, back, sides, all). Missiles and fighters have this set to false. Default is true. Setting this value to true for a weapon that has it set to false will have it default to true anyway on the weapon select screen, so you have to create a new key if you want to give missiles facing, for example.

bonusAcceleration: (f) Augmented engines bonus speed multiplier

bonusSP: (f) Shield capacitor bonus as % of base hull.

modifiers: (s) List of allowed weapon modifiers from ShipModuleModTypes.yaml.


canUseBombs: (b) Sets whether a fighter can use bombs. Default is true

isBomberSquadron: (b) for bombers

isMirvFragment: (b) Don't use this.

dronesPerGroup: (i) Fighters per fighter bay deployment

onEvalueteFunc: (s) For special weapons

slowFactor: (f) Sets how much a weapon slows enemy ships. Used for the unimplemented tractor beam

rangeDecayFactor & decayRate: (f) Weapon damage multiplier = 1 - (current percent of max range * range factor) ^ decayRate

useAttackAnimation & attackTrigger: (st) Used for squid melee attack.

ignoreByBattleHighlights: (b) This weapon won't show up in the post-battle highlights.

rammingSpeedFactor: (f) Not sure. Ramming damage appears to be multiplied by a percentage of speed, and this sets that percentage.

autoAimForceY: (f) Unknown. Used for ramming.

autoAimForceXZ: (f) Unknown. Used for ramming.

statusIcon & statusTitle & statusDescription: (s) for status effect tooltips.
Miscellaneous
Steam download location
When you subscribe to a mod on the Steam Workshop, the Steam Client will automatically download those files to your computer. Those files are located in a subdirectory of the Steam installation folder at Steam\steamapps\workshop\content\298050

Each mod is in its own folder numbered by the mod's Steam ID (this is the string of numbers at the end of the URL for the mod page). In this way, you can access the mod files provided by Steam Workshop mods. This is useful for seeing how other modders have done things and checking compatibility between mods. To modify these workshop mods yourself, I recommend copying them to the local mods folder so they won't be overwritten automatically by updates to the Steam version.

Additional Tooltips
Many parameters in the game do not have tooltips displayed, and as a result there are some hidden values not shown to the player. The existing tooltips are in Master of Orion\MasterOfOrion_Data\StreamingAssets\Localization\Frontend\TooltipStatLinks.csv. You can however create new tooltips using the same formatting as is contained in this .csv. For example, if you include the line
TOOLTIP_STAT_LINKS_baseCombatRating,,%marine Ground Combat Rating: +{0}%,%marine Боевой уровень наземных войск: +{0}%,%marine Wertung für Bodenkampf: +{0}%,%marine Valeur de combat au sol: +{0}%,%resiliencerating Klasa wytrzymałości: {0},%resiliencerating Třída odolnosti: {0},%resiliencerating Dayanıklılık Reytingi: {0},%resiliencerating Índice de resistencia: {0},%resiliencerating Grado de Resistencia: {0},%resiliencerating Taxa de Resiliência: {0},%resiliencerating 탄력: {0},%resiliencerating 耐弾性レート : {0}
in your .csv file for your mod, then it will display the ground combat bonus for every rifle in the game when you mouse over the rifle. The basic format for creating a tooltip is
TOOLTIP_STAT_LINKS_yamlParameter,,English,Russian,German,French,Polish,Czech,Turkish,Spanish (Spain),Spanish (Latin America),Portuguese (Brazil),Korean,Japanese

Typically you will also want to include an icon in the tooltip. The icons are located in MasterOfOrion_Data\StreamingAssets\assets\icons\tooltip. The basic format for those is to put a % sign followed by the part of the icon filename that follows "icon_". In the example above, I have used icon_marine.png by putting %marine in the line before the text.

You can theoretically create a tooltip for any parameter in the yaml file that pertains to something in the game you can mouse over. This is especially useful for when you're using an unused but functional parameter in the game such as compatiblePlanetSize in ColonyStructureTypes.yaml.

The game's code
All of the contents of this guide have been extracted directly from Assembly-Csharp.dll. If you download a program called dotPeek[www.jetbrains.com] you can decompile the Assembly-CSharp.dll located in MasterOfOrion_Data\Managed and view the game's CSharp code. You can use this to find formulas for things like chance for missiles to hit for example, and you can use it to find unused but implemented parameters like compatiblePlanetSize for ColonyStructureTypes.yaml. Being able to read C Sharp helps, but it's not mandatory for deciphering everything in the .dll.

ContentPrefabs and other such things
Most of the content prefabs are in MainData located in MasterOfOrion_Data. Notepad++ can open this file. Most of the file will show as NUL gibberish, but you can do a search of the file for prefab to find all of the prefabs. I've compiled a complete list here[docs.google.com]. If that list is broken see this less complete list.[web.archive.org]. The maindata file also contains, for example all of the surface materials for planets used in PlanetBiomeTypes.yaml, and there are some unused ones you can use to make custom biomes. I've compiled a complete list of materials here[docs.google.com].

Lastly, I compiled a list of audio paths[docs.google.com] for the game in case anyone finds a use for it someday.
Assets
Most of the assets for the game are in MasterOfOrion_Data\resources.assets. The tool I use to view and extract these is Unity Assets Bundle Extractor[7daystodie.com]. There's over 100,000 assets in the resources.assets file alone, so good luck finding what you're looking for.

yaml Load Order
The game loads modded yamls in alphabetical order, but the base yamls are loaded in a different order. This can lead to minor issues such as tooltips displaying incorrectly. The correct load order should be:
Globals
GlobalsAI
PlanetRating
ModelledGalaxyData
GalaxyAges
GameStartPoints
Difficulties
GameSpeeds
ResearchSpeeds
ProductionSpeeds
PopulationGrowthSpeeds
TimelineSaveModes
BiomeChances
PlanetSizeChances
PlanetaryDensityPackages
StarTypes
PlanetaryResourceTypes
TradeableResourceChances
TacticalScenarioDesign
TacticalShipDesign
FormationTypes
TacticalObstacleTypes
BattlefieldHazardsConfig
TacticalNotificationTypes
PlanetSizeTypes
PlanetBiomeTypes
PlanetMineralRichnessTypes
GravityTable
ShipHullTypes
ShipHullModels
ShipSlots
ShipModuleModTypes
WeaponTypes
ShipModules
ShipBlueprintTemplates
ShipHullModelConfigTypes
ColonyStructureTypes
ColonyProjects
PlanetDefenses
Miniaturizations
TechAchievements
TechApps
RacialBiases
RacialPerks
RaceTypes
GovernmentTypes
TechTree
EspionageMissions
RandomEvents
GNNEvent
GNNRankings
NotificationType
AudienceEvent
AudienceEventPlaylist
Tutorials
TriggerableActions
MentatResearchEvent
Subtitles
RaceTypesDLC
GNNEventDLC
AntaranSettings
AntaranAudienceEvent
SubtitlesDLC
LeaderTypes
LeaderBonuses
MinorCivClasses

You can force this load order by renaming your files 01Globals.yaml, 02GlobalsAI.yaml, etc.
Useless yamls
The following yamls do not contain any useful moddable settings:
TacticalScenarioDesign
TacticalShipDesign
TacticalObstacleTypes
TacticalNotificationTypes
TacticalRoles
TacticalStrategies
GovernmentTypes
GNNEvent
NotificationType
AudienceEvent
AudienceEventPlaylist
Tutorials
TriggerableActions
MentatResearchEvent
Subtitles
GNNEventDLC
AntaranAudienceEvent
SubtitlesDLC
SpaceMonsterType
GNNSubtitles cf. "Still alive" ;)
51 Comments
guywearingsocks 15 Aug @ 2:35pm 
In the same vein of race specific ships, I had a question; I've been trying to put Darlok (alt ships, eg., Ironclad, Gunship, etc...) blueprints under Terran build list, but with no luck. I think the beta version ships look similar to the Human ships with a little more menace. Thanks for any input.
Dr. Cointreau 9 Jun @ 11:06am 
Thanks for the idea! Haven't had any luck on the first go with klackon_frigate_b , but I still need to fiddle around and check things to make sure I didn't miss something. Thanks!
Spud Dastardly  [author] 8 Jun @ 9:28pm 
I'm not sure. I think someone once tried to make an orion guardian player ship mod and ran into some issues with it. You could try though. You should append the race's name to the beginning, as in
model: klackon_frigate_b
Dr. Cointreau 8 Jun @ 7:05pm 
If editing or creating a new ship, if it possible to set the model to a specific race’s version, other than the chosen race’s version? e.g., instead of

model: frigate_b

in creating the hullmodel, could I specifically assign it the model used by the Klackons? (I hope my question makes sense…)
Dr. Cointreau 29 May @ 1:08pm 
Right—my idea was to give a specific race a unique building as a racial perk: a cheap structure that boosts population growth. The catch was that this building would be replaced by the Colony Base once that became available, so the population bonus would only give them an early-game edge, not a permanent advantage.
Unfortunately, once Deep Space Exploration is unlocked, Colony Base just never gets built on planets that already have the exclusive building. It seems that adding upgrades: structure_exclusive_building_name to the YAML specs for Colony Base actually prevents it from being constructed if the building it's supposed to upgrade is already present.
Spud Dastardly  [author] 29 May @ 9:52am 
I should add that GameStartPoints can give races a starting building that they do not have unlocked by technology. You could give them a building they can otherwise never research and then have it be upgraded by something later, but you would have to have that later building require this one so it would not be built elsewhere. This would only work on the homeworld.
Spud Dastardly  [author] 29 May @ 9:49am 
There's no way to directly give specific races different starting population or money. You can give them starting fleets in GameStartPoints, but this only works for the AI, while the player gets a separate starting fleet. If you give the AI a significant command points deficit from their starting fleet, they may scrap ships and get extra BC as a result, but they would have to be able to build those ships as well. You can give a race an exclusive building using a race perk, but they still have to build it. The only ways I can think to automatically get rid of a building are by upgrades, biome compatibility, or nontransferability on invasion.
Dr. Cointreau 29 May @ 8:51am 
Alternately, is there any way to give a specific race a different starting population, or starting money, or anything like that?
Dr. Cointreau 29 May @ 8:47am 
I’m trying to build a structure that is automatically deleted a some point early in the game (let’s call it EDS for “Early Deleted Structure.”) My thought was to set Colony Base so that it upgrades EDS. It partly works: any new colonies have the colony base built, while EDS is no longer available. However, it doesn’t work for but colonies already established when Colony Base becomes available. Instead, EDS still exists, and Colony Base is never built (since it’s unbuildable by player.)

Any thoughts for a fix or alternate approach to make a structure only available early in the game? Thanks in advance for any comments.
Dr. Cointreau 2 May @ 10:30am 
Thank you for your patience with my unending questions!