Stellaris

Stellaris

Modify the Galaxy
Modify your Stellaris experience by checking out the many mods created and shared by the community, including tweaks to almost any aspect of the game.
Learn More
Geoff 30 Dec, 2024 @ 1:27am
Adjusting AI Assignment of Slavery Types
I've long found it slightly annoying that the AI only ever seems to assign the "indentured servitude" status to its slaves. Looking through the file at "common/species_types/slavery_types" it wasn't too hard to see why.

The base factor for "indentured servitude" was set to 30 while the base factor for the other types was set to 1. And only a couple of traits were being taken into consideration - if a species doesn't have "trait_very_strong" its factor for becoming a battle thrall was being set to 0. If it wasn't "trait_charismatic" its odds of becoming a domestic servant were set to 0.

So, I spent a little bit of time trying to fix the math. I'm still play-testing it to verify that it works as intended. But here are my thoughts on how I set it out.

slavery_normal = { #In game, this would be "chattel slavery" - only menial labor slavery_domestic = { #These guys can work as menials, specialist entertainers, or uncapped "servants" slavery_military = { #Battle Thralls - can work as menials or specialist enforcers slavery_indentured = { #Indentured servants can work as menials or any specialist except enforcers and entertainers slavery_livestock = { #Yummy yummy,

So first I evened out the base odds. For each type I set the base factor to 50 (livestock got a base factor of 10 to make them much less likely)
ai_will_do = { factor = 50 }

Then I decided to create a framework of baseline modifiers. I figured for each class, there could be "absolute disqualifiers", traits that make an assignment 1/10th as likely, 1/4th, 1/2, 2x, 5x, 10x. Then to keep it kind of random, I decided to batch the traits for each modifier. So the framework for that looks like this:
ai_will_do = { factor = 50 modifier = { factor = 0 has_trait = trait_syncretic_proles } modifier = { factor = 0.1 OR = { [various traits] } } modifier = { factor = 0.25 OR = { [various traits] } } modifier = { factor = 0.5 OR = { [various traits] } } modifier = { factor = 2 OR = { [various traits] } } modifier = { factor = 5 OR = { [various traits] } }

Then it was just a matter of figuring out whether various traits would make a role assignment more or less likely. Here's my initial sort of most of the basic traits along with a few critical bonus traits like "noxious" or "psionic"

I tried to break things up a bit, so that some combinations of traits would lead to stacking of multipliers, others would cancel themselves outs, and some combinations wouldn't be additive (talented + quick learners are on the same tier, so having both is the same as having either) So, filled out for domestic servants my list would look like this:
modifier = { factor = 0 OR = { is_same_species = owner_main_species has_trait = trait_repugnant } } modifier = { factor = 0.1 OR = { has_trait = trait_nonadaptive has_trait = trait_syncretic_proles has_trait = trait_quarrelsome has_trait = trait_unruly has_trait = trait_wasteful } } modifier = { factor = 0.25 OR = { has_trait = trait_industrious has_trait = trait_slow_learners has_trait = trait_deviants has_trait = trait_decadent } } modifier = { factor = 0.5 OR = { has_trait = trait_agrarian has_trait = trait_ingenious has_trait = trait_rapid_breeders has_trait = trait_nomadic has_trait = trait_fleeting has_trait = trait_psionic } } modifier = { factor = 2 OR = { has_trait = trait_venerable has_trait = trait_intelligent has_trait = trait_thrifty has_trait = trait_natural_engineers has_trait = trait_adaptive has_trait = trait_slow_breeders has_trait = trait_talented has_trait = trait_quick_learners has_trait = trait_docile has_trait = trait_sedentary has_trait = trait_communal has_trait = trait_solitary has_trait = trait_resilient } } modifier = { factor = 5 OR = { has_trait = trait_conservational has_trait = trait_traditional has_trait = trait_extremely_adaptive has_trait = trait_conformists has_trait = trait_enduring } } modifier = { factor = 10 OR = { has_trait = trait_charismatic } }

It was kind of fun thinking about some of the factors that might be influential. Like I figured both sedentary and nomadic would double the likelihood of being assigned the "livestock" category - since normadic creatures are more easily herded and sedentary ones are more easily farmed. Being docile is a beneficial trait in game terms that'd still make you more likely to get eaten. Though being unruly is a penalty in game terms that'd make you even more likely to get munched. I could see going a different way. Given how frequent cannibalism is in nature, I'm not sure about the assumption that they wouldn't eat their own. But with a framework in place, it'd be easier to tweak. And by "renormalizing" the values I should see more randomness in the assignments:
ai_will_do = { factor = 10 modifier = { factor = 0 OR = { is_same_species = owner_main_species has_trait = trait_psionic } } modifier = { factor = 0.1 OR = { has_trait = trait_enduring has_trait = trait_traditional has_trait = trait_talented has_trait = trait_slow_breeders has_trait = trait_intelligent has_trait = trait_extremely_adaptive has_trait = trait_charismatic NOT = { from = { has_authority = auth_hive_mind } } } } modifier = { factor = 0.25 OR = { has_trait = trait_venerable has_trait = trait_adaptive has_trait = trait_natural_engineers has_trait = trait_natural_physicists has_trait = trait_natural_sociologists has_trait = trait_very_strong } } modifier = { factor = 0.5 OR = { has_trait = trait_decadent has_trait = trait_agrarian has_trait = trait_ingenious has_trait = trait_industrious has_trait = trait_strong has_trait = trait_quick_learners has_trait = trait_solitary has_trait = trait_resilient has_trait = trait_wasteful } } modifier = { factor = 2 OR = { has_trait = trait_deviants has_trait = trait_conformists has_trait = trait_weak has_trait = trait_syncretic_proles has_trait = trait_rapid_breeders has_trait = trait_quarrelsome has_trait = trait_nomadic has_trait = trait_sedentary has_trait = trait_communal has_trait = trait_conservational } } modifier = { factor = 5 OR = { has_trait = trait_fleeting has_trait = trait_nonadaptive has_trait = trait_slow_learners has_trait = trait_docile } } modifier = { factor = 10 OR = { has_trait = trait_unruly has_trait = trait_delicious has_trait = trait_repugnant } }
< >
Showing 1-1 of 1 comments
Felalot 25 30 Dec, 2024 @ 3:00am 
Well done lad!
< >
Showing 1-1 of 1 comments
Per page: 1530 50