1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Difference between favored and value fields in AiFavoredItems table?

Discussion in 'Mod Creation Help' started by Imnimo, Dec 8, 2017.

  1. Imnimo

    Imnimo Chieftain

    Joined:
    Dec 3, 2017
    Messages:
    12
    Gender:
    Male
    I'm trying to set up the lists of preferred actions for my leader, but I'm confused about the meaning of the "Favored" and "Value" fields.

    I imagine that favored=true means that they want to build the item, and favored=false means they don't, and similarly positive Value and negative Value. But what is the purpose of having both? Should I set both? What is the significance of making Value=1 vs. Value=10?
     
  2. Imnimo

    Imnimo Chieftain

    Joined:
    Dec 3, 2017
    Messages:
    12
    Gender:
    Male
    A follow-up question - is there a way to access the base game values for all the AIFavoredItems entries? From looking at some other mods and built-in agendas, I see that there's a pretty wide range of values for different items (like PSEUDOYIELD_UNIT_NAVAL_COMBAT has a "default value" of 1.0 in Yields.xml, but the LastVikingKingNavalPreference entry in Agendas.xml sets it to 100. On the other hand, CounterReformerInquisitorPreference sets the value of UNIT_INQUISITOR to 1 - a pretty big difference from the 100 for naval combat. How do I tell what reasonable ranges are for these values?
     
  3. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,140
    Location:
    Illinois, USA
    You would need to get a database viewer program (there are multiple ones available for free on the internet, I use SQLiteBrowser I think it is called) and then you would open file C:\Users\YourUserNameHere\Documents\My Games\Sid Meier's Civilization VI\Cache/DebugGameplay.sqlite after you have loaded up the game plus any mods and are actually in-game. Or once you are in-game with everything loaded you can exit directly to desktop and the contents of file DebugGameplay.sqlite will remain as it was.

    I am not sure if you can use something like Notepad++ to view SQL databases.

    As far as the values for AIPreferredItems goes, the higher the number the more the AI will "favor" the item. But I am not sure I can answer the question as to how much is too much for a particular AIFavoredItem you want to set up.
     
    Imnimo likes this.
  4. Imnimo

    Imnimo Chieftain

    Joined:
    Dec 3, 2017
    Messages:
    12
    Gender:
    Male
    One thing I find particularly confusing about the "value" field in AIFavoredItems is the values assigned to victory types. Consider these two lines from the core Leaders.xml:

    Code:
            <Row ListType="FavorReligiousVictory" Item="VICTORY_STRATEGY_RELIGIOUS_VICTORY" Value="-1"/>
            <Row ListType="ForbidReligiousVictory" Item="VICTORY_STRATEGY_RELIGIOUS_VICTORY" Value="5"/>
    
    FavorReligiousVictory gives negative weight, and ForbidReligiousVictory gives positive weight. Similarly, in the Macedonia DLC, we have this line:

    Code:
            <Row ListType="AlexanderPreferWar" Item="VICTORY_STRATEGY_MILITARY_VICTORY" Value="-2"/>
    
    Again, a modifier that seems to increase favor of a particular strategy does so by assigning a negative weight. Maybe this is a quirk particular to strategies, because other entries do seem to follow the natural plan of higher numbers for more favored...
     

Share This Page