[1.0.0.262] Few not effective items in AiFavoredItems

Infixo

Deity
Joined
Jan 9, 2016
Messages
4,034
Location
Warsaw
This one is a bit technical. There are some items in AiFavoredItems that have assigned Values 1 and -1 (see below) which are supposed to either boost or suppress a given item. However, this doesn't work as intended since Values are given as x100, so effectively +0.01 and -0.01 is applied. It should be 100 and -100 and can be seen in many other cases where items are either hugely boosted or suppressed.

Code:
UPDATE AiFavoredItems SET Value = -100 WHERE ListType = 'GandhiUnitBuilds' AND Item = 'PROMOTION_CLASS_INQUISITOR'; -- was -1
UPDATE AiFavoredItems SET Value =  100 WHERE ListType = 'TomyrisiUnitBuilds' AND Item = 'PROMOTION_CLASS_LIGHT_CAVALRY'; -- was 1
UPDATE AiFavoredItems SET Value =  100 WHERE ListType = 'AmanitoreUnitBuilds' AND Item = 'PROMOTION_CLASS_RANGED'; -- was 1
UPDATE AiFavoredItems SET Value =  100 WHERE ListType = 'CounterReformerInquisitorPreference' AND Item = 'UNIT_INQUISITOR'; -- was 1
UPDATE AiFavoredItems SET Value =  100 WHERE ListType = 'JadwigaUnitBuilds' AND Item = 'UNIT_MILITARY_ENGINEER'; -- was 1
UPDATE AiFavoredItems SET Value =  100 WHERE ListType = 'JayavarmanUnitBuilds' AND Item = 'UNIT_MISSIONARY'; -- was 1
UPDATE AiFavoredItems SET Value =  100 WHERE ListType = 'UnitPriorityBoosts' AND Item = 'UNIT_SETTLER'; -- was 1
 
However, this doesn't work as intended since Values are given as x100, so effectively +0.01 and -0.01 is applied. It should be 100 and -100 and can be seen in many other cases where items are either hugely boosted or suppressed.
Are you sure about this? There are values ranging from -200 to 500 in the Value column for AiFavoredItems, so I'm unsure where the "Values are given as x100" comes from and how these aren't working as intended. Regardless, perhaps only a small value either +/- is all that was wanted by FXS to get a slight build preference. I'm afraid changing the above values from 1s & -1s to 100s & -100s may cause an outsized effect.

For example, increasing Tomyris's preference for Light Cavalry to 100 puts her on par with Genghis's Agenda, which is specifically geared toward building a strong cavalry force. I don't think you'd want Tomyris building a huge number of light cavalry considering she gets a duplicate for each one. And, her agenda is not geared towards that anyway, but toward Alliances.
 
Are you sure about this? There are values ranging from -200 to 500 in the Value column for AiFavoredItems, so I'm unsure where the "Values are given as x100" comes from and how these aren't working as intended.
I am sure about the fact that Value is an additive parameter and is expressed as x100. I did a lot of testing recently because I wanted to better understand how the internal scoring works, i.e. how AI chooses buildings to build or policies to slot. There are logs that show scoring values, so you can play with them and see how it affects the scoring.
Example: for Yields system you have DefaultValue in Yields table, 1.0 for all except Gold that has 0.5. Then all active AiLists from Yields system, add to that e.g. 0.25 if you set 25, 0.5 if you use 50, etc. The same mechanism is used for PseudoYields, Units and UnitPromotionClasses (these are the ones I've tested).

Regardless, perhaps only a small value either +/- is all that was wanted by FXS to get a slight build preference. I'm afraid changing the above values from 1s & -1s to 100s & -100s may cause an outsized effect.
For example, increasing Tomyris's preference for Light Cavalry to 100 puts her on par with Genghis's Agenda, which is specifically geared toward building a strong cavalry force. I don't think you'd want Tomyris building a huge number of light cavalry considering she gets a duplicate for each one. And, her agenda is not geared towards that anyway, but toward Alliances.
Ofc, we will never know what "the intended effect was". The problem is that during scoring several systems are applied and the produce the result all togther. I am sure however that +1 and -1 virtually have no effect.
 
Back
Top Bottom