Skip to content

Commit

Permalink
define to allow running military tick all ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nivaturimika committed Jul 9, 2024
1 parent 335328b commit abc003f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gamestate/serialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ inline uint8_t const* deserialize(uint8_t const* ptr_in, ankerl::unordered_dense
return ptr_in + sizeof(uint32_t) + sizeof(vec.values()[0]) * length;
}

constexpr inline uint32_t save_file_version = 40;
constexpr inline uint32_t save_file_version = 41;
constexpr inline uint32_t scenario_file_version = 130 + save_file_version;

struct scenario_header {
Expand Down
26 changes: 21 additions & 5 deletions src/gamestate/system_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4200,6 +4200,12 @@ void state::single_game_tick() {
ai::update_ai_colonial_investment(*this);
}

if(defines.alice_eval_ai_mil_everyday) {
ai::make_defense(*this);
ai::make_attacks(*this);
ai::update_ships(*this);
}

// Once per month updates, spread out over the month
switch(ymd_date.day) {
case 1:
Expand All @@ -4216,15 +4222,19 @@ void state::single_game_tick() {
break;
case 4:
military::reinforce_regiments(*this);
ai::make_defense(*this);
if(!bool(defines.alice_eval_ai_mil_everyday)) {
ai::make_defense(*this);
}
break;
case 5:
rebel::update_movements(*this);
rebel::update_factions(*this);
break;
case 6:
ai::form_alliances(*this);
ai::make_attacks(*this);
if(!bool(defines.alice_eval_ai_mil_everyday)) {
ai::make_attacks(*this);
}
break;
case 7:
ai::update_ai_general_status(*this);
Expand Down Expand Up @@ -4270,7 +4280,9 @@ void state::single_game_tick() {
break;
case 20:
nations::monthly_flashpoint_update(*this);
ai::make_defense(*this);
if(!bool(defines.alice_eval_ai_mil_everyday)) {
ai::make_defense(*this);
}
break;
case 21:
ai::update_ai_colony_starting(*this);
Expand All @@ -4284,7 +4296,9 @@ void state::single_game_tick() {
break;
case 24:
rebel::execute_rebel_victories(*this);
ai::make_attacks(*this);
if(!bool(defines.alice_eval_ai_mil_everyday)) {
ai::make_attacks(*this);
}
rebel::update_armies(*this);
rebel::rebel_hunting_check(*this);
break;
Expand All @@ -4304,7 +4318,9 @@ void state::single_game_tick() {
ai::update_war_intervention(*this);
break;
case 30:
ai::update_ships(*this);
if(!bool(defines.alice_eval_ai_mil_everyday)) {
ai::update_ships(*this);
}
rebel::update_armies(*this);
rebel::rebel_hunting_check(*this);
break;
Expand Down
1 change: 1 addition & 0 deletions src/parsing/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@
LUA_DEFINES_LIST_ELEMENT(alice_spherelings_only_ally_sphere, 0.0) \
LUA_DEFINES_LIST_ELEMENT(alice_overseas_mil, 0.1) \
LUA_DEFINES_LIST_ELEMENT(alice_rgo_per_size_employment, 40000.0) \
LUA_DEFINES_LIST_ELEMENT(alice_eval_ai_mil_everyday, 0.0) \

// scales the needs values so that they are needs per this many pops
// this value was arrived at by looking at farmers: 40'000 farmers produces enough grain to satisfy about 2/3
Expand Down

0 comments on commit abc003f

Please sign in to comment.