Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ai improvement #264

Merged
merged 7 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion common/defines/cwp_defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ NAI = {
TRADE_ROUTE_IMPORT_SCORE_MULT = 1.0 # How much does AI multiply score of import routes
TRADE_ROUTE_EXPORT_SCORE_MULT = 1.5 # How much does AI multiply score of export routes
TRADE_ROUTE_DURATION_FACTOR = 10.0 # AI multiplies value of a route by ( 1 + this ) at COMPETITIVENESS_DURATION_BONUS_MAX_MONTHS (scales linearly up to this value at a lower duration)


# Below data is used to determine how the AI invests into institution
#TODO FIX AI somehow, IT DOES NOT INVEST IN INSTITUTION ENOUGH

INSTITUTION_INVESTMENT_RANDOM_FACTOR = 1.0 # The higher this is, the more random AI institution selection will be
INSTITUTION_CURRENT_INVESTMENT_DIVISOR = 0.25 # Score for institution is divided by 1 + ( current levels after the first * this )
MAX_INSTITUTION_SPENDING = 0.02 # AI will not spend more BUR than this on institutions (scaled by weekly GDP)
INSTITUTION_SPENDING_INCREASE_SPENDING_RATIO = 1.0 # If current + additional institution spending is equal or less than max spending * this, try to improve some institutions
INSTITUTION_SPENDING_DECREASE_SPENDING_RATIO = 2.0 # If current institution spending is at least max spending * this, try to degrade some institutions

}

NCharacters = {
Expand Down Expand Up @@ -233,7 +244,8 @@ NPops = {
LOW_POP_THRESHOLD = 50000 # If a state has less than this amount of pops per arable land, apply the low pop modifier
HIGH_POP_THRESHOLD = 100000 # If a state has more than this amount of pops per arable land, apply the high pop modifier

POP_MERGE_MAX_WORKFORCE = 300 # Pops with workforce smaller than this may get merged with other pops of the same type in their building / unemployment pool; if zero, no small pop merging will occur, which may have an adverse effect on late-game performance
POP_MERGE_MIN_NUM_POPS_SAME_PROFESSION = 1 # Employed Pops will not get merged with others in their same building if there aren't at least this many Pops of the same type in the building
POP_MERGE_MAX_WORKFORCE = 100000 # Pops with workforce smaller than this may get merged with other pops of the same type in their building / unemployment pool; if zero, no small pop merging will occur, which may have an adverse effect on late-game performance
}

### Pop Growth Constants
Expand Down
3 changes: 2 additions & 1 deletion common/script_values/aroai_budgeting_values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -530,14 +530,15 @@ aroai_weeks_of_reserves_for_health_3 = 312
# How many construction point is needed max if workforce is the bottleneck
aroai_max_wanted_constructions_depense_from_pop = {
value = aroai_max_wanted_constructions_points_from_pop
max = 11000 #AROAI struggle to use more
multiply = aroai_building_construction_sector_expenses_per_point
}

# does NOT assume that we pay for private queue
# What would be the share of remaining budget if workforce is the bottleneck
aroai_max_wanted_constructions_revenue_share_from_pop = {
value = aroai_max_wanted_constructions_depense_from_pop
divide = aroai_revenue_left_for_construction_military # maybe should i use income ?
divide = { value = aroai_revenue_left_for_construction_military min = 1 }
}


Expand Down
19 changes: 9 additions & 10 deletions common/script_values/aroai_construction_values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,25 @@ aroai_max_wanted_constructions_points_from_pop = {
aroai_max_wanted_constructions_points = {
value = aroai_max_wanted_constructions_points_from_pop
max = aroai_max_wanted_constructions_points_from_budget
min = 5
}


aroai_max_wanted_constructions_points_20_percent_more = {
aroai_max_wanted_constructions_points_doubled = {
value = aroai_max_wanted_constructions_points
multiply = 1.2
multiply = 2
add = 200 # we always could help 200 cp
}

aroai_max_wanted_constructions_points_20_percent_less = {
value = aroai_max_wanted_constructions_points
multiply = 0.8
aroai_current_constructions_points_percent_of_max_wanted = {
value = aroai_construction_points_current
divide = aroai_max_wanted_constructions_points
}



aroai_simultaneous_constructions = {
value = aroai_construction_points_current
divide = aroai_construction_points_per_building
max = {
value = aroai_millions_of_minus_half_unincorporated_population
multiply = 1.15
}
}

aroai_simultaneously_developed = {
Expand Down
Loading