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.

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.596
142.553
  • 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:
Thanks Wiz. Could we get some information about modding and Ironman- achievements mode?
 
You can play Ironman with mods but can't get achievements.
 
  • 23
  • 6
  • 3
Reactions:
Was going to peek at the mod to see how you did it, but this is even better!

(Might throw a couple together tonight.)
 
Last edited:
  • 1
Reactions:
You can play Ironman with mods but can't get achievements.
Thanks. Also, what are the maximum in weights?
For example, the Blorg have a bravery of 1.5 and likeliness to create alliance of 100.
 
Where does one do their dialogue? Like, "Greetings Earthlings. We do not accept your treaty, because reasons"
 
  • 3
Reactions:
French_Blobber = {
type = propagator

aggressiveness = 2.0
trade_willingness = 0.6
bravery = 0.5

military_spending = 0.80
colony_spending = 0.75

alliance_acceptance = -10
federation_acceptance = -40

threat_modifier = 0.5
friction_modifier = 0.7

behaviour = {
conqueror = yes
subjugator = yes
liberator = no
opportunist = yes
slaver = no
uplifter = no
purger = no
dominator = yes
infiltrator = no
robot_exploiter = yes
robot_liberator = no
migrator = no
}

allow = {
is_country_type = France
OR = {
has_culture_group = "French"
}​
}

weight_modifier = {
weight = 100
}
}

Something like this?
 
  • 10
Reactions:
I'm hoping for a rare 'three laws' tech that will dramatic decrease the chance of robot rebellions.
 
  • 7
  • 2
Reactions:
Wiz: why is Materialist a prerequisite for Peaceful Traders (and, presumably, Ruthless Capitalists)? As I've read the Ethos, Materialist seems a lot more focused on a scientific/technological mindset than a commercial mindset.
 
  • 3
Reactions:
I think it covers both, to an extent.
 
  • 3
Reactions:
About Bravery, a low level means than the AI will attack smaller empires and avoid bigger ones, not too hard to understand.
Does a high level means than the AI will attack only empires of the same size, or will they still attack smaller empires if they got the opportunity ?

Concretely, having Bravery = 1.5 means than smaller empires are mostly safe from this AI, or than nobody is safe from the AI, small and similar empires alike ?
 
  • 2
  • 1
Reactions:
Where does one do their dialogue? Like, "Greetings Earthlings. We do not accept your treaty, because reasons"

I'm guessing that would be a bunch of dialogue triggers like

Code:
blorg_diplo_dialouge_friendly_01
blorg_diplo_dialouge_neutral_01
blorg_diplo_dialouge_hostile_01

but all the actual fluff text would be in localization files like:

Code:
blorg_diplo_dialouge_friendly_01:0 "Friend-pai?!"
blorg_diplo_dialouge_neutral_01:0 "So like... do you... wanna go to... a party? with me? a Blorg? friendorino?"
blorg_diplo_dialouge_hostile_01:0 "Resistance is impolite"


I'm hoping for a rare 'three laws' tech that will dramatic decrease the chance of robot rebellions.

Only sentient robots can rebel, if the "three laws" were hardwired into their programing, well then they wouldn't really be sentient now would they ;)
 
  • 2
  • 2
  • 1
Reactions:
Since I noticed

Code:
NOT = { is_country_type = fallen_empire }

Is in there, does that mean we can create our own Fallen Empire types?
 
  • 2
Reactions:
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: