Skip to content

Commit

Permalink
Balancing and pruning optimizations
Browse files Browse the repository at this point in the history
- Tune done revolt risk from scoiatel presence, and remove scoiatel presence in neighbor provinces when crushing a revolt
- Flag immortal characters as unimportant (except witchers, sorcerers, ...) so that they can be pruned
- Rebalance health in race traits so that long-lived races can be pruned (< 20 health), but not witchers, sorcerers, etc.
- Reduced generation of magic child with hidden_magic_talent, now that sorcerers are no longer pruned
- Tweak court pruning on title inheritance, so that 80% of non-important courtiers are pruned
- Fix runtime errors causing error.log to grow to 50MB after hundred years, which possibly caused CTD
  • Loading branch information
rquinio committed Aug 20, 2017
1 parent 9433f84 commit 699f583
Show file tree
Hide file tree
Showing 24 changed files with 301 additions and 243 deletions.
1 change: 1 addition & 0 deletions MOD/Witcher/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Bugfix:
- Clarify Pogrom CB description.
- Fix Nilfgaard successful invasion event option to actually grant the new kingdom title.
- Allow special force commander to fight Scoiatel even if at war or leading troops.
- Tune done revolt risk from scoiatel presence, and remove scoiatel presence in neighbor provinces when crushing a revolt.
- Change cost of fetching a Witcher to be fixed instead of scaled, but each monster cleaning now costs money upon success.
- Remove Dwarven walls/keep buildings as they break vanilla building chains
- Remove unsuitable RIP physician character events.
Expand Down
24 changes: 22 additions & 2 deletions MOD/Witcher/common/cb_types/W_cb_types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ scoiatael_revolt = {
}
}
}
capital_scope = {
remove_province_modifier = scoiatael_presence
any_neighbor_province = {
remove_province_modifier = scoiatael_presence
}
}
}

on_reverse_demand_title = {
Expand All @@ -346,6 +352,12 @@ scoiatael_revolt = {
}
}
}
capital_scope = {
remove_province_modifier = scoiatael_presence
any_neighbor_province = {
remove_province_modifier = scoiatael_presence
}
}
}

attacker_ai_victory_worth = { factor = -1 } # always accept
Expand Down Expand Up @@ -2473,9 +2485,8 @@ reclamation = { # Usable by elven and dwarven empires
allowed_to_target_suzerains = no

can_use = {
FROM = { NOT = { culture = wilderness } }
ROOT = { NOT = { culture = wilderness } }
ROOT = {
NOT = { culture = wilderness }
independent = yes
OR = {
culture = aen_seidhe
Expand All @@ -2485,6 +2496,15 @@ reclamation = { # Usable by elven and dwarven empires
}
NOT = { same_realm = FROM }
}
FROM = {
NOT = { culture = wilderness }
NOR = {
culture = aen_seidhe
culture = dwarven
culture = gnomish
culture = halfling
}
}
}

can_use_title = {
Expand Down
4 changes: 3 additions & 1 deletion MOD/Witcher/common/defines/W_override.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,7 @@ NDefines.NRulerDesigner.COST_MORALE_DEFENCE = 100.0
NDefines.NRulerDesigner.COST_DEFENCE = 100.0
NDefines.NRulerDesigner.MAX_AGE = 100
NDefines.NGraphics.NUMBER_OF_PROPERTIES = 16 -- Add two layers (p14 and p15) for pre-rendered portraits
NDefines.NEngine.HEALTH_IMMUNITY_TO_PRUNING = 7 -- Pruning - should exclude sorcerers and witchers
NDefines.NEngine.HEALTH_IMMUNITY_TO_PRUNING = 20 -- If a character has that much health, they won't be pruned
NDefines.NEngine.COURT_PRUNE_SIZE = 10 -- Courts larger than this will be checked for pruning each month
NDefines.NEngine.PRUNE_MINIMAL_AGE = 40 -- Minimum age for a courtier to be prunable if considered irrelevant
NDefines.NNomad.ALWAYS_GENERATE_NOMADS = 1 -- If turned on will generate nomads even if they are not playable
2 changes: 1 addition & 1 deletion MOD/Witcher/common/event_modifiers/W_event_modifiers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ province_looted = {
# W_scoiatael_events
scoiatael_presence = {
icon = 36
local_revolt_risk = 0.1
local_revolt_risk = 0.05
}
supports_scoiatael = {
icon = 36
Expand Down
4 changes: 2 additions & 2 deletions MOD/Witcher/common/objectives/00_factions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6154,14 +6154,14 @@ faction_claimant = {
factor = 0.75
crownlaw_title = {
title = e_nilfgaard
has_law = imperial_authority_3
has_law = imperial_authority_2
}
}
modifier = {
factor = 0.5
crownlaw_title = {
title = e_nilfgaard
has_law = imperial_authority_4
has_law = imperial_authority_3
}
}
}
Expand Down
25 changes: 1 addition & 24 deletions MOD/Witcher/common/scripted_effects/00_scripted_effects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7038,30 +7038,7 @@ print_scope_effect = {
}

add_sympathy_for_prevs_true_religion_effect = {
if = {
limit = { PREV = { true_religion_group_christian_trigger = yes } }
add_trait = sympathy_christendom
}
if = {
limit = { PREV = { true_religion_group_muslim_trigger = yes } }
add_trait = sympathy_islam
}
if = {
limit = { PREV = { true_religion_group_pagan_group_trigger = yes } }
add_trait = sympathy_pagans
}
if = {
limit = { PREV = { true_religion_group_zoroastrian_group_trigger = yes } }
add_trait = sympathy_zoroastrianism
}
if = {
limit = { PREV = { true_religion_group_jewish_group_trigger = yes } }
add_trait = sympathy_judaism
}
if = {
limit = { PREV = { true_religion_group_indian_group_trigger = yes } }
add_trait = sympathy_indian
}
# NOP
}

add_trait_for_prevs_secret_religion_society_effect = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,6 @@ is_unimportant_trigger = {
has_character_flag = eternal_life_mystic
trait = horse
has_character_modifier = in_seclusion
immortal = yes

trait = canon
trait = druid
Expand Down
10 changes: 5 additions & 5 deletions MOD/Witcher/common/traits/W_race_traits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ elf_race = {

intrigue = 4
fertility = -10
health = 25
health = 10

command_modifier = {
terrain = forest
Expand Down Expand Up @@ -63,7 +63,7 @@ dwarf_race = {
martial = 2

immortal = yes
health = 15
health = 10

command_modifier = {
terrain = mountain
Expand Down Expand Up @@ -103,7 +103,7 @@ halfling_race = {
martial = -2

immortal = yes
health = 15
health = 10

customizer = no
random = no
Expand Down Expand Up @@ -140,7 +140,7 @@ gnome_race = {
learning = 6

immortal = yes
health = 15
health = 10

customizer = no
random = no
Expand Down Expand Up @@ -201,7 +201,7 @@ dragon_race = { # Secret dragon trait
hidden_from_others = yes

immortal = yes
health = 25
health = 20
fertility = -10

combat_rating = 5
Expand Down
4 changes: 2 additions & 2 deletions MOD/Witcher/common/traits/W_special_traits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sorcerer = {
general_opinion = -5
sex_appeal_opinion = 5

health = 10
health = 25
fertility = -10
stewardship = -2
learning = 4
Expand Down Expand Up @@ -64,7 +64,7 @@ witcher = {
combat_rating = 3

fertility = -10
health = 20
health = 25
martial = 4
diplomacy = -2
}
Expand Down
42 changes: 35 additions & 7 deletions MOD/Witcher/decisions/W_marriage_decisions.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
decisions = {
marry_courtiers_human = { # Toggled
only_rulers = yes
only_playable = yes

potential = {
ai = no # Married courtiers are excluded from pruning, so this bloats A.I. courts.
any_courtier = {
NOT = { dynasty = ROOT }
should_marry_trigger = yes
Expand Down Expand Up @@ -56,8 +58,10 @@ decisions = {

marry_courtiers_dwarf = { # Toggled
only_rulers = yes
only_playable = yes

potential = {
ai = no # Married courtiers are excluded from pruning, so this bloats A.I. courts.
any_courtier = {
NOT = { dynasty = ROOT }
should_marry_trigger = yes
Expand Down Expand Up @@ -111,8 +115,10 @@ decisions = {

marry_courtiers_elf = { # Toggled
only_rulers = yes
only_playable = yes

potential = {
ai = no # Married courtiers are excluded from pruning, so this bloats A.I. courts.
any_courtier = {
NOT = { dynasty = ROOT }
should_marry_trigger = yes
Expand Down Expand Up @@ -166,8 +172,10 @@ decisions = {

marry_courtiers_halfling = { # Toggled
only_rulers = yes
only_playable = yes

potential = {
ai = no # Married courtiers are excluded from pruning, so this bloats A.I. courts.
any_courtier = {
NOT = { dynasty = ROOT }
should_marry_trigger = yes
Expand Down Expand Up @@ -221,8 +229,10 @@ decisions = {

marry_courtiers_gnome = { # Toggled
only_rulers = yes
only_playable = yes

potential = {
ai = no # Married courtiers are excluded from pruning, so this bloats A.I. courts.
any_courtier = {
NOT = { dynasty = ROOT }
should_marry_trigger = yes
Expand Down Expand Up @@ -288,7 +298,7 @@ decisions = {
trait = human_race
any_independent_ruler = {
any_realm_character = {
location = { is_within_diplo_range = ROOT }
is_within_diplo_range = ROOT
is_lowborn = no
should_marry_trigger = yes
is_female = yes
Expand All @@ -315,7 +325,7 @@ decisions = {
random_independent_ruler = {
random_realm_character = {
limit = {
location = { is_within_diplo_range = ROOT }
is_within_diplo_range = ROOT
is_lowborn = no
should_marry_trigger = yes
is_female = yes
Expand Down Expand Up @@ -360,7 +370,7 @@ decisions = {
trait = dwarf_race
any_independent_ruler = {
any_realm_character = {
location = { is_within_diplo_range = ROOT }
is_within_diplo_range = ROOT
is_lowborn = no
should_marry_trigger = yes
is_female = yes
Expand All @@ -387,7 +397,7 @@ decisions = {
random_independent_ruler = {
random_realm_character = {
limit = {
location = { is_within_diplo_range = ROOT }
is_within_diplo_range = ROOT
is_lowborn = no
should_marry_trigger = yes
is_female = yes
Expand Down Expand Up @@ -433,7 +443,7 @@ decisions = {
age = 50
any_independent_ruler = {
any_realm_character = {
location = { is_within_diplo_range = ROOT }
is_within_diplo_range = ROOT
is_lowborn = no
should_marry_trigger = yes
is_female = yes
Expand Down Expand Up @@ -461,7 +471,7 @@ decisions = {
random_independent_ruler = {
random_realm_character = {
limit = {
location = { is_within_diplo_range = ROOT }
is_within_diplo_range = ROOT
is_lowborn = no
should_marry_trigger = yes
is_female = yes
Expand Down Expand Up @@ -495,9 +505,15 @@ decisions = {

targetted_decisions = {
marry_courtier_human = {
only_playable = yes

filter = vassals
ai_target_filter = vassals

from_potential = {
ai = no
}

potential = {
is_ruler = no
should_marry_trigger = yes
Expand Down Expand Up @@ -684,9 +700,15 @@ targetted_decisions = {
}

marry_courtier_dwarf = {
only_playable = yes

filter = vassals
ai_target_filter = vassals

from_potential = {
ai = no
}

potential = {
is_ruler = no
should_marry_trigger = yes
Expand Down Expand Up @@ -893,8 +915,14 @@ targetted_decisions = {
}

marry_courtier_elf = {
only_playable = yes

filter = vassals
ai_target_filter = vassals
ai_target_filter = court

from_potential = {
ai = no
}

potential = {
is_ruler = no
Expand Down
Loading

0 comments on commit 699f583

Please sign in to comment.