Home › Dev CE (experimental) › TeamDiplomacy

Experimental: needs Dev CE (fork of the Community Extension, release zip and source). A GameCore that adds these Lua methods by calling engine functions directly. Not part of the upstream Community Extension, single-player testing only. Descriptions on these pages were written by an AI assistant from decompiled code and are marked inferred unless a test result confirms them.

TeamDiplomacy

62 methods (Dev CE test build). this is found with the game's own IPlayerDiplomacy instance resolver (virtual).

Method Signature Purpose (AI-written, inferred) Tested Engine function Current
AddBannedDiploActionsSpecificCivilizations TeamDiplomacy:AddBannedDiploActionsSpecificCivilizations(eAction: integer, eCiv: integer) Appends an (action, civilization) pair to the list at Diplomacy+0x1fb8 banning that diplomatic action towards the civilization. plumbing ✓
this ✓ (oracle)
— 0x29dfe0
AddDiploActionPrereqOverride TeamDiplomacy:AddDiploActionPrereqOverride(eAction: integer, eCivic: integer, eTech: integer) Appends an (action, civic, tech) triple to the list at Diplomacy+0x1f88 overriding the prerequisite for a diplomatic action. plumbing ✓
this ✓ (oracle)
— 0x29e030
AddDiplomaticCombatModifier TeamDiplomacy:AddDiplomaticCombatModifier(eSource: integer, iTurnsActive: integer, iCombatBonus: integer, bReligiousOnly: boolean) Appends a 16-byte entry (source, turns active, combat bonus, religious-only flag) to the list at Diplomacy+0x1f58. plumbing ✓
this ✓ (oracle)
— 0x29e090
AddDiplomaticMovementModifier TeamDiplomacy:AddDiplomaticMovementModifier(eSource: integer, iTurnsActive: integer, iExtraMoves: integer) Appends an entry (source, turns active, extra moves) to the player's diplomatic movement modifier list. plumbing ✓
this ✓ (oracle)
— 0x29e0f0
AddDiplomaticYieldModifier TeamDiplomacy:AddDiplomaticYieldModifier(eSource: integer, iTurnsActive: integer, eYield: integer, iYieldModifier: integer, bStackWithOtherDiploYieldModifiers: boolean) Appends an entry (source, turns active, yield type, modifier, stacking flag) to the diplomatic yield modifier list. plumbing ✓
this ✓ (oracle)
— 0x29e150
AddDynamicVisibility TeamDiplomacy:AddDynamicVisibility(iValue: integer, eSource: integer, eSourceType: integer) Appends an entry (value, visibility source, source type) to the dynamic diplomatic visibility list. plumbing ✓
this ✓ (oracle)
— 0x29e1c0
AddEspionageIncursion TeamDiplomacy:AddEspionageIncursion(eOtherPlayer: integer) Records an espionage incursion promise-breach against another player when the two are not at war and signals listeners. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::AddEspionageIncursion 0x29e220
AddIncursionData TeamDiplomacy:AddIncursionData(eOtherPlayer: integer, ePromiseType: integer, iTurnMade: integer) Appends an incursion record (turn number) to the per-other-player, per-promise-type incursion list stored in the diplomacy state, creating map entries as needed. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::AddIncursionData 0x29e2a0
AddPromiseData TeamDiplomacy:AddPromiseData(eOtherPlayer: integer, ePromiseType: integer, iTurnPromiseMade: integer, bPromiseSkipped: boolean) Records a promise of a given type made to another player, creating the per-player promise map entry if absent and storing turn made and skipped flag; decompilation is truncated after building the new entry. plumbing ✓
this ✓ (oracle)
— 0x29e5e0
ApplyWarWeariness TeamDiplomacy:ApplyWarWeariness() Per-turn war weariness pass: builds lists of other alive players (at war vs not) that this player has weariness toward, sorts them, then applies effects using amenity and district lookups; decompilation is truncated. plumbing ✓
this ✓ (oracle)
— 0x29eb40
CalculateYieldPerDelegation TeamDiplomacy:CalculateYieldPerDelegation(eYield: integer) → number Computes yield per delegation: looks up a yield definition value, indexes a per-type array in the player, and multiplies it by the number of other players with a delegation flag toward this player. plumbing ✓
this ✓ (oracle)
— 0x29ffa0
CalculateYieldPerEmbassy TeamDiplomacy:CalculateYieldPerEmbassy(eYield: integer) → number Computes yield per embassy: per-type base value times the number of other players with an embassy flag toward this player. plumbing ✓
this ✓ (oracle)
— 0x2a0090
CanLiberateCityTo TeamDiplomacy:CanLiberateCityTo(ePlayer: integer) → boolean Checks whether this player may liberate a city to ePlayer: not self, not at war with them, target must be major or minor, and in play-by-cloud a human target must be active. plumbing ✓
this ✓ (oracle)
— 0x2a0bf0
ChangeAlliancePointsWithPlayer TeamDiplomacy:ChangeAlliancePointsWithPlayer(otherPlayer: integer, xChange: integer) Adds a delta to the alliance points stored for another player. plumbing ✓
this ✓ (oracle)
— 0x2a0f30
ChangeYieldPerDelegation TeamDiplomacy:ChangeYieldPerDelegation(iAmount: integer, eYield: integer) Sets the yield received per delegation for a given yield type. Despite the 'Change' name, the value is assigned, not added. plumbing ✓
ran ±1, reversible ✓, no visible effect
this ✓ (oracle)
Player::Diplomacy::ChangeYieldPerDelegation 0x2a1060
ChangeYieldPerEmbassy TeamDiplomacy:ChangeYieldPerEmbassy(iAmount: integer, eYield: integer) Sets the yield received per embassy for a given yield type. Despite the 'Change' name, the value is assigned, not added. plumbing ✓
ran ±1, reversible ✓, no visible effect
this ✓ (oracle)
Player::Diplomacy::ChangeYieldPerEmbassy 0x2a10e0
ClearLastPromiseData TeamDiplomacy:ClearLastPromiseData(eOtherPlayer: integer) Empties the promise vector for the given player in the last-promise map by resetting its end pointer to its begin. plumbing ✓
this ✓ (oracle)
— 0x2a1660
DoTurn TeamDiplomacy:DoTurn() Per-turn diplomacy update: updates the diplomacy blackboard, decays and applies war weariness, expires stale per-player entries (dispatching a signal), sends queued kudos or warnings, then updates available casus belli. plumbing ✓
this ✓ (oracle)
— 0x2a4440
DoWarWearinessDecay TeamDiplomacy:DoWarWearinessDecay() For each other met player with positive weariness, decays war weariness by an at-war or at-peace amount. plumbing ✓
this ✓ (oracle)
— 0x2a4670
GetAlliancePointsWithPlayer TeamDiplomacy:GetAlliancePointsWithPlayer(otherPlayer: integer) → number Returns the stored alliance points for another player, or 0 if the index is out of range. plumbing ✓
this ✓ (oracle)
— 0x2a4f60
GetAllianceTurnsUntilEnd TeamDiplomacy:GetAllianceTurnsUntilEnd(otherPlayer: integer) → number Computes turns until the alliance with a player ends: declared alliance turn minus (current turn minus game-speed adjusted alliance duration). plumbing ✓
this ✓ (oracle)
— 0x2a4f90
GetAllianceType TeamDiplomacy:GetAllianceType(ePlayer: integer) → number Returns the alliance type between this player and another from the diplomatic relations table. plumbing ✓
this ✓ (oracle)
— 0x2a5010
GetCultureFromAlliances TeamDiplomacy:GetCultureFromAlliances() → number Returns culture bonus from an alliance: finds the player with a specific alliance type and sums that player's city culture yields times a stored percentage; result is written through a hidden return pointer. plumbing ✓
this ✓ (oracle)
— 0x2a51d0
GetCurrentDiplomaticCombatModifier TeamDiplomacy:GetCurrentDiplomaticCombatModifier(bReligiousCombat: boolean) → number Sums combat modifiers from the combat modifier list whose entries match the religious-combat flag and whose source timer is still active. plumbing ✓
this ✓ (oracle)
— 0x2a52d0
GetCurrentDiplomaticYieldModifier TeamDiplomacy:GetCurrentDiplomaticYieldModifier(eYield: integer) → number Returns the active diplomatic yield modifier for a yield: stacking entries are summed, non-stacking entries contribute only the maximum. plumbing ✓
this ✓ (oracle)
— 0x2a5550
GetFaithBonusFromAlliances TeamDiplomacy:GetFaithBonusFromAlliances() → number Returns faith bonus from an alliance: for the ally of a specific type, multiplies a stored value by the follower count of that ally's founded religion across this player's cities. plumbing ✓
this ✓ (oracle)
— 0x2a5880
GetGrievancesFromPlayer TeamDiplomacy:GetGrievancesFromPlayer(ePlayer: integer) → number Returns the grievance score between this player and the given player from the diplomatic relations table. plumbing ✓
this ✓ (oracle)
— 0x2a5950
GetMetEra TeamDiplomacy:GetMetEra(ePlayer: integer) → number Returns the era in which this player met another, or -1 if invalid, self or no entry. plumbing ✓
this ✓ (oracle)
— 0x2a5fd0
GetNumAlliances TeamDiplomacy:GetNumAlliances() → number Counts other players in the major list with which this player has any alliance type. plumbing ✓
this ✓ (oracle)
— 0x2a60a0
GetNumGossipReports TeamDiplomacy:GetNumGossipReports(ePlayer: integer, eGossipType: integer) → number Returns the number of gossip reports of a type about a player from the nested map; 0 if not found. plumbing ✓
this ✓ (oracle)
— 0x2a6130
GetNumMajorsMet TeamDiplomacy:GetNumMajorsMet() → number Counts other valid major players that this player has met. plumbing ✓
this ✓ (oracle)
— 0x2a61f0
GetNumMinorsMet TeamDiplomacy:GetNumMinorsMet() → number Counts other valid minor players that this player has met. plumbing ✓
this ✓ (oracle)
— 0x2a62e0
GetPlayerWithAllianceType TeamDiplomacy:GetPlayerWithAllianceType(eAlliance: integer) → number Returns the first other player in the major list that shares the given alliance type with this player, or -1. plumbing ✓
this ✓ (oracle)
— 0x2a63d0
GetScienceMultiplierFromAlliances TeamDiplomacy:GetScienceMultiplierFromAlliances() → number Returns a science multiplier from an alliance: if the ally and this player share, or one has already researched, the other's current research, returns the stored value, else 0. plumbing ✓
this ✓ (oracle)
— 0x2a6570
GetTourismFromAlliances TeamDiplomacy:GetTourismFromAlliances() → number Returns tourism from an alliance: sums the ally's city tourism times a stored percentage. plumbing ✓
this ✓ (oracle)
— 0x2a6690
GetTurnsSinceOpenBordersEnded TeamDiplomacy:GetTurnsSinceOpenBordersEnded(ePlayer: integer) → number Returns turns since open borders with a player ended: 0 if currently open, -1 if never ended, else current turn minus end turn. plumbing ✓
this ✓ (oracle)
— 0x2a6790
HasActiveDOWOnMinor TeamDiplomacy:HasActiveDOWOnMinor() → boolean Returns true if this player is at war with any valid minor-type player (not barbarian, major or free cities). plumbing ✓
this ✓ (oracle)
— 0x2a67f0
HasConqueredMinor TeamDiplomacy:HasConqueredMinor() → boolean Returns true if any of this player's cities has a different original owner that is neither major nor barbarian. plumbing ✓
this ✓ (oracle)
— 0x2a6980
HasPermanentAlliance TeamDiplomacy:HasPermanentAlliance(ePlayer: integer) → boolean Returns whether this player is permanently allied with the given player. plumbing ✓
this ✓ (oracle)
— 0x2a6f60
IncrementGossipReports TeamDiplomacy:IncrementGossipReports(ePlayer: integer, eGossipType: integer) Increments the gossip report counter of a type for a player in the nested map, inserting a new entry if the type is missing; the decompilation of the no-player-entry path only calls IsMajor. plumbing ✓
this ✓ (oracle)
— 0x2a6fa0
IsAtWarWithAnyMajorCiv TeamDiplomacy:IsAtWarWithAnyMajorCiv() → boolean Returns true if this player is at war with any valid alive major player. plumbing ✓
this ✓ (oracle)
— 0x2a8740
IsEnforcingBorders TeamDiplomacy:IsEnforcingBorders(ePlayer: integer) → boolean Returns whether this player enforces borders against another: false if the other has open borders from this player, otherwise a flag in the other's diplomacy data. plumbing ✓
this ✓ (oracle)
— 0x2a9b00
IsJointWarTypeAllowed TeamDiplomacy:IsJointWarTypeAllowed(eSharedWarType: integer, ePartner: integer, eOpponent: integer) → boolean Checks whether a joint war of the given type with a partner against an opponent is allowed; both must be alive majors, then declare-war action validity is checked for this player or the partner by war type hash. Decompilation is truncated. plumbing ✓
this ✓ (oracle)
— 0x2a9c50
IsOccupyingOriginalCapital TeamDiplomacy:IsOccupyingOriginalCapital(ePlayer: integer) → boolean Returns true if any of this player's cities is an original capital whose original owner is the given player. plumbing ✓
this ✓ (oracle)
— 0x2aa1a0
IsThirdPartyWarTypeAllowed TeamDiplomacy:IsThirdPartyWarTypeAllowed(eSharedWarType: integer, ePartner: integer, eOpponent: integer) → boolean Checks whether a third-party war type is allowed against an opponent: both majors and alive, true if the existing war type matches, else validity of the matching declare-war diplomatic action for this player. plumbing ✓
this ✓ (oracle)
— 0x2aa410
RemoveBannedDiploActionsSpecificCivilizations TeamDiplomacy:RemoveBannedDiploActionsSpecificCivilizations(eAction: integer, eCiv: integer) Removes all matching (action, civilization) entries from the banned diplomatic actions list by copying the vector, clearing it and re-adding non-matching entries. plumbing ✓
this ✓ (oracle)
— 0x2adf40
RemoveDiplomaticYieldModifier TeamDiplomacy:RemoveDiplomaticYieldModifier(eSource: integer, iTurnsActive: integer, eYield: integer, iYieldModifier: integer, bStackWithOtherDiploYieldModifiers: boolean) Removes all entries exactly matching (source, turns active, yield, modifier, stacking flag) from the diplomatic yield modifier list by copy, clear and re-add. plumbing ✓
this ✓ (oracle)
— 0x2ae020
ResetDenouncement TeamDiplomacy:ResetDenouncement(ePlayer: integer) Clears the recorded denouncement turn for the given player by setting its entry in the per-player denounce-turn map (offset 0x6a0) to -1. plumbing ✓
this ✓ (oracle)
— 0x2af4f0
ResetOccupiedCities TeamDiplomacy:ResetOccupiedCities(eOpponent: integer) Loops over all cities of the owning player and clears the occupied flag on each occupied city whose stored player field (city+0x220) equals the given opponent. plumbing ✓
this ✓ (oracle)
— 0x2af520
SetBlockedEntry TeamDiplomacy:SetBlockedEntry(eUnit: integer, bNewValue: boolean) Sets whether this player blocks entry of a given unit type (open borders style restriction) and, when blocking, expels other players' units from the territory with notifications. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetBlockedEntry 0x2af7e0
SetCanEnforceBorders TeamDiplomacy:SetCanEnforceBorders(bNewValue: boolean) Toggles whether this player may enforce its borders (expel foreign units from its territory). When changed, it expels units of other alive players from this player's territory and notifies them. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetCanEnforceBorders 0x2af9f0
SetFightingJointWar TeamDiplomacy:SetFightingJointWar(target: integer, partner: integer) Records in the global diplomatic relations that this player is fighting a joint war against a target alongside a partner. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetFightingJointWar 0x2afc50
SetHadFriendlyMeeting TeamDiplomacy:SetHadFriendlyMeeting(ePlayer: integer, bNewValue: boolean) Sets the per-player flag (array at offset 0x378) recording whether a friendly meeting with that player occurred. plumbing ✓
this ✓ (oracle)
— 0x2afca0
SetHasDefensivePact TeamDiplomacy:SetHasDefensivePact(ePlayer: integer, bNewValue: boolean) Sets whether this player has a defensive pact with another player in the global diplomatic relations. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetHasDefensivePact 0x2aff30
SetHasDenounced TeamDiplomacy:SetHasDenounced(ePlayer: integer, bNewValue: boolean) Records the current game turn as the denouncement turn for the given player, dispatches a game signal, and applies a denouncement grievance from this player onto the target player's diplomacy. plumbing ✓
this ✓ (oracle)
— 0x2b0040
SetHasOpenBordersFrom TeamDiplomacy:SetHasOpenBordersFrom(ePlayer: integer, bNewValue: boolean) Adds or removes one open-borders agreement from a given player toward this player, tracked as a counter. When the count hits zero it records the turn and expels units; when it becomes 1 it fires a signal. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetHasOpenBordersFrom 0x2b0360
SetLastTurnOfferedDeal TeamDiplomacy:SetLastTurnOfferedDeal(ePlayer: integer, iTurn: integer) Stores the turn on which this player last offered a deal to the given player. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetLastTurnOfferedDeal 0x2b04b0
SetOccupyingOriginalCity TeamDiplomacy:SetOccupyingOriginalCity(ePlayer: integer, bNewValue: boolean) Sets a flag recording whether this player occupies an original (capital) city of another player. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetOccupyingOriginalCity 0x2b04e0
SetResearchAgreementTech TeamDiplomacy:SetResearchAgreementTech(ePlayer: integer, eTech: integer) Records which technology a research agreement between this player and another targets. plumbing ✓
this ✓ (oracle)
Player::Diplomacy::SetResearchAgreementTech 0x2b0560
UpdateAvailableCasusBelli TeamDiplomacy:UpdateAvailableCasusBelli() Recomputes which colonial-war casus belli options are available against each met, living player and sends notifications for newly available ones. Decompilation is truncated, so the later part is not visible. plumbing ✓
this ✓ (oracle)
— 0x2b0800
UpdateIncursionData TeamDiplomacy:UpdateIncursionData() Prunes the incursion record map (offset 0x2bc8): removes entries older than a per-type turn limit (50 turns for most types, -1 for one type). plumbing ✓
this ✓ (oracle)
— 0x2b1870
UpdatePromise TeamDiplomacy:UpdatePromise(eOtherPlayer: integer, ePromiseType: integer) Looks up the promise record of the given player and promise type and, if it is older than a limit (5 turns for one type, 0 for others), calls BreakPromise. plumbing ✓
this ✓ (oracle)
— 0x2b19b0

Details

AddBannedDiploActionsSpecificCivilizations

Arguments: eAction — diplomatic action to ban; eCiv — civilization it is banned against

Writes - entry appended to list at Diplomacy+0x1fb8

Input checks: No validation or duplicate check.

Multiplayer: may-desync, edits synchronised diplomacy data. Risk: medium (alters allowed diplomatic actions). Confidence of the reading: medium.

AddDiploActionPrereqOverride

Arguments: eAction — diplomatic action; eCivic — civic that satisfies the prerequisite (inferred); eTech — tech that satisfies the prerequisite (inferred)

Writes - entry appended to list at Diplomacy+0x1f88

Input checks: No validation.

Multiplayer: may-desync, edits synchronised diplomacy data. Risk: medium (alters action prerequisites). Confidence of the reading: medium.

AddDiplomaticCombatModifier

Arguments: eSource — diplomatic yield source of the bonus; iTurnsActive — duration in turns (inferred); iCombatBonus — combat strength bonus (inferred); bReligiousOnly — applies only to religious combat (inferred)

Writes - entry appended to list at Diplomacy+0x1f58

Input checks: No validation.

Multiplayer: may-desync, edits synchronised diplomacy data. Risk: medium (alters combat bonuses). Confidence of the reading: medium.

AddDiplomaticMovementModifier

Arguments: eSource — diplomatic source enum stored in the entry; iTurnsActive — turn value stored in the entry (likely start turn or duration) (inferred); iExtraMoves — extra movement stored in the entry (inferred)

Writes - vector at this+0x1f28 (12-byte entries appended)

Input checks: No range checks on any argument.

Multiplayer: may-desync, writes synced player diplomacy state. Risk: medium (unvalidated push into a synced list). Confidence of the reading: medium.

AddDiplomaticYieldModifier

Arguments: eSource — diplomatic source enum stored in entry; iTurnsActive — turn value stored in entry (inferred); eYield — yield type the modifier applies to; iYieldModifier — modifier amount stored in entry; bStackWithOtherDiploYieldModifiers — stacking flag stored in entry (getter sums stacking entries, takes max of others)

Writes - vector at this+0x1ef8 (20-byte entries appended)

Input checks: No range checks; duplicates are allowed.

Multiplayer: may-desync, writes synced player diplomacy state. Risk: medium (unvalidated push into a synced list). Confidence of the reading: high.

AddDynamicVisibility

Arguments: iValue — visibility amount stored in entry (inferred); eSource — visibility source enum stored in entry; eSourceType — source type enum stored in entry

Writes - vector at this+0x348 (12-byte entries appended)

Input checks: No range checks.

Multiplayer: may-desync, writes synced player diplomacy state. Risk: medium (unvalidated push into a synced list). Confidence of the reading: medium.

AddEspionageIncursion

Arguments: eOtherPlayer — player whose territory was spied in

Writes - incursion record via AddIncursionData (type hash 0xc298a89c, current turn)

Side effects - AddIncursionData call - signal at game signal table +0xf00 with owner and other player objects

Input checks: Does nothing when at war; other player id used unchecked as array index for the signal.

Preconditions - game thread - valid player id

Multiplayer: may-desync: diplomatic record. Risk: low (records memory only). Confidence of the reading: medium.

Verified from the code - skips if IsAtWarWith - calls AddIncursionData with constant 0xc298a89c - dispatches signal

Inferred - 0xc298a89c is the espionage promise type hash

Open questions - precise meaning of the promise hash

AddIncursionData

Arguments: eOtherPlayer — other player involved; ePromiseType — promise type that was broken; iTurnMade — turn the incursion occurred

Writes - nested map player -> promise type -> list of turns at this+0x2bc8

Side effects - memory allocation for new map entries

Input checks: None on player id or promise type; creates entries for any value.

Preconditions - game thread

Multiplayer: may-desync: synced diplomacy memory. Risk: low (append-only log). Confidence of the reading: medium.

Verified from the code - searches player map then promise map - appends a 4-byte turn value to the list - creates new entries when missing

Inferred - IncursionData holds just the turn number

Open questions - container details are noisy in decompile

AddPromiseData

Arguments: eOtherPlayer — player the promise concerns (map key); ePromiseType — promise type key in the inner map; iTurnPromiseMade — turn stored in the PromiseData; bPromiseSkipped — skipped flag stored in PromiseData

Writes - promise map at this+0x2b48 (per player, per promise type PromiseData)

Side effects - later effects unknown because decompilation is truncated

Input checks: No explicit range check on eOtherPlayer is visible.

Multiplayer: may-desync, writes synced promise map. Risk: medium (writes synced state; output truncated). Confidence of the reading: low.

ApplyWarWeariness

Writes - field at this+0x1c80 (count reset to 0) - war weariness related state (43 writes counted)

Side effects - may change city amenity or district related values via Economic and Districts calls

Input checks: Skips self and invalid or dead players; no argument to validate.

Multiplayer: may-desync, modifies player/city state each turn. Risk: high (large turn-processing routine, truncated). Confidence of the reading: low.

CalculateYieldPerDelegation

Arguments: eYield — yield type used for the definition lookup; -1 gives 0

Input checks: Returns 0 for eYield == -1 and for non-positive base value; array index is range-checked.

Multiplayer: read-only, reads player flags only. Risk: low (pure getter). Confidence of the reading: medium.

CalculateYieldPerEmbassy

Arguments: eYield — yield type used for the lookup; -1 gives 0

Input checks: Returns 0 for eYield == -1 or non-positive base; array index range-checked.

Multiplayer: read-only, reads player flags only. Risk: low (pure getter). Confidence of the reading: medium.

CanLiberateCityTo

Arguments: ePlayer — candidate player to receive the city

Input checks: Rejects self, at-war valid players and non major/minor players; player pointer not null-checked before the major/minor test.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

ChangeAlliancePointsWithPlayer

Arguments: otherPlayer — index into the alliance points array; xChange — signed amount added to the points

Writes - alliance points array at this+0x20d8 (element otherPlayer)

Input checks: Checks otherPlayer is below array size; overflow and sign of xChange not checked.

Multiplayer: may-desync, writes synced alliance points. Risk: medium (simple bounded write to synced state). Confidence of the reading: high.

ChangeYieldPerDelegation

Arguments: iAmount — value stored for that yield; eYield — yield type

Writes - int array element indexed by the yield definition's index in the array at this+0x10d0; if the index is out of range, a fallback/default field at offset 0x18 of the array object is written instead

Side effects - none

Input checks: Yield -1 returns silently. Out-of-range definition index falls back to writing the default slot rather than crashing. A null Find result would crash (not checked).

Preconditions - valid yield type

Multiplayer: may-desync: player state mutation; must run identically on all clients. Risk: low (bounds-checked assignment; semantic mismatch with name). Confidence of the reading: medium.

Verified from the code - parameter is assigned, not accumulated - uses yield definitions Find to get an index at +0x14 - index checked against array size

Inferred - Ghidra labels the Find result as Government due to template folding; it is really a Yield definition - the +0x18 field is a default/overflow value

Open questions - real semantics of the fallback write - Lua object for Player Diplomacy is not listed (DiplomacyManager unclear)

ChangeYieldPerEmbassy

Arguments: iAmount — value stored for that yield; eYield — yield type

Writes - int array element for the yield in the array at this+0x1100; out-of-range falls back to a default field at offset 0x18

Side effects - none

Input checks: Yield -1 returns silently. Index bounds-checked, fallback write otherwise.

Preconditions - valid yield type

Multiplayer: may-desync: player state mutation; must run identically on all clients. Risk: low (bounds-checked assignment; semantic mismatch with name). Confidence of the reading: medium.

Verified from the code - same structure as ChangeYieldPerDelegation but array at this+0x1100 - assigns rather than adds

Inferred - Find template mislabelled as Government

Open questions - fallback field meaning - Lua object

ClearLastPromiseData

Arguments: eOtherPlayer — player key in the last-promise map

Writes - entry in map at this+0x2b88 (end pointer reset)

Input checks: Does nothing if the player has no entry.

Multiplayer: may-desync, writes synced promise data. Risk: medium (writes synced state). Confidence of the reading: medium.

DoTurn

Writes - blackboard at this+0x12b0 - per-player timers at this+0x6a0 (reset to -1 when expired) - pending kudo/warning list at this+0x2b20 (cleared) - war weariness and casus belli state via callees

Side effects - dispatches a game signal for expired players - calls SendKudoTo / SendWarningTo for queued items - calls UpdateAvailableCasusBelli

Input checks: No parameters; iterates all players.

Multiplayer: may-desync, main per-turn diplomacy state update. Risk: high (runs many synced state changes). Confidence of the reading: medium.

DoWarWearinessDecay

Writes - war weariness values via ChangeWarWearinessFrom

Side effects - calls ChangeWarWearinessFrom with reasons At War Decay or At Peace Decay

Input checks: Skips self, unmet and invalid players; only decays when the weariness entry is positive.

Multiplayer: may-desync, changes synced weariness values. Risk: medium (modifies synced state). Confidence of the reading: high.

GetAlliancePointsWithPlayer

Arguments: otherPlayer — index into alliance points array

Input checks: Bounds checked against array size.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetAllianceTurnsUntilEnd

Arguments: otherPlayer — ally whose declaration turn is looked up

Input checks: No validation of the player or that an alliance exists.

Multiplayer: read-only, uses current turn and relations table. Risk: low (pure getter). Confidence of the reading: high.

GetAllianceType

Arguments: ePlayer — other player

Input checks: None here; delegated.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetCultureFromAlliances

Input checks: Checks ally exists and stored percentage is non-zero.

Multiplayer: read-only, result written to return buffer. Risk: low (pure getter). Confidence of the reading: high.

GetCurrentDiplomaticCombatModifier

Arguments: bReligiousCombat — only entries with matching religious flag are counted

Input checks: No validation.

Multiplayer: read-only, uses current turn. Risk: low (pure getter). Confidence of the reading: high.

GetCurrentDiplomaticYieldModifier

Arguments: eYield — yield type to match

Input checks: No validation; entries with inactive or expired source timers are skipped.

Multiplayer: read-only, uses current turn. Risk: low (pure getter). Confidence of the reading: high.

GetFaithBonusFromAlliances

Input checks: Checks ally exists, value non-zero and religion created.

Multiplayer: read-only, result written to return buffer. Risk: low (pure getter). Confidence of the reading: high.

GetGrievancesFromPlayer

Arguments: ePlayer — other player in the grievance pair

Input checks: None here; delegated.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetMetEra

Arguments: ePlayer — other player

Input checks: Checks player index below 0x41, alive-map entry, and not self.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetNumAlliances

Input checks: Skips self.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetNumGossipReports

Arguments: ePlayer — player key of the gossip map; eGossipType — gossip type key in the inner map

Input checks: Returns 0 on missing keys.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetNumMajorsMet

Input checks: Skips self and invalid players.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetNumMinorsMet

Input checks: Skips self and invalid players.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetPlayerWithAllianceType

Arguments: eAlliance — alliance type to look for

Input checks: Skips self; no check on eAlliance.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

GetScienceMultiplierFromAlliances

Input checks: Checks ally exists, stored value non-zero and player valid.

Multiplayer: read-only, result written to return buffer. Risk: low (pure getter). Confidence of the reading: high.

GetTourismFromAlliances

Input checks: Checks ally exists and percentage non-zero.

Multiplayer: read-only, result written to return buffer. Risk: low (pure getter). Confidence of the reading: high.

GetTurnsSinceOpenBordersEnded

Arguments: ePlayer — index into per-player arrays

Input checks: No bounds check on ePlayer.

Multiplayer: read-only, uses current turn. Risk: low (pure getter). Confidence of the reading: high.

HasActiveDOWOnMinor

Input checks: Skips self and invalid players.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

HasConqueredMinor

Input checks: None.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

HasPermanentAlliance

Arguments: ePlayer — other player

Input checks: None here; delegated.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

IncrementGossipReports

Arguments: ePlayer — player key; eGossipType — gossip type key

Writes - gossip map at this+0x308 (counter incremented or inserted)

Input checks: When the player has no map entry the shown code validates the player and calls IsMajor but writes nothing.

Multiplayer: may-desync, writes synced gossip counters. Risk: medium (writes synced state). Confidence of the reading: medium.

IsAtWarWithAnyMajorCiv

Input checks: Skips self and invalid players.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

IsEnforcingBorders

Arguments: ePlayer — other player

Input checks: No validity check on ePlayer.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

IsJointWarTypeAllowed

Arguments: eSharedWarType — war type hash being checked; ePartner — joint-war partner; eOpponent — target of the war

Input checks: Null-checks both players, requires majors and alive flag, rejects one war type hash.

Multiplayer: read-only, reads state only. Risk: low (pure getter). Confidence of the reading: low.

IsOccupyingOriginalCapital

Arguments: ePlayer — original owner to test

Input checks: None.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

IsThirdPartyWarTypeAllowed

Arguments: eSharedWarType — war type hash being checked; ePartner — partner player; eOpponent — opponent player

Input checks: Null-checks players, requires majors alive, rejects one war type hash.

Multiplayer: read-only, reads game state only. Risk: low (pure getter). Confidence of the reading: high.

RemoveBannedDiploActionsSpecificCivilizations

Arguments: eAction — diplomatic action to unban; eCiv — civilization for which the ban is removed

Writes - banned action vector at this+0x1fb8 (rebuilt)

Input checks: No validation; no-op if not present.

Multiplayer: may-desync, writes synced ban list. Risk: medium (writes synced state). Confidence of the reading: high.

RemoveDiplomaticYieldModifier

Arguments: eSource — source to match; iTurnsActive — turn value to match; eYield — yield to match; iYieldModifier — modifier to match; bStackWithOtherDiploYieldModifiers — stacking flag to match

Writes - yield modifier vector at this+0x1ef8 (rebuilt)

Input checks: No validation; no-op if nothing matches.

Multiplayer: may-desync, writes synced list. Risk: medium (writes synced state). Confidence of the reading: high.

ResetDenouncement

Arguments: ePlayer — player whose denouncement record is cleared

Writes - per-player denouncement turn entry at this+0x6a0 set to -1

Input checks: Skips if ePlayer is -1; no upper range check on the index.

Multiplayer: may-desync, writes synced diplomacy variable. Risk: medium (unchecked array index, synced state). Confidence of the reading: high.

ResetOccupiedCities

Arguments: eOpponent — player whose occupied cities (by that city field) are freed

Writes - city occupied flag cleared via SetOccupied(false)

Side effects - City::Instance::SetOccupied may trigger its own updates

Input checks: No validation of eOpponent.

Multiplayer: may-desync, modifies city state. Risk: medium (changes city occupation state). Confidence of the reading: medium.

SetBlockedEntry

Arguments: eUnit — unit type index into the blocked-entry array; bNewValue — whether entry is blocked

Writes - blocked-entry byte array at this+0x2c08, indexed by unit type

Side effects - ExpelFromTerritory for every other active player (reason 7) - two localized Reporting::Notification::Send per player that was expelled

Input checks: Unit index is used unchecked as array index (crash risk on bad value); no player checks.

Preconditions - game thread - valid unit type index

Multiplayer: may-desync: edits synced array and expels units. Risk: medium (unchecked array index plus unit expulsion). Confidence of the reading: medium.

Verified from the code - writes byte at array[eUnit] unchecked - only expels when bNewValue is true - skips the owner and inactive players - sends notification hash 0x90fa1800 when expel returns true

Inferred - feature models restrict-units-in-territory style agreements

Open questions - Lua object for Player::Diplomacy not in list; confirm - meaning of expel reason 7

SetCanEnforceBorders

Arguments: bNewValue — new can-enforce-borders flag

Writes - diplomacy flag at this+0x478 (can enforce borders, via auto-variable at this+0x468)

Side effects - calls ExpelFromTerritory on each other qualifying player's diplomacy - sends a localized notification (type 0x84ad28f0) to each player whose units were expelled - sends Reporting::Event 0x52e2805c with the owner id and the inverted new value

Input checks: No-op if the value equals the current one. No range check needed on the bool.

Preconditions - gameplay state on game thread - diplomacy object must have a valid owner player

Multiplayer: may-desync: edits game state and expels units; must be run identically on all clients. Risk: medium (Moves/expels other players' units and sends notifications as a side effect). Confidence of the reading: medium.

Verified from the code - early-outs when flag unchanged - loops over players in the manager and calls ExpelFromTerritory for those with a nonzero filter byte other than the owner - sends notification only if ExpelFromTerritory returned true - sends event with !param

Inferred - byte at player+0x258 probably means player is alive/major - the notification tells other players their units were expelled

Open questions - exact meaning of the player+0x258 filter - the localization keys used

SetFightingJointWar

Arguments: target — enemy player of the joint war; partner — ally player in the joint war

Writes - joint-war target entry in global DiplomaticRelations (via SetJointWarTarget) keyed by owner, partner, target

Side effects - edits the game-wide DiplomaticRelations object

Input checks: None visible; validation (if any) is inside SetJointWarTarget.

Preconditions - valid player ids - gameplay state

Multiplayer: may-desync: edits global diplomacy state; must run identically on all clients. Risk: medium (global diplomatic state, unchecked ids). Confidence of the reading: medium.

Verified from the code - passes owner id, partner and target to SetJointWarTarget (note Ghidra param order: target is the first param)

Inferred - argument order to SetJointWarTarget is owner, partner, target

Open questions - internal checks in SetJointWarTarget

SetHadFriendlyMeeting

Arguments: ePlayer — other player, index into the flag array; bNewValue — new flag value

Writes - friendly-meeting flag byte at this+0x378 [ePlayer]

Input checks: None; ePlayer is used as an unchecked index.

Multiplayer: may-desync, writes synced diplomacy variable. Risk: medium (unchecked index). Confidence of the reading: high.

SetHasDefensivePact

Arguments: ePlayer — other player in the pact; bNewValue — true to set pact, false to clear

Writes - defensive pact flag in DiplomaticRelations between owner and ePlayer (via SetIsInDefensivePact)

Side effects - edits global DiplomaticRelations

Input checks: None visible in this wrapper.

Preconditions - valid player ids

Multiplayer: may-desync: edits global diplomacy state; must run identically on all clients. Risk: medium (global diplomatic state; no notification sent here). Confidence of the reading: medium.

Verified from the code - thin wrapper to DiplomaticRelations::SetIsInDefensivePact with owner id first

Inferred - flag likely symmetric handled inside callee

Open questions - symmetry and validation inside callee

SetHasDenounced

Arguments: ePlayer — player being denounced; bNewValue — passed in but never read by the code shown (inferred)

Writes - denounce-turn entry at this+0x6a0 [ePlayer] set to current turn - grievances on the target player's diplomacy

Side effects - dispatches a signal on the game object - adds grievance with log key LOC_DIPLO_GRIEVANCE_LOG_DENOUNCED

Input checks: No null/range check on ePlayer; bNewValue ignored.

Multiplayer: may-desync, changes diplomacy state and grievances. Risk: high (signals and grievances, unchecked index). Confidence of the reading: medium.

SetHasOpenBordersFrom

Arguments: ePlayer — other player granting the open borders; bNewValue — true adds one, false removes one

Writes - open-borders counter array at this+0x480, indexed by ePlayer (clamped at 0) - turn-of-expiry array at this+0x590, indexed by ePlayer (current game turn from game+0xc0)

Side effects - when count reaches 0: calls ExpelFromTerritory(ePlayer) and dispatches a signal (game signal at +0xde0) with unit/player instance - when count becomes 1 by adding: dispatches a different signal (game signal +0xdc8) - sends Reporting::Event 0x52e2805c with owner id and bNewValue

Input checks: ePlayer is used as an unchecked array index; invalid id is a crash/corruption risk. Counter never goes below 0.

Preconditions - valid ePlayer index - gameplay state

Multiplayer: may-desync: mutates replicated diplomacy state and expels units; must execute identically everywhere. Risk: high (Unchecked player index and expels units). Confidence of the reading: medium.

Verified from the code - counter is incremented/decremented by 1 and floored at 0 - edit() called on the variant map before each write - event is always sent - no bounds check on ePlayer

Inferred - offsets +0x480/+0x590 look like per-player int arrays - the signal arguments are the other player instance and the owner instance

Open questions - what the two signals are named - what the +0x590 array is used for exactly (assumed last-turn-ended)

SetLastTurnOfferedDeal

Arguments: ePlayer — other player; iTurn — turn number

Writes - per-player int array at this+0xc90

Input checks: Silent return if id >= 0x40 (unsigned compare, so negatives also rejected).

Preconditions - game thread

Multiplayer: may-desync: synced array. Risk: low (bounds-checked store). Confidence of the reading: high.

Verified from the code - unsigned bound 0x40 - stores turn in array

Inferred - used by AI deal cooldown logic

SetOccupyingOriginalCity

Arguments: ePlayer — the other player; bNewValue — new flag value

Writes - per-player flag byte array at this+0xc40 (64 entries)

Side effects - none

Input checks: silently ignores ePlayer >= 0x40 (unsigned compare)

Preconditions - gameplay thread

Multiplayer: safe-deterministic. Risk: low (bounds checked flag write). Confidence of the reading: high.

Verified from the code - bounds check < 0x40 - writes a byte into array at +0xc40

Inferred - flag affects diplomatic attitude and AI behaviour

Open questions - readers of this flag

SetResearchAgreementTech

Arguments: ePlayer — partner player; eTech — technology chosen for the agreement

Writes - research agreement tech entry in global DiplomaticRelations (owner, partner)

Side effects - edits global DiplomaticRelations

Input checks: None visible in this wrapper.

Preconditions - valid player ids - research agreement exists (likely)

Multiplayer: may-desync: edits global diplomacy state; must run identically on all clients. Risk: medium (global diplomatic state, unchecked tech id). Confidence of the reading: medium.

Verified from the code - wrapper to DiplomaticRelations::SetResearchAgreementTech with owner id first

Inferred - tech -1 probably clears it

Open questions - callee validation

UpdateAvailableCasusBelli

Writes - casus belli availability data at this+0x1ca8 per player

Side effects - sends Reporting notification for new casus belli options

Input checks: Checks player index below 0x41 and active, not self, has met, and diplomatic action validity; remainder truncated.

Multiplayer: may-desync, writes synced diplomacy and notifies. Risk: medium (large function, truncated view). Confidence of the reading: low.

UpdateIncursionData

Writes - incursion entries removed from map at this+0x2bc8

Input checks: No input; compares current turn to each entry turn.

Multiplayer: may-desync, edits synced incursion data. Risk: medium (deletes records). Confidence of the reading: medium.

UpdatePromise

Arguments: eOtherPlayer — player the promise is tied to; ePromiseType — promise type hash

Side effects - may call BreakPromise, which changes diplomacy state

Input checks: Does nothing if no record found; no range checks.

Multiplayer: may-desync, can break promises. Risk: medium (indirectly breaks promises). Confidence of the reading: medium.