csaiprpt.pl
csaiprpt.pl is a Perl script (program) to report AAI (so-called Adaptive AI) parameters in the .ai files.
(Note: In the course of preparing this, we implemented some fixes not available in the current public CSlint release. The updated csaiprpt.pl will be included in CSVN v1.20 and later. Until then, if you try the exercises following, your results might vary.)
Start by displaying the program help:
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -h
Usage: csaiprpt.pl [-h|-help] [{+|-}G|-debug] -g[ame] {me|vn|cw|ef|wf|pf} [{+|-}F|{+|-}show_files] [{+|-}N|{+|-}show_linenos] [-defaults] [-have] [-side] [-nation] [<parameters list>|-ALL] [-f <filename>]
parameters list:
-0 or -hot_max
-1 or -hot_trigger
-2 or -move_trigger_AttackStrong
-3 or -move_trigger_AttackWeak
-4 or -move_trigger_NoOrder
-5 or -move_trigger_DefendStrong
-6 or -move_trigger_DefendWeak
-7 or -move_trigger_doubletime
-8 or -move_doubletime_prob
-9 or -move_armor_standoff_prob
-10 or -move_runaway_prob
-11 or -move_leaderhq_runaway_prob
-12 or -move_takecover_prob
-13 or -move_bailout_prob
-14 or -move_exitmap_prob
-15 or -move_unload_prob
-16 or -move_cavejump_prob
-17 or -move_reinforce_bunker_prob
-18 or -unload
-19 or -standoff
-20 or -move_reserved_20
-21 or -move_reserved_21
-22 or -move_reserved_22
-23 or -move_reserved_23
-24 or -move_reserved_24
-25 or -move_reserved_25
-26 or -move_reserved_26
-27 or -move_reserved_27
-28 or -move_reserved_28
-29 or -move_reserved_29
-30 or -oplimit_tankfiring_hardtarget
-31 or -oplimit_tankfiring_softtarget
-32 or -oplimit_tankfiring_helotarget
-33 or -oplimit_tankfiring_othertarget
-34 or -oplimit_atfiring_hardtarget
-35 or -oplimit_atfiring_softtarget
-36 or -oplimit_atfiring_helotarget
-37 or -oplimit_atfiring_othertarget
-38 or -oplimit_aaafiring_hardtarget
-39 or -oplimit_aaafiring_softtarget
-40 or -oplimit_aaafiring_helotarget
-41 or -oplimit_aaafiring_othertarget
-42 or -oplimit_otherfiring_hardtarget
-43 or -oplimit_otherfiring_softtarget
-44 or -oplimit_otherfiring_helotarget
-45 or -oplimit_otherfiring_othertarget
-46 or -oplimit_reserved_46
-47 or -oplimit_reserved_47
-48 or -oplimit_reserved_48
-49 or -oplimit_reserved_49
-50 or -max_hex_if_attacks
-51 or -if_hardtarget_kill_prob
-52 or -blind_fire_prob
-53 or -if_moving_nonvehicle_target_hex_change_prob
-54 or -if_moving_vehicle_target_hex_change_prob
-51 or -if_spotted_scatter_prob
-56 or -if_unspotted_scatter_prob
-57 or -if_spotted_scatters
-58 or -if_unspotted_scatters
-59 or -if_obstructed_fire_capable
-60 or -leader_loss_prob
-61 or -fire_starshell_prob
-62 or -starshell_scatter_prob
-63 or -fire_smoke_prob
-64 or -banzai_prob
-65 or -direct_fire_at_civilians_prob
-66 or -fire_density_effect
-67 or -indirect_fire_at_civilians_prob
-68 or -indirect_fire_denied_prob
-69 or -combat_reserved_69
-70 or -fatigue_prob
-71 or -recover_from_fatigue_prob
-72 or -lose_morale_prob
-73 or -recover_morale_prob
-74 or -disrupt_prob
-75 or -undisrupt_prob
-76 or -morale_shift
-77 or -status_reserved_77
-78 or -status_reserved_78
-79 or -status_reserved_79
-80 or -atg_move_reveal_prob
-81 or -atg_fire_reveal_prob
-82 or -sneaker_move_reveal_prob
-83 or -sneaker_fire_reveal_prob
-84 or -vehicle_move_reveal_prob
-85 or -vehicle_fire_reveal_prob
-86 or -nonvehicle_move_reveal_prob
-87 or -nonvehicle_fire_reveal_prob
-88 or -concealment_reserved_88
-89 or -concealment_reserved_89
-90 or -supply_radius_modifier
-91 or -low_on_ammo_prob
-92 or -out_of_ammo_prob
-93 or -supply_reserved_93
-94 or -supply_reserved_94
-95 or -supply_reserved_95
-96 or -supply_reserved_96
-97 or -supply_reserved_97
-98 or -supply_reserved_98
-99 or -supply_reserved_99
-100 or -activity_reserved_100
-101 or -activity_reserved_101
-102 or -fortify_prob
-103 or -dig_prob
-104 or -build_light_bridge_prob
-105 or -build_vehicle_bridge_prob
-106 or -lay_minefield_prob
-107 or -set_ied_prob
-108 or -build_barrier_prob
-109 or -activity_reserved_109
-110 or -bad_health
-111 or -good_health
-112 or -cave_capable
-113 or -banzai_capable
-114 or -unit_color
-115 or -misc_reserved_115
-116 or -misc_reserved_116
-117 or -misc_reserved_117
-118 or -misc_reserved_118
-119 or -misc_reserved_119
-120 or -opfire_range_prob_factor
-121 or -opfire_ground_prob
-122 or -opfire_air_prob
-123 or -opfire_airstrike_prob
-124 or -opfire_reserved_124
-125 or -opfire_reserved_125
-126 or -max_hex_opfire_attacks
-127 or -opfire_airstrike_fire_effect
-128 or -opfire_airstrike_low_flying_fire_effect
-129 or -opfire_reserved_129
-130 or -dirfire_sam2helolow_prob
-131 or -dirfire_sam2helohigh_prob
-132 or -opfire_sam2helolow_prob
-133 or -opfire_sam2helohigh_prob
-134 or -opfire_sam2helo_prob
-135 or -sam_reserved_135
-136 or -sam_reserved_136
-137 or -sam_reserved_137
-138 or -sam_reserved_138
-139 or -sam_reserved_139
-140 or -helo_turns_until_refuel
-141 or -helo_refuel_forced_landing_prob
-142 or -helo_reserved_142
-143 or -helo_reserved_143
-144 or -helo_reserved_144
-145 or -helo_reserved_145
-146 or -helo_reserved_146
-147 or -helo_reserved_147
-148 or -helo_reserved_148
-149 or -helo_reserved_149
-150 or -direct_fire_low_on_ammo_effect
-151 or -direct_fire_fatigued_effect
-152 or -direct_fire_disrupted_effect
-153 or -direct_fire_doubletime_effect
-154 or -direct_fire_reduced_aa_effect
-155 or -direct_fire_dig_in_effect
-156 or -direct_fire_flank_effect
-157 or -direct_fire_slow_fliers_aa_effect
-158 or -direct_fire_recon_effect
-159 or -direct_fire_fast_effect
-160 or -assault_attack_low_on_ammo_effect
-161 or -assault_attack_fatigued_effect
-162 or -assault_attack_aggressiveness_effect
-163 or -assault_attack_mounted_effect
-164 or -assault_attack_halftrack_effect
-165 or -assault_attack_vehicle_hard_terrain_effect
-166 or -assault_attack_vehicle_soft_terrain_effect
-167 or -assault_attack_nofire_nomove_effect
-168 or -assault_attack_night_effect
-169 or -assault_attack_flank_effect
-170 or -assault_defense_low_on_ammo_effect
-171 or -assault_defense_fatigued_effect
-172 or -assault_defense_disrupted_effect
-173 or -assault_defense_dig_in_effect
-174 or -assault_defense_hardtarget_soft_terrain_effect
-175 or -assault_defense_vehicle_urban_effect
-176 or -assault_defense_nofire_nomove_effect
-177 or -assault_defense_disrupted_morale_adjustment
-178 or -assault_defense_flank_morale_adjustment
-179 or -assault_defense_reserved_179
-180 or -spotter_prob
-181 or -air_spotter_prob
-182 or -recon_reveal_prob
-183 or -air_recon_reveal_prob
-184 or -recon_reveal_cost
-185 or -visibility_reserved_185
-186 or -visibility_reserved_186
-187 or -visibility_reserved_187
-188 or -visibility_reserved_188
-189 or -visibility_reserved_189
-190 or -airstrike_prob
-191 or -airstrike_denied_prob
-192 or -aircraft_loiter_refuel_effect
-193 or -airstrike_strength
-194 or -airstrike_spotted_scatter_prob
-195 or -airstrike_unspotted_scatter_prob
-196 or -airstrike_spotted_scatters
-197 or -airstrike_unspotted_scatters
-198 or -airstrike_attack_hard
-199 or -airstrike_attack_soft
-200 or -airstrike_ground_attack_accuracy_effect
-201 or -airstrike_low_flying_accuracy_effect
-202 or -airstrike_guns_accuracy_effect
-203 or -airstrike_dive_bomber_accuracy_effect
-204 or -airstrike_smart_munitions_accuracy_effect
-205 or -airstrike_fire_forget_accuracy_effect
-206 or -airstrike_smart_munitions_hardtarget_effect
-207 or -air_reserved_207
-208 or -air_reserved_208
-209 or -air_reserved_209
-210 or -airstrike_bombs_disrupt_effect
-211 or -airstrike_rockets_disrupt_effect
-212 or -airstrike_ground_attack_disrupt_effect
-213 or -airstrike_napalm_disrupt_effect
-214 or -air_reserved_214
-215 or -air_reserved_215
-216 or -air_reserved_216
-217 or -air_reserved_217
-218 or -air_reserved_218
-219 or -air_reserved_219
Whoa! That's a lot of parameters. (In future, we will probably add still more.)
Let's begin simply by showing the hard-coded, initialization defaults for the first two AAI parameters, in the general AAI file, init.ai. We do this for the Middle East game:
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -g me -defaults -0 -1 -f init.ai
init.ai
d 12 6
Instead of specifying by parameter number (with #s starting from 0!), let's repeat the previous command, but with the parameter names:
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -g me -defaults -hot_max -hot_trigger -f init.ai
init.ai
d 12 6
Let's now see, for s[ide] lines, the parameter values for fire_starshell_prob & starshell_scatter_prob:
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -g me -defaults -side -fire_starshell_prob -starshell_scatter_prob -f init.ai
init.ai
d 80 40
s 0 A -1 -1
s 1 B -1 -1
The default fire_starshell_prob is 80, while the default starshell_scatter_prob is 40. There are no side overrides; in each case, for either side, the -1 indicate defer to the defaults.
Let's add n[ation] lines to the display:
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -g me -defaults -side -nation -fire_starshell_prob -starshell_scatter_prob -f init.ai
init.ai
d 80 40
s 0 A -1 -1
s 1 B -1 -1
n 8 XFranceNation 72 28
n 9 XUnitedKingdomNation 72 28
n 14 XGenericProWestNation 52 38
n 22 XIsraelNation 76 26
n 23 XEgyptNation 60 34
n 24 XIraqNation 56 36
n 25 XJordanNation 64 32
n 26 XSyriaNation 56 36
n 27 XLebanonNation 60 34
n 28 XGenericProEastNation 52 38
n 29 XLibyaNation 56 36
n 30 XAlgeriaNation 56 36
For each nation, the indicated probs, since they are not -1, they all override the default prob values.
You can see where, compared to the Arab nations, the Israelis, French & British tend to have higher fire_starshell_prob (greater chance of success), while the tendency of their starshells (flares) to scatter is lower.
Switching now to Vietnam, let's see the assault_attack_aggressiveness_effect & assault_attack_night_effect:
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -g vn -defaults -side -nation -assault_attack_aggressiveness_effect -assault_attack_night_effect -f init.ai
init.ai
d 100 100
s 0 A -1 -1
s 1 B -1 -1
n 0 XPeoplesRepublicOfChinaNation 105 90
n 8 XFranceNation 97 92
n 10 XUnitedStatesOfAmericaNation 98 94
n 11 XRepublicOfVietnamNation 74 70
n 12 XSouthKoreaNation 86 86
n 13 XLaosNation 80 82
n 17 XNewZealandNation 98 94
n 19 XAustraliaNation 98 94
n 21 XPeoplesRepublicOfVietnamNation 120 119
n 49 XCambodiaNation 80 82
n 50 XThailandNation 88 90
Compare the XRepublicOfVietnamNation (ARVN) values, 74 70, to the XPeoplesRepublicOfVietnamNation (VC/NVA), 120 119. You can now begin to see why the ARVN have such a tough time fighting the Communists.
Let's take a look at those aggressiveness effects in the scenario .ai file VN_550429_Saigon.ai:
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -g vn -defaults -side -nation -assault_attack_aggressiveness_effect -assault_attack_night_effect -f VN_550429_Saigon.ai
Scenarios/VN_550429_Saigon.ai
d 100 100
s 0 A -1 -1
s 1 B -1 -1
n 0 XPeoplesRepublicOfChinaNation -1 -1
n 8 XFranceNation -1 -1
n 10 XUnitedStatesOfAmericaNation -1 -1
n 11 XRepublicOfVietnamNation -1 -1
n 12 XSouthKoreaNation -1 -1
n 13 XLaosNation -1 -1
n 17 XNewZealandNation -1 -1
n 19 XAustraliaNation -1 -1
n 21 XPeoplesRepublicOfVietnamNation 74 70
n 49 XCambodiaNation -1 -1
n 50 XThailandNation -1 -1
You can see where the XRepublicOfVietnamNation (ARVN) values are -1. Which means that we defer to the init.ai values, 74 70. (See the earlier init.ai example.)
For n[ation] 21, the general init.ai values are 120 119. But in the case of the VN_550429_Saigon scenario, we override those general values with the scenario specific values 74 70, same as the n[ation] 11 values. This is because in this scenario, the ARVN are not fighting VC (or NVA), rather the BX Army, which is generally equivalent in character to the ARVN. (It's complicated. See the Adaptive AI reference in the Manual folder for more details.)
Note that if you omit the '-f <file>' in the csaiprpt.pl command line, it will show the indicated AAI parameter values for the init.ai file and any scenario-specific .ai file. In the Vietnam game, currently there is just the one scenario .ai file. The previous commands omitting the '-f <file>':
rober@Rob10rto ~/cslint
$
./csaiprpt.pl -g vn -defaults -side -nation -assault_attack_aggressiveness_effect -assault_attack_night_effect
init.ai
d 100 100
s 0 A -1 -1
s 1 B -1 -1
n 0 XPeoplesRepublicOfChinaNation 105 90
n 8 XFranceNation 97 92
n 10 XUnitedStatesOfAmericaNation 98 94
n 11 XRepublicOfVietnamNation 74 70
n 12 XSouthKoreaNation 86 86
n 13 XLaosNation 80 82
n 17 XNewZealandNation 98 94
n 19 XAustraliaNation 98 94
n 21 XPeoplesRepublicOfVietnamNation 120 119
n 49 XCambodiaNation 80 82
n 50 XThailandNation 88 90
Scenarios/VN_550429_Saigon.ai
d 100 100
s 0 A -1 -1
s 1 B -1 -1
n 0 XPeoplesRepublicOfChinaNation -1 -1
n 8 XFranceNation -1 -1
n 10 XUnitedStatesOfAmericaNation -1 -1
n 11 XRepublicOfVietnamNation -1 -1
n 12 XSouthKoreaNation -1 -1
n 13 XLaosNation -1 -1
n 17 XNewZealandNation -1 -1
n 19 XAustraliaNation -1 -1
n 21 XPeoplesRepublicOfVietnamNation 74 70
n 49 XCambodiaNation -1 -1
n 50 XThailandNation -1 -1
Scenarios/_scenario_boilerplate.ai
d 100 100
s 0 A -1 -1
s 1 B -1 -1
n 98 UNUSED -1 -1
n 99 UNUSED -1 -1
In the examples, you are not seeing csaiprpt.pl output to best effect. This is because the Forum software strips out extra spaces, hence this command's careful output formatting. At the Linux command line, this is actually how the previous command and its output would appear:
- csaiprpt1.JPG (63.25 KiB) Viewed 2515 times
You will see many other examples of csaiprpt.pl usage in this and other threads (including further explanation of using other WSL Linux tools). But the above should be enough to get you started.
If you have questions, just ask here in the Forum.
Good luck! Happy data mining!