Home › Dev CE (experimental) › PlayerGreatPeoplePoints
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.
PlayerGreatPeoplePoints
19 methods (Dev CE test build). this is found with the game's own IPlayerGreatPeoplePoints instance resolver (plain).
| Method |
Signature |
Purpose (AI-written, inferred) |
Tested |
Engine function |
Current |
| AddGreatPersonEarnedBoost |
PlayerGreatPeoplePoints:AddGreatPersonEarnedBoost(eGPClass: integer, bTechBoost: boolean, bOtherPlayers: boolean) |
Appends a record (class, tech-boost flag, other-players flag) to the earned-boost vector at offset 0x238. |
plumbing ✓ |
— |
0x2e26e0 |
| CalculateYieldChangePerEarnedGreatPersonClassOnResource |
PlayerGreatPeoplePoints:CalculateYieldChangePerEarnedGreatPersonClassOnResource(eYield: integer, eResource: integer) → number |
Sums matching entries of the yield-change vector per great person class, multiplied by the number of people of that class the player has received. |
plumbing ✓ |
— |
0x2e2cb0 |
| ChangeBonusPointsPerTurn |
PlayerGreatPeoplePoints:ChangeBonusPointsPerTurn(eClass: integer, xChange: number (fixed point, 1/256 steps)) |
Adds a fixed-point delta to the bonus great person points per turn of a given class. |
plumbing ✓ ran ±1, reversible ✓, no visible effect |
Player::GreatPeoplePoints::ChangeBonusPointsPerTurn |
0x2e2e20 |
| ChangeBonusPointsPerTurnPercent |
PlayerGreatPeoplePoints:ChangeBonusPointsPerTurnPercent(eClass: integer, iChange: integer) |
Adds a delta to the percent bonus on per-turn points for a great person class, flooring the result at zero. |
plumbing ✓ ran ±1, reversible ✓, no visible effect |
Player::GreatPeoplePoints::ChangeBonusPointsPerTurnPercent |
0x2e2e90 |
| ChangeChangeYieldChangePerEarnedGreatPersonClassOnResource |
PlayerGreatPeoplePoints:ChangeChangeYieldChangePerEarnedGreatPersonClassOnResource(eYield: integer, eClass: integer, eResource: integer, iChange: integer) |
Adds, or for negative iChange removes, a matching (yield, class, resource, amount) entry in the vector at 0x1e8. Decompilation of the add path is truncated. |
plumbing ✓ |
— |
0x2e2f20 |
| ChangeFreeGreatPersonPoints |
PlayerGreatPeoplePoints:ChangeFreeGreatPersonPoints(iChange: integer) |
Adds a signed delta to the player free great person points and fires an update event. |
plumbing ✓ ran ±1, reversible ✓, no visible effect |
Player::GreatPeoplePoints::ChangeFreeGreatPersonPoints |
0x2e30b0 |
| ChangePatronageDiscountPercent |
PlayerGreatPeoplePoints:ChangePatronageDiscountPercent(eYield: integer, iChange: integer) |
Adds a delta to the great person patronage discount percent for a yield type, clamped to 0..100. |
plumbing ✓ ran ±1, reversible ✓, no visible effect |
Player::GreatPeoplePoints::ChangePatronageDiscountPercent |
0x2e3110 |
| ChangePointsRefundPercent |
PlayerGreatPeoplePoints:ChangePointsRefundPercent(iChange: integer) |
Adds a delta to the percentage of great person points refunded, clamped to 0..100. |
plumbing ✓ ran ±1, reversible ✓, no visible effect |
Player::GreatPeoplePoints::ChangePointsRefundPercent |
0x2e31c0 |
| DoTurn |
PlayerGreatPeoplePoints:DoTurn() |
If the player is alive and the government flag allows, computes points per turn for each great person class, stores it, and adds it to the class total. |
plumbing ✓ |
— |
0x2e3610 |
| GetCachedPointsPerTurn |
PlayerGreatPeoplePoints:GetCachedPointsPerTurn(eClass: integer) → number |
Computes points per turn for a class: sums city contributions, adds bonus points and applies a percentage bonus; result is a fixed-point value written through a hidden return pointer. |
plumbing ✓ |
— |
0x2e3720 |
| GetFaithFromUnusedGreatPeoplePoints |
PlayerGreatPeoplePoints:GetFaithFromUnusedGreatPeoplePoints() → number |
Sums points in great person classes the player can never earn, then multiplies by a game parameter to give faith. |
plumbing ✓ |
— |
0x2e3920 |
| GetYieldModifierFromEarnedGreatPeople |
PlayerGreatPeoplePoints:GetYieldModifierFromEarnedGreatPeople(eYield: integer) → number |
Returns the per-person modifier for a yield times people received, capped at a game parameter limit. |
plumbing ✓ |
— |
0x2e3ae0 |
| GetYieldModifierPerEarnedGreatPerson |
PlayerGreatPeoplePoints:GetYieldModifierPerEarnedGreatPerson(eYield: integer) → number |
Returns the per-earned-person modifier stored for a yield, or 0 if out of range. |
plumbing ✓ |
— |
0x2e3b90 |
| IsGreatPersonClassNoPoints |
PlayerGreatPeoplePoints:IsGreatPersonClassNoPoints(eGPClass: integer) → boolean |
Returns true if the class is in the no-points list at 0x278. |
plumbing ✓ |
— |
0x2e3c30 |
| RemoveGreatPersonEarnedBoost |
PlayerGreatPeoplePoints:RemoveGreatPersonEarnedBoost(eGPClass: integer, bTechBoost: boolean, bOtherPlayers: boolean) |
Removes matching earned-boost records (class, tech flag, other-players flag) from the vector at 0x238. |
plumbing ✓ |
— |
0x2e4080 |
| SetBonusPointsPerTurn |
PlayerGreatPeoplePoints:SetBonusPointsPerTurn(eClass: integer, xValue: number (fixed point, 1/256 steps)) |
Sets the bonus points per turn for a class in the array at 0xe8, clamping negative values to zero. |
plumbing ✓ |
— |
0x2e44c0 |
| SetGreatPersonClassNoPoints |
PlayerGreatPeoplePoints:SetGreatPersonClassNoPoints(eGPClass: integer, bNoPoints: boolean) |
Adds or removes a great person class from the list of classes that earn no points for the player. |
plumbing ✓ |
Player::GreatPeoplePoints::SetGreatPersonClassNoPoints |
0x2e4550 |
| SetNoPatronageWith |
PlayerGreatPeoplePoints:SetNoPatronageWith(eYield: integer, bNewValue: boolean) |
Sets a per-yield flag meaning the player cannot use that yield to patronize (buy) Great People. Only gold and faith are supported. |
plumbing ✓ |
Player::GreatPeoplePoints::SetNoPatronageWith |
0x2e4640 |
| SetYieldModifierPerEarnedGreatPerson |
PlayerGreatPeoplePoints:SetYieldModifierPerEarnedGreatPerson(eYield: integer, xValue: number (fixed point, 1/256 steps)) |
Sets the yield modifier granted per earned great person for a yield type. |
plumbing ✓ |
Player::GreatPeoplePoints::SetYieldModifierPerEarnedGreatPerson |
0x2e47b0 |
Details
AddGreatPersonEarnedBoost
Arguments: eGPClass — great person class; bTechBoost — flag stored in record; bOtherPlayers — flag stored in record
Writes
- earned-boost vector at this+0x238 grows
Input checks: None; duplicates allowed.
Multiplayer: may-desync, writes synced vector. Risk: medium (unchecked). Confidence of the reading: medium.
CalculateYieldChangePerEarnedGreatPersonClassOnResource
Arguments: eYield — yield type; eResource — resource type
Input checks: Returns 0 without a game; no range checks.
Multiplayer: read-only, getter. Risk: low (getter). Confidence of the reading: medium.
ChangeBonusPointsPerTurn
Arguments: eClass — great person class index; xChange — delta in raw/256
Writes
- bonus points per turn via SetBonusPointsPerTurn (array at this+0xe8)
Side effects
- calls SetBonusPointsPerTurn
Input checks: Range check 0 <= class < array size; otherwise silently returns.
Preconditions
- gameplay state only
Multiplayer: may-desync: direct state write. Risk: low (bounds checked). Confidence of the reading: high.
Verified from the code
- bounds check
- reads old, adds delta, calls SetBonusPointsPerTurn
ChangeBonusPointsPerTurnPercent
Arguments: eClass — great person class; iChange — amount added
Writes
- per-class bonus percent array at this+0x118 (value += change, clamped to >= 0)
Side effects
- none
Input checks: Class index is checked to be non-negative and below the size of the array at 0xf8..0x100; out of range silently ignored. No upper clamp.
Preconditions
- valid class id
Multiplayer: may-desync: player state mutation; must run identically on all clients. Risk: low (bounds-checked, clamped at 0). Confidence of the reading: high.
Verified from the code
- bounds check
- adds delta
- sets to 0 if the result is negative
Inferred
- bounds array (0xf8) and edited array (0x118) are parallel arrays by class
ChangeChangeYieldChangePerEarnedGreatPersonClassOnResource
Arguments: eYield — yield type; eClass — great person class; eResource — resource type; iChange — amount; negative removes an entry with the opposite amount
Writes
- yield-change entry vector at this+0x1d8
Input checks: Rejects -1 types on the add path; removal matches exact amount only.
Multiplayer: may-desync, writes synced vector. Risk: medium (truncated, vector rewrite). Confidence of the reading: low.
ChangeFreeGreatPersonPoints
Arguments: iChange — signed delta
Writes
- tracked int at this+0x148 (new value = value at this+0x158 + iChange)
Side effects
- sends event 0x884c48ce with owner id
- assigns through a FAutoVariable move-assign
Input checks: No validation; may go negative.
Preconditions
- gameplay Lua state
- valid player
Multiplayer: may-desync: mutates synchronised state. Risk: medium (Unvalidated variable write.). Confidence of the reading: medium.
Verified from the code
- New value = old + delta
- Sends event 0x884c48ce
Inferred
- Free points can be spent on any class
Open questions
- The ControlPriority template name is probably an identical-code-folding artefact
ChangePatronageDiscountPercent
Arguments: eYield — yield used for patronage; iChange — amount added
Writes
- per-yield discount percent array at this+0x178, clamped to 0..100
Side effects
- none
Input checks: Yield index range-checked; out of range silently ignored. Result clamped between 0 and 100.
Preconditions
- valid yield id
Multiplayer: may-desync: player state mutation; must run identically on all clients. Risk: low (bounds-checked and clamped). Confidence of the reading: high.
Verified from the code
- clamp to 100 max and 0 min
- bounds check on yield index
Inferred
- discount applies to patronage cost
ChangePointsRefundPercent
Arguments: iChange — amount added
Writes
- points refund percent at this+0x170 (wrapper at this+0x160), clamped to 0..100
Side effects
- none
Input checks: No input check; result clamped to 0..100 afterward.
Preconditions
- valid GreatPeoplePoints object
Multiplayer: may-desync: player state mutation; must run identically on all clients. Risk: low (scalar clamped). Confidence of the reading: high.
Verified from the code
- adds then clamps above 100 to 100 and below 0 to 0
Inferred
- refund applies when a great person is recruited
Open questions
- when refund is applied
DoTurn
Writes
- per-turn points array at this+0xc0
- class totals via ChangePointsTotal
Input checks: Requires owner non-null, alive and government flag.
Multiplayer: may-desync, adds great person points. Risk: medium (changes points). Confidence of the reading: medium.
GetCachedPointsPerTurn
Arguments: eClass — great person class (inferred)
Input checks: Zero result if owner null, not alive, or government flag missing.
Multiplayer: read-only, getter. Risk: low (getter). Confidence of the reading: medium.
GetFaithFromUnusedGreatPeoplePoints
Input checks: None.
Multiplayer: read-only, getter. Risk: low (getter). Confidence of the reading: medium.
GetYieldModifierFromEarnedGreatPeople
Arguments: eYield — yield type (inferred)
Input checks: Index bounds-checked; zero without a game.
Multiplayer: read-only, getter. Risk: low (getter). Confidence of the reading: medium.
GetYieldModifierPerEarnedGreatPerson
Arguments: eYield — yield type (inferred)
Input checks: Bounds-checked.
Multiplayer: read-only, getter. Risk: low (getter). Confidence of the reading: medium.
IsGreatPersonClassNoPoints
Arguments: eGPClass — great person class
Input checks: None needed.
Multiplayer: read-only, getter. Risk: low (getter). Confidence of the reading: high.
RemoveGreatPersonEarnedBoost
Arguments: eGPClass — great person class; bTechBoost — tech boost flag to match; bOtherPlayers — other-players flag to match
Writes
- earned-boost vector at this+0x238 shrinks
Input checks: None.
Multiplayer: may-desync, writes synced vector. Risk: medium (unchecked). Confidence of the reading: medium.
SetBonusPointsPerTurn
Arguments: eClass — great person class index; xValue — new bonus value (fixed point); negative clamped to 0
Writes
- bonus per-turn array at this+0xe8
Input checks: Index range-checked; negative value clamped.
Multiplayer: may-desync, writes synced array. Risk: medium (synced write). Confidence of the reading: high.
SetGreatPersonClassNoPoints
Arguments: eGPClass — great person class; bNoPoints — true to block points for the class, false to allow again
Writes
- no-points class list at this+0x268 (append on true, erase on false)
Side effects
- none visible
Input checks: Class -1 returns silently. No duplicate check on add. Unset of absent class is silent no-op.
Preconditions
- valid class id
Multiplayer: may-desync: player state mutation; must run identically on all clients. Risk: low (list edit only). Confidence of the reading: high.
Verified from the code
- list append or memmove-based erase of first match
Inferred
- list consulted when awarding points; vector element type shows as TechTypes only due to template folding
Open questions
- whether existing points are cleared
SetNoPatronageWith
Arguments: eYield — yield type; only YIELD_GOLD and YIELD_FAITH have an effect; bNewValue — new value of the no-patronage flag
Writes
- bool auto-variable at this+0x220 (gold patronage blocked)
- bool auto-variable at this+0x208 (faith patronage blocked)
Side effects
- assignment goes through the auto-variable copy helper, which likely marks the variable dirty for sync
Input checks: Any yield other than gold or faith is silently ignored. No pointer or range checks.
Preconditions
- gameplay Lua state only
- must run on the game thread
Multiplayer: may-desync: direct state write; safe only if called identically on all clients from deterministic game logic. Risk: low (simple flag write with silent ignore of other yields). Confidence of the reading: medium.
Verified from the code
- only YIELD_GOLD and YIELD_FAITH branches write anything
- gold writes offset 0x220, faith writes offset 0x208
- value is copied via the auto-variable copy-assignment helper
Inferred
- the flag is read by the Great People patronage purchase check
- the helper template name is mis-resolved by symbols, it is just an auto-variable assign
Open questions
- which callers read these flags and exactly how they gate patronage
SetYieldModifierPerEarnedGreatPerson
Arguments: eYield — yield type index; xValue — new value raw/256
Writes
- array element at VariantMap this+0x1a8 for yield
Input checks: Unsigned bound check against array size; out of range silently ignored.
Preconditions
- gameplay state only
Multiplayer: may-desync: direct state write. Risk: low (bounds checked). Confidence of the reading: high.
Verified from the code
- unsigned bounds check
- overwrites element with *param