Lord Yanaek
Emperor
- Joined
- Aug 15, 2003
- Messages
- 1,501
Hello. Did anybody mess with modifiers yet, and if so, did anybody understood how they work?
At first, when i had a look at buildings or policies inside the database and didn't have all the columns for various effects, i wondered where they went. Then i saw the modifiers and the global ModifierArguments table holding tons of variables for all the in-game modifiers, no matter where they came from and was like ... whaaaaat ?
Then i considered the ability to attach modifiers to anything in game and define their effect in a unified table and hoped it would open plenty of possibilities for modding, thinking maybe this time they really built their game to be modable as they claimed.
However, upon closer inspection, i really fail to understand how this table actually defines any effect, and i fear they just hard-coded every single modifier by name making them essentially useless for mods
EDIT : Thanks gyogen2, the main effect of the modifiers is in the Modifiers table and not the ModifiersArguments table.
Examples taken from various policies.
God King adds 1 gold to the Palace only
Triangular Trade adds 4 gold to any trade route
Town Charters double the Commercial Hub adjacency bonus
Free Market doubles the Yield of the Commercial Hub buildings
As you can see, all of those use the same "YieldType" modifier with a type of "ARGTYPE_IDENTITY" and a value of "YIELD_GOLD". However, only the last example explicitly states what building is affected. The other building affecting policy (God King) doesn't even tell. Also every policy uses an "Amount" modifier whether they are a flat value (God King and Triangular Trade) or a % increase (Town Charters and Free Market)
So, did anyone made any sense out of this mess, or is it all hard-coded and our hopes of moding any modifier, apart from simple number tweaking, gone?
At first, when i had a look at buildings or policies inside the database and didn't have all the columns for various effects, i wondered where they went. Then i saw the modifiers and the global ModifierArguments table holding tons of variables for all the in-game modifiers, no matter where they came from and was like ... whaaaaat ?
Then i considered the ability to attach modifiers to anything in game and define their effect in a unified table and hoped it would open plenty of possibilities for modding, thinking maybe this time they really built their game to be modable as they claimed.
EDIT : Thanks gyogen2, the main effect of the modifiers is in the Modifiers table and not the ModifiersArguments table.
Examples taken from various policies.
God King adds 1 gold to the Palace only
Code:
"GOD_KING_GOLD" "YieldType" "ARGTYPE_IDENTITY" "YIELD_GOLD"
"GOD_KING_GOLD" "Amount" "ARGTYPE_IDENTITY" "1"
Code:
"TRIANGULARTRADE_TRADEROUTEGOLD" "YieldType" "ARGTYPE_IDENTITY" "YIELD_GOLD"
"TRIANGULARTRADE_TRADEROUTEGOLD" "Amount" "ARGTYPE_IDENTITY" "4"
Code:
"TOWNCHARTERS_DISTRICTGOLD" "YieldType" "ARGTYPE_IDENTITY" "YIELD_GOLD"
"TOWNCHARTERS_DISTRICTGOLD" "Amount" "ARGTYPE_IDENTITY" "100"
Code:
"FREEMARKET_DOUBLEMARKET" "BuildingType" "ARGTYPE_IDENTITY" "BUILDING_MARKET"
"FREEMARKET_DOUBLEMARKET" "YieldType" "ARGTYPE_IDENTITY" "YIELD_GOLD"
"FREEMARKET_DOUBLEMARKET" "Amount" "ARGTYPE_IDENTITY" "100"
As you can see, all of those use the same "YieldType" modifier with a type of "ARGTYPE_IDENTITY" and a value of "YIELD_GOLD". However, only the last example explicitly states what building is affected. The other building affecting policy (God King) doesn't even tell. Also every policy uses an "Amount" modifier whether they are a flat value (God King and Triangular Trade) or a % increase (Town Charters and Free Market)
So, did anyone made any sense out of this mess, or is it all hard-coded and our hopes of moding any modifier, apart from simple number tweaking, gone?
Last edited: