20 — Diplomacy: mood, infamy, personalities and the AI's words¶
Index · AI configuration · Other configuration files
Every faction run by the AI keeps a mood toward every other faction, remembers why, and lets it colour its deals,
votes, threats and wars. In Conquest every faction also has an infamy, the world's record of its killing of
civilians and its use of nuclear and inhumane weapons, which leads to protests, demands, sanctions and isolation. What
an AI says while it does all this comes from a language file by name. This chapter explains these systems for a
modder and names the file and keyword behind each part; the complete keyword tables of AI/Mood.txt,
AI/Infamy.txt and AI/Personalities.txt are in chapter 08.
The same rules hold for every faction: what a human player does to an AI counts exactly as what an AI does to another.
Contents
- The files
- Mood
- Infamy, its stages and sanctions
- Weapons and units that feed the diplomacy
- Personalities
- Deal items
- Threats
- The AI's words:
mood.lng - The diplomacy screen's own strings
- Worked mini-mods
- Pitfalls
1. The files¶
| File | What it changes | Reference |
|---|---|---|
AI/Mood.txt (optional) |
What raises or lowers a mood, by how much, how fast it fades, and the mood thresholds of some decisions | 08 §19 |
AI/Infamy.txt (optional) |
Infamy and atrocity points per deed, the stages, sanctions, protests, demands and ultimatums (Conquest) | 08 §22 |
AI/Personalities.txt (optional) |
Trait profiles drawn for the AI factions: greed, bluffing, courtship, humanity, sanctions, betrayal | 08 §16 |
AI/DiplomacyTime.txt (optional, not shipped) |
How long an AI holds to an accepted or declined offer before reconsidering it | 08 §12 |
AI/CovertOps.txt |
The promise to stop covert operations: how long it may be asked for, how long it holds | 08 §15 |
Units/explosion.txt, Units/Missile_defs.txt |
Inhumane marks weapons aimed at populations; the explosion Type makes a weapon chemical |
§4, 03 |
Units/Units.txt |
CovertOperative marks units whose capture lowers the mood |
§4, 01 |
Lang/<language>/mood.lng |
The AI's replies, notices, vote refusals, the names of the mood causes and of the reasons for a war | §8, 12 §5 |
Lang/<language>/UI.lng |
The diplomacy screen: deal item names, threat levels, buttons, tabs | §9 |
The map, or NewGameSettings.txt |
Match settings: ceasefire and peace treaty lengths, alliances, technology trade, permanent alliances, economic sanctions | §6, 09 §7 |
Mood.txt and Infamy.txt take one Name value per line and end with END. A rule left out keeps its default (the
shipped files list every rule at its default), so a mod's copy needs only the rules it changes. They have no USE
and no IF: a mod's file replaces the game's. An unknown name is reported and ends the file, so a typo silently
drops every rule after it. Personalities.txt has no USE either: a mod that changes it ships the whole file.
mood.lng and UI.lng do take USE PREVIOUS, so a mod adds or replaces lines without copying the file.
All times in the AI files are ticks: 60 ticks are one game second, 3600 a game minute, 216000 a game hour.
2. Mood¶
How it works¶
A mood is a number from −10 to +10 that one faction holds toward another. Events push it up or down, and it fades
toward 0, halving every HalfLifeAI ticks (216000, one game hour; HalfLifeHuman for the mood toward a human
player). Every change is booked under a cause, so the game can show why a faction feels as it does.
A simple example with the shipped values. Faction A declares war on B:
- B's mood toward A:
WarDeclaredOnUs−2. - A's mood toward B:
WentToWar−1 (going to war sours the aggressor too). - C, partner of B:
WarDeclaredOnPartner−0.5 toward A.
A takes two of B's regions: B −0.5 each (RegionConquered), at most −3 for that war (RegionConqueredMax). The war
ends after an hour; by then B's −3 has faded to −1.5, and an hour later to −0.75. Had A stopped while winning without
taking land, B would have gained SparedUs +1.
Factions start at 0, except toward the factions the map names in its DefaultEnemy lines (PastRelations −1,
"Old rivalry") and DefaultAlly lines (PastAlliance +0.5, "Old friendship"), see 09.
What it changes¶
| Mood | Effect |
|---|---|
| Any | Every deal the AI weighs is worth OfferBiasPerPoint (0.5) more per point of mood toward the other side, less for a negative mood (a region is worth about 5). Its votes on alliances lean the same way. |
FriendMood (+1) or above |
A friend: the AI does not threaten it, demand land from it, plan an attack on it or take a deal to attack it. The bar is FriendMoodPerAggression (5) higher per point of the personality's Aggressiveness above 0.5 (Rogue, 0.7: +2). |
Above StrayHitMood (0) |
A hit at peace is first a complaint (StrayHitPenalty −0.5), and only a second one within StrayHitWindowTicks a war. |
| −2 or below | Hostile: no partner is sought in it, and a partner is sought against it. |
| Below 0 | Needed before the AI sanctions it (§3) or protests at its killing. |
DemandMood (−2), UltimatumMood (−4) or below |
Needed for a demand to spare civilians and for an ultimatum (§3). |
The personality's MassacreMood or below |
Its armies occupying the other's cities at war fire their massacre weapon (§5). |
PermanentAllianceMood (+2) held PermanentAllianceTicks |
With the match's timed permanent alliances off: partners may make their alliance permanent. |
The diplomacy screen shows an AI's mood toward the player as a bar (its hover shows the exact value), the causes
under their MOOD_ names, and with History the events behind them. For human players the game keeps an estimated
mood by the same rules; it decides nothing.
The causes¶
Each cause has a name in mood.lng and one or more rules in Mood.txt:
mood.lng key |
Shown as | Mood.txt rules |
|---|---|---|
MOOD_EARLIER |
Earlier events | changes with no cause of their own |
MOOD_WAR_DECLARED |
War declared on us | WarDeclaredOnUs |
MOOD_PARTNER_ATTACKED |
War declared on our partner | WarDeclaredOnPartner (not for a war on a pariah or for its atrocities) |
MOOD_WENT_TO_WAR |
We went to war with them | WentToWar |
MOOD_LAND_TAKEN |
Our land taken | RegionConquered, RegionConqueredMax |
MOOD_WAR_LOSSES |
Our losses in the war with them | WarLossesMax, WarLossesFullAt |
MOOD_PARTNER_LOSSES |
Our partner's losses in the war with them | PartnerLossesShare |
MOOD_DEFEATED_US |
Defeated us in a war | LostWarMin, LostWarMax |
MOOD_SPARED_US |
Spared us when it could have taken more | SparedUs |
MOOD_NUKED_US, MOOD_NUCLEAR_USE, MOOD_SATELLITES |
Nuclear strikes on us / on others, satellites shot down | NuclearTactical, NuclearStrategic, NuclearCities, NuclearSpace × the relation (RelationVictim, RelationBystander, RelationAttackerAlly); Conquest |
MOOD_CIVILIANS, MOOD_MASSACRE |
Civilians killed / killed on purpose | the deed's infamy points × the observer's Humanity × the relation (§3); Conquest |
MOOD_GENOCIDE |
Genocide of our people | the victim's own: deliberate points × DeedVictim; Conquest |
MOOD_PROTEST |
Protests over civilian deaths | Protest, ProtestMax |
MOOD_SANCTIONED |
Imposed sanctions | SanctionedMood, SanctionBystanderMood (in Infamy.txt) |
MOOD_THREAT_EXCEEDED |
Threats exceeded | ThreatExceededTarget, ThreatExceededOthers |
MOOD_ATTACKED_SUBMITTED |
Attacks on those who gave in | AttackedSubmittedVictim, AttackedSubmittedOthers |
MOOD_PROMISE_BROKEN |
Promise to stop arming broken | RearmedClient…, BrokePromise…, StoppedAid… |
MOOD_AGREEMENT_CANCELLED |
Agreements cancelled early | AgreementCancelledMax, DealBroken |
MOOD_COVERT_CAUGHT |
Covert operations against us | CovertCaught, CovertCaughtNuclearFactor, the unit's CovertOperative |
MOOD_COVERT_PROMISE_BROKEN |
Promise to stop covert operations broken | CovertPromiseVictim, CovertPromiseOthers |
MOOD_STRAY_HIT |
Its forces hit ours at peace | StrayHitPenalty |
MOOD_DEAL |
Deals made | Deal, DealFullValue, DealGoodwillGap |
MOOD_FAVOUR |
Gifts and fair trades | Gift, GiftFullValue, GiftTechFullPoints, FairTrade |
MOOD_AID |
Aid between us | AidBonus, AidFullAt |
MOOD_ARMED_US, MOOD_ARMED_ENEMY |
Arming us / our enemies | ArmedUs, ArmedUsMax, ArmedOurEnemy, ArmedOurEnemyMax |
MOOD_PARTNERSHIP |
We became partners | BecamePartners |
MOOD_LONG_PEACE, MOOD_LONG_PARTNERSHIP |
A long peace / partnership | LongPeace…, LongPartnership… |
MOOD_LEFT_ALLIANCE, MOOD_KICKED_OUT |
Left our alliance / voted us out | LeftAlliance, VotedOut |
MOOD_RIVAL_BLOC |
Rival bloc | RivalBloc, RivalBlocTicks |
MOOD_POWER_UNEASE |
Unease about your power | PowerUneaseWarned, PowerUneaseLeaving |
MOOD_DESTROYED_ALLY |
Destroyed our ally | DestroyedAlly |
MOOD_LAND_RETURNED |
Gave back our land held by a third party | RegionReturned |
MOOD_VOTED_BAN |
Voted to ban our weapons | VotedBan, VotedBanPassed, VotedBanMax |
MOOD_PAST_RELATIONS, MOOD_PAST_ALLIANCE |
Old rivalry / friendship | PastRelations, PastAlliance |
Rules that set no cause of their own but shape decisions: FriendMood…, FriendStrengthPerMood, the
AgreementReview…, AgreementCooldown… and PartnerCooldown… rules (when an AI ends a lasting agreement and how
hard it is to make it again), CooperationRivalry… (a cooperation agreement helps the other side too) and
AllianceOpeningTicks (no alliances sought between AIs in the opening).
The mood and its causes are kept in saved games. A change to Mood.txt applies from the next game start or load to
new events; moods already recorded stay as they are.
3. Infamy, its stages and sanctions¶
Infamy exists in Conquest only. In the other scoring modes AI/Infamy.txt has no effect.
Infamy and atrocity¶
Infamy is the record of what a faction did, the same for every observer. Its part from deliberate deeds is the
atrocity. Both halve every HalfLife (216000) ticks; infamy is capped at Cap (20).
| Deed | Points (shipped values) | Atrocity? |
|---|---|---|
| People killed | 1 per WorldShare (0.25 %) of the world's starting population; × DeliberateDeaths (3) when deliberate |
the deliberate part |
| A city struck on purpose | CityStruck 1 |
yes |
| A tactical / strategic nuclear weapon used, on anything | TacticalUse 0.25 at 10 kt / StrategicUse 0.5 at 500 kt, × (yield ÷ that)^0.5, between ×0.25 and ×2 |
no |
| An inhumane weapon used, on anything | its Inhumane weight (§4) |
yes |
| A chemical weapon used (not marked inhumane) | ChemicalUse 0.05; all chemical use together at most ChemicalUseCap 2.5 |
no |
Deaths are deliberate when the weapon was aimed at the city, when an inhumane weapon killed them wherever it was aimed, or when a point attack had the city centre within its explosion's full effect range. A city lost to a battle nearby is collateral.
Repeated use of one kind of weapon (chemical, tactical, strategic, biological) counts less: the recent uses of the
kind halve every RepeatHalfLife, and a new nuclear use counts 1 ÷ (1 + recent uses)^NuclearRepeatExponent, other
kinds 1 ÷ (1 + recent uses). Each deed is then multiplied: ×AtPeace 2 when the two are not at war, ×NoNukes 1.5
when the victim has no nuclear weapons, ×InKind 0.25 when the victim used that level on the doer first in this war,
×PariahVictim 0.25 when the victim is a pariah.
Examples with the shipped values:
- A 2 kt nuclear shell at an army at war: 0.25 × (2 ÷ 10)^0.5 ≈ 0.11.
- A 500 kt warhead at a missile silo at war: 0.5. The same warhead on a faction without nuclear weapons: 0.75.
- A second strategic warhead soon after: 0.5 ÷ 2^0.75 ≈ 0.30.
- A 10 Mt warhead: (10000 ÷ 500)^0.5 ≈ 4.5, capped at ×2: 1.0.
- A biological weapon (weight 2) on an army: 2 points of infamy, all of them atrocity.
Every deed also lowers the moods of the AI observers toward the doer: the points × the observer's Humanity
(§5) × its relation to the victim (RelationVictim 1 for the victim and its allies,
RelationBystander 0.4, RelationAttackerAlly 0.1 for the doer's allies; 0.1 also when the victim is an enemy of the
observer's that started the war or used nukes on it). The victim's own mood falls by the deliberate points ×
DeedVictim (1.5), whatever its Humanity. Deeds of one doer on one victim within IncidentInterval ticks make one
incident for the moods.
Stages¶
| Stage | From | What it means |
|---|---|---|
| Condemned | infamy CondemnedAt (1) |
Protests; no AI accepts a new partnership or alliance with it unless already allied; no AI courts it. |
| Sanctioned | while any faction sanctions it | See Sanctions. |
| Pariah | infamy PariahAt (6), until below PariahOffAt (5) |
Harsher economic sanctions (PariahRate); its AI partners announce they leave and go PariahLeaveTicks later; deeds on it count ×0.25; a war on it brings its partners no WarDeclaredOnPartner; ultimatums come at a milder mood (UltimatumMoodPariah). |
The STANDING tab of the diplomacy screen (Conquest) lists every faction's infamy, atrocity, stage, who sanctions it and what the sanctions cost.
Sanctions¶
A faction sanctioning another ends its cooperation agreements, contributions and aid to it, and the two trade no
technology, hardware or intelligence and make no agreements or aid either way, unless a deal lifts the sanctions.
With the match setting Economic Sanctions on, the target's production and science also fall by SanctionRate
(0.25) × the share of the world's production held by its sanctioners (PariahRate 0.4 for a pariah), and each
sanctioner's own by SanctionerRate (0.05) × the target's share. Off, sanctions still end ties and trade.
Sanctions start in four ways:
- For infamy: an AI not allied to a faction it dislikes (mood below 0) sanctions it from its personality's
SanctionAtand lifts the sanctions when the infamy falls belowSanctionLift(0.5) ×SanctionAt. - By choice: the player's Impose sanctions button on the deal screen, on until lifted.
- As a carried-out threat (§7): for
SanctionTermTicks(108000). - By deal: the deal item Sanction… (§6) sanctions a third faction for 10 to 60 minutes; Lift
sanctions ends them (those for infamy only for
SanctionTermTicks).
When sanctions start, the target's mood toward the sanctioner drops to SanctionedMood (−2); a bystander's mood
toward the sanctioner drops to SanctionBystanderMood when the target's infamy is below CondemnedAt. Sanctions
imposed again only renew what has faded.
Protests, demands and ultimatums¶
From an atrocity of 1 the AI that likes the doer least (mood below 0, not a pariah itself) protests, at most once
per ProtestGap: the mood falls both ways by Protest (−0.3), to at most ProtestMax.
From DemandAtrocity (3), an AI of Humanity DemandHumanity (0.5) or more at mood DemandMood (−2) or lower
demands that the doer spare civilians: the deal item Spare civilians, a promise of no strikes aimed at cities
and no inhumane weapons, on anyone, for SpareCiviliansLength (108000). A demand to a faction it sanctions already
comes with the threat to arm the doer's enemies.
An ultimatum is the same demand with war if it is refused. It comes from UltimatumAtrocity (6), or after a
demand was refused (by anyone's demand) or the promise broken, at mood UltimatumMood (−4) or lower, when the AI's
estimated chance to win that war is at least UltimatumWin (0.4), and while fewer than MaxAtrocityWars such wars
are fought on the doer. A war from it is a war for atrocities (WAR_ATROCITY).
A promise kept to its end lowers the atrocity to KeptAtrocity (5) and the infamy by as much. The gaps between
demands to one faction are DemandGapAI and DemandGapHuman.
4. Weapons and units that feed the diplomacy¶
Inhumane <weight> on an [EXPLOSION] marks an effect aimed at populations. A weapon with such an explosion is
an inhumane weapon, its weight the highest of its explosions'. Every use is a deliberate deed of that weight, and the
deaths it causes in cities count as deliberate wherever it was aimed. Not set: 2 for a biological explosion, 0
otherwise. The shipped data marks the biological explosions 2, the cobalt and salted fallout 1 and Gunfire_Massacre
(the Massacre Civilians weapon) 2. Inhumane 0 takes the mark off.
[EXPLOSION] "nuke_500_Cobalt"
Emulated "Units/Emulated/Fallout.txt"
Inhumane 1
Inhumane on a [MISSILE] overrides its explosions' weight (02).
The Explodopedia shows the weapon's row Inhumane weapon: Yes (infamy ×weight).
Chemical weapons are those with an explosion of Type Chemical (set, or worked out from a LastingEffect without
LastingDamage, 03). Unless marked inhumane they add ChemicalUse infamy and no
atrocity. A chemical explosion marked Inhumane counts as an inhumane weapon instead.
Nuclear use counts for the weapons in the Tactical and Strategic classes of AI/MissileCategoryMapping.txt
(08 §5), by the yield of one warhead (Kilotons of the explosion). A MIRV's
launch is one use. Weapons that can only hit missiles (interceptors) never count.
CovertOperative [f|Yes|No] on a [UNIT] marks a covert unit (spec-ops teams, bomb trucks). Destroyed by a
faction on that faction's own land, it is caught: the catcher learns its owner and may ask it for the promise to stop
covert operations (§6); at peace the catcher's mood toward the owner also falls by f (Yes:
CovertCaught 0.25), ×CovertCaughtNuclearFactor (3) with a nuclear weapon on board. Catches do not add up.
[UNIT] "Spec_Ops_Team"
CovertOperative 0.25
5. Personalities¶
At game start every AI faction draws one profile of AI/Personalities.txt by its Probability weight (with the
Aggressive AI setting by AggressiveProbability); a saved game keeps it by name. The shipped profiles are Cautious
(40), Balanced (40) and Rogue (20); Classic is the Aggressive AI setting's profile. The traits that shape diplomacy:
| Trait | In diplomacy | Shipped: Cautious / Balanced / Rogue |
|---|---|---|
Aggressiveness |
Attacks at a lower win probability; raises its friend bar (FriendMoodPerAggression). |
0.35 / 0.5 / 0.7 |
Greed |
How much better than even a deal must be (a margin of 0.5 × Greed in deal value) and what its counter-offers aim at. | 0 / 0.2 / 0.45 |
Bluff |
How readily it threatens what it will not carry out; a bluff called counts as a broken threat. | 0.05 / 0.25 / 0.6 |
Courtship |
How often and how generously it courts a wanted friend: cooperation, technology trades, gifts, a partnership. | 0.7 / 0.5 / 0.2 |
BetrayalPossibility |
It may attack a partner (never a permanent ally) when its win probability is above 1 − this. | 0.2 / 0.5 / 0.7 |
CovertDeceit |
The chance it promises to stop covert operations and goes on. | 0 / 0.25 / 0.8 |
SurpriseStrike |
The chance a war it would threaten starts at once by a decapitating strike. | 0 / 0.15 / 0.7 |
Humanity |
How much others' killing lowers its mood (§3); from 0.5 it demands that the killing stop. | 0.88 / 0.69 / 0.2 (defaults from the city restraint; Rogue's set) |
SanctionAt |
The infamy from which it sanctions a faction it dislikes. | 3.4 / 5.2 / 12 |
MassacreMood |
At this mood or below its armies massacre the civilians of an enemy city they occupy. | Never / −5 / −2 |
The nuclear, chemical and biological restraints decide when its own weapons are allowed, and so what its nuclear threats are worth. Defaults, formulas and the other traits: 08 §16.
The profile's name also picks the AI's words: a mood.lng line tagged Personality "Rogue" is said only by Rogue
AIs (§8).
Personality "Cautious"
Probability 40
Aggressiveness 0.35
Greed 0
Bluff 0.05
Courtship 0.7
6. Deal items¶
A deal lists what each side gives. The items, by their name on the deal screen and in data files (DiplomacyTime.txt,
tutorial scripts):
| Deal screen | Data name | What the giver does | Data that changes it |
|---|---|---|---|
| Ceasefire | CeaseFire |
Stops the war for a time, chosen on a slider from the minimum to 6 times it | CeasefireTimeout |
| Peace Treaty | PeaceTreaty |
No war for a time, from the minimum to 4 times it | PeaceTreatyTimeout |
| Partnership | Partnership |
Joins the other in an alliance | AllowAlliances; BecamePartners, PartnerCooldown…; condemned: refused |
| Permanent Alliance | Alliance |
Makes a partnership permanent | TimedPermanentAlliances, MinPartnershipTimeToPermanentAlliance, PermanentAlliance… |
| Cooperation | CooperationAgreement |
Shares production, intelligence, research, radar data or nuclear assets | CooperationRivalry…, AgreementReview…, AgreementCooldown… |
| Territory | Territory |
Gives a region | — |
| Technology | Technology |
Gives a technology | AllowTechnologyTrade, GiftTechFullPoints |
| Intel | Intelligence |
Shares its intelligence | — |
| Hardware | Hardware |
Gives units | — |
| War Involvement | War |
Declares war on a third faction | WAR_DEAL |
| Industry Contribution | Contributions |
Pays a share of production, obligatory for a minimum time | DealBroken when stopped early |
| Withdraw forces | WithdrawForces |
Takes its units off the other's land | — |
| Stop contributions | StopContributions |
Stops taking the contributions the other pays it | — |
| Aid | Aid |
5, 10 or 15 % of production, voluntary, stopped at any time | AidBonus, AidFullAt, ArmedUs…, ArmedOurEnemy…, StoppedAid… |
| Stop supporting | StopSupport |
Stops arming a faction at war with the other | RearmedClient… |
| Stop a war | StopWar |
Makes a ceasefire with a third faction | — |
| Keep fighting… | KeepFighting |
Promises to fight on with an enemy for 20 minutes (recorded, not enforced) | BrokePromise… |
| Stop covert operations | StopCovert |
No covert operations against the other; asked after a catch | CaughtMemory, PromiseLength, PromiseGrace (CovertOps.txt); CovertPromise… |
| Spare civilians | SpareCivilians |
No strikes aimed at cities, no inhumane weapons (Conquest) | SpareCiviliansLength, KeptAtrocity |
| Sanction… | Sanction |
Sanctions a third faction for 10 to 60 minutes (Conquest) | SanctionerRate, SanctionRate |
| Lift sanctions | LiftSanctions |
Lifts its sanctions on the other (Conquest) | SanctionTermTicks |
How an AI values each item is the game's own. Data reaches the valuation through the mood (OfferBiasPerPoint), the
personality (Greed, Courtship, the restraints) and the rules in the last column. A deal without a threat raises
both moods by Deal (0.25), goods alone by their value.
AI/DiplomacyTime.txt (not shipped) takes these data names, in game seconds:
TimeToSustainAccept
CeaseFire 300
Alliance 1200
TimeToSustainDecline
War 600
SpareCivilians 900
END
Tutorial scripts create offers with these names (13); event scripts declare war, ally and make ceasefires directly (16).
Match settings¶
In the map file or NewGameSettings.txt (09 §7, the lobby can change them):
CeasefireTimeout 36000
PeaceTreatyTimeout 90000
TimedPermanentAlliances No
AllowTechnologyTrade Yes
EconomicSanctions Yes
7. Threats¶
An offer may carry a threat if rejected, and the answer to a threatening offer may carry a counter-threat. The levels shown on the deal screen:
| Level | Carried out | Available when |
|---|---|---|
| Sanctions | The threatener sanctions the target for SanctionTermTicks |
Conquest; not sanctioning it already; with Economic Sanctions off, only with ties to end |
| War | War is declared | Not at war, no ceasefire or treaty running past the deadline |
| Limited nuclear strike | Nuclear strikes on its forces in that war | The no-nukes timer over by the deadline; nuclear weapons to threaten with |
| Total nuclear war | Nuclear strikes on its cities in that war | as above |
| Arm their enemies | Aid to a faction at war with the target | Not at war with it; someone at war with it to arm |
No threat is made against an ally, or before the peace timer ends. A threat refused and carried out is kept, one
refused and not carried out broken; nukes after a war threat, or cities after a limited one, exceed it
(ThreatExceeded…). Broken threats make a faction's later threats less believed; a personality's Bluff makes it
threaten without meaning it. A counter-threat takes a nuclear level, or sanctions for a faction with no nuclear answer.
Threat values are the game's own; data shapes them through the restraints and Bluff of Personalities.txt, the
mood rules for exceeded threats and attacks on those who gave in, and the match timers.
8. The AI's words: mood.lng¶
What an AI says is in Lang/<language>/mood.lng, by key, not by number:
"REPLY_TOO_LITTLE" LANG "Too little for what you ask."
"REPLY_TOO_LITTLE" LANG "Make it worth our while."
"REPLY_WINNING" Personality "Rogue" LANG "Why stop? We are winning."
CLEAR "REPLY_GRUDGE"
"REPLY_GRUDGE" LANG "Your crimes are not forgotten."
END
- Variants. A key given again is another variant; one is picked for each message and kept while it is shown.
- Personality tags.
"KEY" Personality "Name" LANG "text"is a variant for an AI of that profile (any name, also a mod's own personality). A personality with variants of its own for a key takes only those; any other speaker (a personality without them, a human player, an alliance in a vote) takes the untagged variants, the default, which every key should have. The tag goes before the text: a text ends at its line's end. CLEAR "KEY"drops the variants read so far, so a mod's lines replace the game's instead of joining them.%s. A text may hold one%s(two inREPLY_AGREEMENT_ENDED): the faction, region, threat or reason the line names. Keep the%swhere the game's line has one; no other%codes.- Labels.
MOOD_andWAR_keys are names, not speech: they show their first untagged variant only (the first one when all are tagged). - Fallback. A language without a key, or whose variants were all cleared, takes the English ones. A key with no English variant either shows its own name, e.g. REPLY_ALMOST, so a gap is easy to spot.
USE PREVIOUS "Lang/Eng/mood.lng"at the top of a mod's file keeps the game's lines;IFworks as in the other string files (12 §5).
The keys, by group (the game's Lang/Eng/mood.lng has every key with its English text):
| Group | Keys | Said when |
|---|---|---|
| Answers to an offer | REPLY_AGREED, REPLY_FAIR_DEAL, REPLY_GENEROUS, REPLY_GRATEFUL, REPLY_UNDER_PROTEST, REPLY_ALMOST, REPLY_TOO_LITTLE, REPLY_FAR_TOO_MUCH, REPLY_NOTHING_IN_RETURN, REPLY_NOT_GIVING, REPLY_GRUDGE, REPLY_NO_TRUST, REPLY_SURRENDER_LINE, REPLY_ALLIANCE_TOO_BIG, REPLY_TOO_STRONG, REPLY_ALLIANCE_AT_WAR |
it accepts, counters or refuses, with the main reason |
| War and peace | REPLY_WINNING, REPLY_WAR_GOES_ON, REPLY_CANNOT_WIN, REPLY_NO_CEASEFIRE, REPLY_KEEP_PEACE, REPLY_REAR_PEACE, REPLY_TAKE_WHAT_IS_OURS, REPLY_FORCES_ON_LAND, REPLY_PEACE_…, REPLY_WAR_DECLARED |
ceasefires, treaties, land, declarations |
| Threats | REPLY_THREAT_DEFIED, REPLY_THREAT_BLUFF, REPLY_THREAT_DETERRED, REPLY_THREAT_WEAK, REPLY_THREAT_NOT_DARE, REPLY_COUNTER_THREAT, REPLY_COUNTER_FIRED, REPLY_THREAT_WITHDRAWN |
refusing a threat, counter-threats |
| Friends and allies | REPLY_STAND_WITH_YOU, REPLY_HELP_US, REPLY_JOIN_US, REPLY_SHARED_THREAT, REPLY_TOGETHER, REPLY_COOPERATE, REPLY_EXCHANGE, REPLY_GESTURE, REPLY_GIFT, REPLY_ALLY_GESTURE, REPLY_ALLY_IN_KIND, REPLY_REPAY_HELP, REPLY_PERMANENT_OFFER, REPLY_LEAVE_SOON, REPLY_STAY, REPLY_POWER_WARNING, REPLY_POWER_LEAVING |
courtship, help, alliances |
| Aid and support | REPLY_STOP_ARMING, REPLY_LEAVE_IN_PEACE, REPLY_NO_MORE_CONTRIBUTIONS, REPLY_AID_… |
aid offered, ended or stopped |
| Lessons of a past war | REPLY_LESSON_FEAR, REPLY_LESSON_NUKED, REPLY_LESSON_REVENGE, REPLY_LESSON_REVENGE_UNNAMED, REPLY_LESSON_SPARED, REPLY_LESSON_CONTEMPT, REPLY_LESSON_FEAR_WAR |
an earlier war with the same faction colours the answer; shipped with Cautious and Rogue variants |
| Notices | REPLY_STRAY_WARNING, REPLY_STRAY_APOLOGY, REPLY_AGREEMENT_ENDED, REPLY_DEAL_BROKEN, REPLY_DEAL_BROKEN_WAR, REPLY_COVERT_CAUGHT, REPLY_COVERT_PROMISE_BROKEN |
events between the two |
| Isolation (Conquest) | REPLY_PROTEST, REPLY_SANCTIONS, REPLY_SANCTIONS_THREAT, REPLY_SANCTIONS_CHOICE, REPLY_SANCTIONS_LIFTED, REPLY_SANCTION_DEAL, REPLY_JOIN_SANCTIONS, REPLY_PARIAH_LEAVING, REPLY_PARIAH_LEFT, REPLY_PARIAH_STAY |
protests, sanctions, a pariah's partners |
| Why an agreement ends | ENDED_UNFAIR, ENDED_RELATIONS, ENDED_TRUST, ENDED_DATA |
the second %s of REPLY_AGREEMENT_ENDED |
| Why it voted no | VOTE_… (15 keys) |
alliance and Geneva votes |
| Mood causes | MOOD_… (41 keys) |
the relations panel and its history (§2) |
| Why a war started | WAR_DEMAND, WAR_ANSWER, WAR_UNITS_ON_LAND, WAR_INVASION, WAR_DEAL (%s the other party), WAR_PACT, WAR_SURPRISE, WAR_OWN_PLANS, WAR_DEAL_BROKEN, WAR_TAKE_BACK, WAR_REVENGE, WAR_PREEMPT, WAR_ATROCITY |
the %s of REPLY_WAR_DECLARED and the mood history |
The keys are fixed: a mod can reword them, add variants and personality wordings, but a new key is never said.
9. The diplomacy screen's own strings¶
The screen itself (lists, buttons, tabs, threat levels) uses numbered strings of Lang/<language>/UI.lng. A mod
rewords one with USE PREVIOUS "Lang/Eng/UI.lng" and a line with its number (12 §5).
| IDs | What |
|---|---|
| 3096–3100 | You give, You receive, Offer, Accept, Decline |
| 3101–3112 | The deal items from Ceasefire to Withdraw forces, in the order of §6 |
| 3258, 3530, 3536, 3538, 3630, 5117, 5192, 5606, 5607 | Stop contributions, Aid, Stop supporting, Stop a war, Keep fighting…, Stop covert operations, Spare civilians, Sanction…, Lift sanctions |
| 3113, 3115, 3117, 3118, 3540 | The threat levels: Sanctions, War, Limited nuclear strike, Total nuclear war, Arm their enemies |
| 3119–3127, 3150 | Threat if rejected, counter-threat, deadline lines |
| 3164, 3174, 3175, 3498, 5336 | Tabs: AGREEMENTS, ALLIANCE SETTINGS, GENEVA CONVENTION, RELATIONS, STANDING |
| 5194, 5201, 5337–5344 | Condemned, Pariah, the STANDING tab's columns |
| 5610–5612 | Impose sanctions, its tips |
10. Worked mini-mods¶
A forgiving personality¶
A new profile that rarely holds a grudge against killing elsewhere, sanctions late and courts friends, with its own
words. The mood's fading is one rule for everyone (HalfLifeAI), so the mod also makes the whole world forgive
faster.
MyMod/AI/Personalities.txt: the whole shipped file (it has no USE), plus before its END:
Personality "Forgiving"
Probability 20 // weights: 40 + 40 + 20 + 20, so one AI in six
Aggressiveness 0.4
Greed 0
Bluff 0
Courtship 0.8
BetrayalPossibility 0.1
CovertDeceit 0
Humanity 0.4
SanctionAt 10
MyMod/AI/Mood.txt: only the rules that change, the others keep their defaults:
HalfLifeAI 108000 // moods halve in 30 game minutes
WarDeclaredOnUs -1.5
RegionConqueredMax -2
SparedUs 2
PartnerCooldownMalus 2
END
MyMod/Lang/Eng/mood.lng: the profile's own wordings for a few keys; every other key it says in the default words:
USE PREVIOUS "Lang/Eng/mood.lng"
"REPLY_GRUDGE" Personality "Forgiving" LANG "What is past is past - but not this."
"REPLY_KEEP_PEACE" Personality "Forgiving" LANG "Enough blood. Let us keep the peace."
"REPLY_LESSON_REVENGE" Personality "Forgiving" LANG "%s was ours once. We would rather talk about it."
END
Check in the Cheats build: start a Conquest match, open the diplomacy screen and read the AIs' moods and causes; a Forgiving AI shows its own words on its refusals.
Harsher infamy for chemical weapons¶
Two ways, which can be combined.
Raise the price of chemical use, MyMod/AI/Infamy.txt:
ChemicalUse 0.3 // a use counts more than a 10 kt nuke
ChemicalUseCap 8 // chemical use alone can make a pariah (PariahAt 6)
END
Or make the chemical weapons inhumane: each use then is a deliberate deed (atrocity, so demands and ultimatums
follow), the deaths they cause in cities count three times wherever they were aimed, and there is no cap.
MyMod/Units/explosion.txt:
USE PREVIOUS "Units/explosion.txt"
[EXPLOSION] "Chemical_1" MODIFY
Inhumane 1
[EXPLOSION] "Chemical_2" MODIFY
Inhumane 1
[EXPLOSION] "Chemical_3" MODIFY
Inhumane 1
[EXPLOSION] "Chemical_4" MODIFY
Inhumane 1
The Explodopedia then shows the chemical weapons as inhumane. Both changes work in Conquest only. The AIs' own
readiness to use gas is their ChemicalRestraint (08 §16), which this mod
does not change.
New replies in mood.lng¶
More variety in refusals, a Rogue wording, one line replaced, and a German file that keeps the German lines:
MyMod/Lang/Eng/mood.lng:
USE PREVIOUS "Lang/Eng/mood.lng"
"REPLY_TOO_LITTLE" LANG "That is not even a start."
"REPLY_TOO_LITTLE" LANG "Add something worth our time."
"REPLY_TOO_LITTLE" Personality "Rogue" LANG "You insult us. Double it." // Rogue AIs: only this one
CLEAR "REPLY_THREAT_BLUFF"
"REPLY_THREAT_BLUFF" LANG "We have heard you bark before."
CLEAR "MOOD_PAST_RELATIONS"
"MOOD_PAST_RELATIONS" LANG "Old wounds"
END
MyMod/Lang/Ger/mood.lng, for German players to see the new refusals in German:
USE PREVIOUS "Lang/Ger/mood.lng"
"REPLY_TOO_LITTLE" LANG "Das ist nicht einmal ein Anfang."
END
Each language is looked up key by key: a key the language's file has is taken from it, only a key it lacks from
English. Without the German file, German players keep the game's German REPLY_TOO_LITTLE and never see the mod's
English variants of it.
11. Pitfalls¶
- A typo in
Mood.txtorInfamy.txtends the file. Every rule after the unknown name keeps its default. Read the warning at loading. Personalities.txtis a full copy. A mod file with only the new profile leaves only that profile: every AI gets it.- A personality's tagged lines replace its default lines for that key. Give a tagged personality as many variants as it needs, or none.
- Infamy and its rules are Conquest only. In other scoring modes the moods still work, the nuclear-use and deed
moods and everything in
Infamy.txtdo not. - Labels show one name. A
MOOD_orWAR_key shows only its first untagged variant (its first one when all are tagged); replace a label withCLEARand one line. - Keep the
%s. A line without the%sits key fills loses the name; a second%sor another%code breaks the text. - Saved moods stay. A changed rule applies to events after the game is loaded, not to moods already recorded.