AI personality modding template

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Showing developer posts only. Show all posts in this thread.

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
Since I've been making an AI personality for a Blorg mod, and was asked about modding personalities, I thought I'd post a template for the benefit of the modders that want to plan out their own AI personalities, similar to how Johan posted the namelist templates.

Below you will find the Blorg 'Fanatical Befrienders' personality from the mod and the 'Peaceful Traders' personality from base game:
Code:
##### Types:
# honorbound -> Cares about honor and martial prowess above all else
# capitalist -> Cares about trade and material profit above all else
# hegemon -> Cares about the superiority of their own empire above all else
# ideologue -> Cares about combating opposing ethoses above all else
# isolationist -> Cares about maintaining their isolation from other empires above all else
# federation_builder -> Cares about bringing different species together in a federation above all else
# propagator -> Cares about the propagation of its species above all else
# purifier -> Cares about purifying the galaxy of other species above all else
# explorer -> Cares about exploring the galaxy and making scientific/spiritual discoveries above all else

##### Behaviours:
# conqueror -> Will they conquer planets from other empires?
# subjugator -> Will they vassalise other empires?
# liberator -> Will they liberate conquered empires?
# opportunist -> Are they more likely to attack someone already embroiled in war?
# uplifter -> Will they uplift and enlighten other species?
# infiltrator -> Will they infiltrate primitives?
# dominator -> Will they invade primitives?
# slaver -> Will they enslave pops?
# purger -> Will they purge alien pops?
# robot_exploiter -> Will they use robots for menial labor?
# robot_liberator -> Will they give rights to robots?
# migrator -> Will they want to migrate to other empires?

##### Modifiers:
# aggressiveness -> Chance of declaring wars
# trade_willingness -> At 1.0 willingness they will accept a deal that is equally good for both sides
# bravery -> Affects the chance that they will pick rivals & war targets of similar strength instead of picking on the weak
# military_spending -> Affects mineral & energy budget that goes to navies and armies
# colony_spending -> Affects mineral & energy budget that goes to new colonies

##### Diplomacy:
# alliance_acceptance -> Added directly to chance of accepting an alliance
# federation_acceptance -> Added directly to chance of accepting to form/join a federation

# NOTE: Weight is additive!

fanatic_befrienders = {
    type = federation_builder
  
    aggressiveness = 2.0
    trade_willingness = 1.0
    bravery = 1.5
  
    military_spending = 1.2
    colony_spending = 1.0  
  
    alliance_acceptance = 100
    federation_acceptance = 100
  
    threat_modifier = 0.5
    friction_modifier = 0

    behaviour = {
        conqueror = yes
        subjugator = yes
        liberator = no
        opportunist = yes
        slaver = no
        uplifter = yes
        purger = no
        dominator = no
        infiltrator = yes
        robot_exploiter = no
        robot_liberator = no
        migrator = yes
    }
  
    allow = {
        NOT = { is_country_type = fallen_empire }
        has_ethic = "ethic_militarist"
        has_ethic = "ethic_fanatic_xenophile"
        has_trait = "trait_repugnant"
        has_trait = "trait_solitary"
        has_trait = "trait_venerable"
    }
  
    weight_modifier = {
        weight = 100          
    }
}

peaceful_traders = {
    type = capitalist

    aggressiveness = 0.5
    trade_willingness = 1.0
    bravery = 0.5
  
    military_spending = 0.9
    colony_spending = 1.1  
  
    alliance_acceptance = 10
    federation_acceptance = 10
  
    threat_modifier = 1.3
    friction_modifier = 0.25
  
    behaviour = {
        conqueror = no
        subjugator = no
        liberator = yes
        opportunist = yes
        slaver = yes
        uplifter = yes
        purger = no
        infiltrator = yes
        dominator = no
        robot_exploiter = yes
        robot_liberator = no
        migrator = no
    }
  
    allow = {
        NOT = { is_country_type = fallen_empire }
        NOT = {
            has_ethic = "ethic_xenophobe"
            has_ethic = "ethic_fanatic_xenophobe"
        }
        OR = {
            has_ethic = "ethic_pacifist"
            has_ethic = "ethic_fanatic_pacifist"
        }
        OR = {
            has_ethic = "ethic_materialist"
            has_ethic = "ethic_fanatic_materialist"
        }      
    }
  
    weight_modifier = {
        weight = 10
        modifier = {
            factor = 2
            has_ethic = "ethic_fanatic_materialist"
        }
        modifier = {
            factor = 1
            has_trait = "trait_thrifty"
        }
        modifier = {
            factor = 1
            has_trait = "trait_industrious"
        }  
        modifier = {
            factor = 1
            has_election_type = oligarchy
        }      
    }
}

Names are done in the format:
Code:
personality_fanatic_befrienders:0 "Fanatical Befrienders"
personality_fanatic_befrienders_desc:0 "Fanatical Befrienders are highly friendly but deeply lonely individuals. They will attempt to make friends by any means necessary."
 
  • 89
  • 9
Reactions:

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
You can play Ironman with mods but can't get achievements.
 
  • 23
  • 6
  • 3
Reactions:

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
Since I noticed

Code:
NOT = { is_country_type = fallen_empire }

Is in there, does that mean we can create our own Fallen Empire types?

Yeah.
 
  • 19
  • 4
Reactions:

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.513
137.622
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
I presume Fallen Empires' personalities just have most of their behaviors set to "no" and lowered willingness to do anything... and then for their specific quirk/awaken triggers, the events will just check AI personality, e.g. type = keepers_of_knowledge?

Pretty much.
 
  • 13
  • 3
Reactions: