Coder Diary #30 -- The Adaptive A/I, part 1
[This Coder Diary is an adaptation, an abridgement, of the AdaptiveAI PDF included in the Middle East game's manual folder.]
The Campaign Series A/I -- One size does not fit all!
Arabs did not fight the same way as Israelis. Jordanians outclassed the Egyptians, who outclassed the Syrians. Israel's combat doctrines changed from 1948 to 1956 to 1967 to 1973 and beyond. The cocky Israelis at the beginning of the Yom Kippur War learned to give their revitalized Egyptian foes newfound respect, and learned to change their ways. Adapt or die.
From nation to nation, from war to war, from year to year, even from one battle to the next -- they all differed, so much evolved.
But in the traditional Campaign Series, as in most (all?) war games, there is one and only one A/I. Locked down tight. Mostly inaccessible to the scenario designer, much less to the player.
Until now...
We have devised a new customizable A/I System. Customizable by side, by nation, by scenario. Open to the scenario designer's tweaking. Also the modder's.
We call this new system: "Adaptive A/I." As in: An A/I that adapts to the side, the nation, the era, the individual scenario. (Not as in: Adapts real-time to changing game play circumstances. But that too will be implemented in future updates.)
The purposes of the Adaptive A/I are:
[*]To coach the A/I in ways and things it is too dumb to figure out by itself.
[*]To achieve game play "balance".
[*]Not so much to improve the A/I play as to better simulate actual combatant and scenario conditions. To achieve greater "realism" and "historical fidelity".
[*]To add randomness.
[*]Thereby increasing replayability.
These cross purposes are often at odds with one another. Some Adaptive A/I parameters will make the A/I opponent "better"; others will make it "worse". It all depends. Some players will like the increased uncertainty; others will not. It all depends. That's why the Adaptive A/I is optional. Select it or not as you wish.

THE NITTY GRITTY DETAILS
How does it all work?
There are two .ai specification files, or classes of files:
[*]init.ai -- in the top-level game folder; general specifications
[*]<scenario>.ai -- in the scenarios folder; per-scenario customizations
In each .ai file, there are:
[*]side (0 or 1, i.e., A or B) specifications, lines beginning with 's <side #>', followed by a series of integer values
[*]nation (0 to 100) specifications, lines beginning with 'n <nation #>', followed by a series of integer values
[*]either blank lines, or comment lines, both of which are ignored; comments are indicated by '#' -- anything following is disregarded
INIT.AI
Here for example is the ME (1.00) game's overarching init.ai file:
###############################################################################
# init.ai
###############################################################################
# AI parameters
# 0-29 movement
# 0 [sn] AI_hot_max // Maximum hot value.
# 1 [sn] AI_hot_trigger // Value which causes hex to be hot.
# 2 [sn] AI_move_trigger_AttackHigh // Move trigger for AttackHigh order type.
# 3 [sn] AI_move_trigger_AttackLow // Move trigger for AttackLow order type.
# 4 [sn] AI_move_trigger_NoOrder // Move trigger for NoOrder order type.
# 5 [sn] AI_move_trigger_DefendHigh // Move trigger for DefendHigh order type.
# 6 [sn] AI_move_trigger_DefendLow // Move trigger for DefendLow order type.
# 7 [ n] AI_move_trigger_doubletime // How far away the enemy should be to permit doubletime movement.
# 8 [ n] AI_move_doubletime_prob // Probability of doubletime moving.
# 9 [ n] AI_move_armor_standoff_prob // Probability of halting advance in presence of enemy armor.
# 10 [ n] AI_move_runaway_prob // Probability unit will run away from enemy units.
# 11 [ n] AI_move_leaderhq_runaway_prob // Probability unescorted HQs/leaders will run away from enemy units.
# 12 [ n] AI_move_takecover_prob // Probability unit will take cover in presence of enemy units.
# 13 [ n] AI_move_bailout_prob // Probability unloaded, non-fighting unit will exit map in presence of danger.
# 14 [ n] AI_move_exitmap_prob // Probability unit will exit map.
# 15 [ n] AI_move_unload_prob // Probability unit will unload in presence of enemy units.
# 16 [ n] AI_move_cavejump_prob // Probability unit will cave jump.
# 17 [ n] AI_move_reinforce_bunker_prob // Probability unit will move into bunker or pillbox.
# 18 [ n] AI_unload // Unload distance.
# 19 [ n] AI_standoff // Stand-off distance for vulnerable units.
# 20 [ ] AI_move_reserved_20
# 21 [ ] AI_move_reserved_21
# 22 [ ] AI_move_reserved_22
# 23 [ ] AI_move_reserved_23
# 24 [ ] AI_move_reserved_24
# 25 [ ] AI_move_reserved_25
# 26 [ ] AI_move_reserved_26
# 27 [ ] AI_move_reserved_27
# 28 [ ] AI_move_reserved_28
# 29 [ ] AI_move_reserved_29
# 30-49 opfire (opportunity fire)
# for the oplimit_* parameters, 3, 2, 1 & 0 signify Long, Medium, Short & Never
# 30 [ n] AI_oplimit_tankfiring_hardtarget // must be first opfire AIparameter! see src/forces/forces.cpp:Forces::OpFire()
# 31 [ n] AI_oplimit_tankfiring_softtarget
# 32 [ n] AI_oplimit_tankfiring_helotarget
# 33 [ n] AI_oplimit_tankfiring_othertarget
# 34 [ n] AI_oplimit_atfiring_hardtarget
# 35 [ n] AI_oplimit_atfiring_softtarget
# 36 [ n] AI_oplimit_atfiring_helotarget
# 37 [ n] AI_oplimit_atfiring_othertarget
# 38 [ n] AI_oplimit_aaafiring_hardtarget
# 39 [ n] AI_oplimit_aaafiring_softtarget
# 40 [ n] AI_oplimit_aaafiring_helotarget
# 41 [ n] AI_oplimit_aaafiring_othertarget
# 42 [ n] AI_oplimit_otherfiring_hardtarget
# 43 [ n] AI_oplimit_otherfiring_softtarget
# 44 [ n] AI_oplimit_otherfiring_helotarget
# 45 [ n] AI_oplimit_otherfiring_othertarget
# 46 [ ] AI_oplimit_reserved_46
# 47 [ ] AI_oplimit_reserved_47
# 48 [ ] AI_oplimit_reserved_48
# 49 [ ] AI_oplimit_reserved_49
# 50-59 IF (indirect fire)
# 50 [ n] AI_max_hex_if_attacks // Maximum # of IF attacks per phase against single hex.
# 51 [ n] AI_if_scatters // # of IF scatters.
# 52 [ n] AI_blind_fire_prob // Probability of blind IF.
# 53 [ n] AI_if_moving_nonvehicle_target_hex_change_prob // Probability IF moving nonvehicle target hex will change in the direction of movement.
# 54 [ n] AI_if_moving_vehicle_target_hex_change_prob // Probability IF moving vehicle target hex will change in the direction of movement.
# 55 [sn] AI_if_hardtarget_kill_prob // Probability of IF fire scoring kill against hard target.
# 56 [ ] AI_if_reserved_56
# 57 [ ] AI_if_reserved_57
# 58 [ ] AI_if_reserved_58
# 59 [ ] AI_if_reserved_59
# 60-69 combat, direct fire, assault
# 60 [ n] AI_leader_loss_prob // Probability leader loss when stacked with other units.
# 61 [ n] AI_fire_starshell_prob // Probability of unit firing starshell/flare.
# 62 [ n] AI_starshell_scatter_prob // Probability starshell will scatter one hex in a random direction.
# 63 [ n] AI_fire_smoke_prob // Probability of unit firing smoke.
# 64 [ n] AI_banzai_prob // Probability org wil banzai attack.
# 65 [ ] AI_combat_reserved_65
# 66 [ ] AI_combat_reserved_66
# 67 [ ] AI_combat_reserved_67
# 68 [ ] AI_combat_reserved_68
# 69 [ ] AI_combat_reserved_69
# 70-79 fatigue, morale, disruption, leadership, command
# 70 [ n] AI_fatigue_prob // Probability doubletiming unit will become fatigued.
# 71 [ n] AI_recover_from_fatigue_prob // Probability a fatigued unit will recover.
# 72 [ n] AI_lose_morale_prob // Probability unit will lose morale.
# 73 [ n] AI_recover_morale_prob // Probability unit will recover morale.
# 74 [ n] AI_disrupt_prob // Probability unit will become disrupted.
# 75 [ n] AI_undisrupt_prob // Probability unit will undisrupt.
# 76 [ ] AI_status_reserved_76
# 77 [ ] AI_status_reserved_77
# 78 [ ] AI_status_reserved_78
# 79 [ ] AI_status_reserved_79
# 80-89 visibility, spotting
# 80 [ n] AI_atg_move_reveal_prob // Probability moving ATG unit will lose concealment.
# 81 [ n] AI_sneaker_move_reveal_prob // Probability moving Sneaker unit will lose concealment.
# 82 [ n] AI_atg_fire_reveal_prob // Probability firing ATG unit will lose concealment.
# 83 [ n] AI_sneaker_fire_reveal_prob // Probability firing Sneaker unit will lose concealment.
# 84 [ n] AI_spotter_prob // Probability unit will perform spotter function
# 85 [ n] AI_air_spotter_prob // Probability unit will perform air spotter function
# 86 [ ] AI_sight_reserved_86
# 87 [ ] AI_sight_reserved_87
# 88 [ ] AI_sight_reserved_88
# 89 [ ] AI_sight_reserved_89
# 90-99 supply, ammo
# 90 [ n] AI_supply_radius_modifier // Supply radius modifier %. Possible override to main.pdt values.
# 91 [ n] AI_low_on_ammo_prob // Probability unit will go low on ammo.
# 92 [ n] AI_out_of_ammo_prob // Probability unit will go out of ammo.
# 93 [ ] AI_supply_reserved_93
# 94 [ ] AI_supply_reserved_94
# 95 [ ] AI_supply_reserved_95
# 96 [ ] AI_supply_reserved_96
# 97 [ ] AI_supply_reserved_97
# 98 [ ] AI_supply_reserved_98
# 99 [ ] AI_supply_reserved_99
# 100-109 activity
# 100 [ ] AI_activity_reserved_100
# 101 [ ] AI_activity_reserved_101
# 102 [ ] AI_activity_reserved_102
# 103 [ n] AI_dig_prob // Probability of digging in.
# 104 [ n] AI_build_hexside_bridge_prob // Probability of successfully building hexside_bridge
# 105 [ n] AI_build_vehicle_bridge_prob // Probability of successfully building vehicle_bridge
# 106 [ n] AI_lay_minefield_prob // Probability of successfully laying minefield
# 107 [ n] AI_set_ied_prob // Probability of successfully setting IED
# 108 [ n] AI_build_barrier_prob // Probability of successfully building barrier
# 109 [ ] AI_activity_reserved_109
# 110-119 misc
# 110 [s ] AI_bad_health // Bad health value.
# 111 [s ] AI_good_health // Good health value.
# 112 [ n] AI_cave_capable // Has special cave capabilities.
# 113 [ n] AI_banzai_capable // Has special banzai/human wave capabilities.
# 114 [ ] AI_misc_reserved_114
# 115 [ ] AI_misc_reserved_115
# 116 [ ] AI_misc_reserved_116
# 117 [ ] AI_misc_reserved_117
# 118 [ ] AI_misc_reserved_118
# 119 [ ] AI_misc_reserved_119
# 120-129 opfire (opportunity fire)
# 120 [ n] AI_opfire_range_prob_factor // Where general opfire range_prob = opfire_range_prob_factor / (10.0*(range+1.0))
# 121 [ n] AI_opfire_ground_prob // Probability of per-attempt opfire against ground units.
# 122 [ n] AI_opfire_air_prob // Probability of per-attempt opfire against air units.
# 123 [ n] AI_opfire_sam2helo_prob // Probability of per-attempt SAM opfire against helos.
# 124 [ n] AI_opfire_airstrike_prob // Probability of per-attempt opfire against airstrikes.
# 125 [ ] AI_opfire_reserved_125
# 126 [ n] AI_max_hex_opfire_attacks // Maximum # of opfire attacks per phase against single hex.
# 127 [ n] AI_opfire_airstrike_fire_effect // Non AA % of normal attack value against airstrikes.
# 128 [ ] AI_opfire_reserved_128
# 129 [ ] AI_opfire_reserved_129
###############################################################################
# _AId constant defaults
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
# 12 6 0 2 3 4 6 4 100 100 100 100 100 100 100 100 100 100 2 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 2 15 50 70 10 -1 -1 -1 -1 -1 40 40 10 100 -1 -1 -1 -1 -1 100 100 35 100 100 100 -1 -1 -1 -1 60 40 50 5 100 100 -1 -1 -1 -1 -1 100 100 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 25 20 20 60 50 20 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 100 100 100 25 -1 3 50 -1 -1
###############################################################################
# side A & B (0 & 1) _AIs
# side A (0) is generally Israeli, side B (1) generally Arab
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
s 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
s 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
###############################################################################
# nation _AIn
#
# nation types:
#
# 0 XPeoplesRepublicOfChinaNation
# 1 XCzechoslovakiaNation
...
# 8 XFranceNation // MIDDLE EAST
# 9 XUnitedKingdomNation // MIDDLE EAST
...
# 14 XGenericProWestNation // MIDDLE EAST
...
# 22 XIsraelNation // MIDDLE EAST
# 23 XEgyptNation // MIDDLE EAST
# 24 XIraqNation // MIDDLE EAST
# 25 XJordanNation // MIDDLE EAST
# 26 XSyriaNation // MIDDLE EAST
# 27 XLebanonNation // MIDDLE EAST
# 28 XGenericProEastNation // MIDDLE EAST
# 29 XLibyaNation // MIDDLE EAST
# 30 XAlgeriaNation // MIDDLE EAST
...
# 83 XYemenNation
# 84 XSwitzerlandNation
# 85 [undefined]
# .. [undefined]
# 99 [undefined]
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
n 8 -1 -1 -1 -1 -1 -1 -1 -1 95 82 39 90 90 85 50 97 99 87 4 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 4 1 20 55 75 10 -1 -1 -1 -1 3 44 36 15 -1 -1 -1 -1 -1 -1 75 95 25 98 98 98 -1 -1 -1 -1 60 40 40 5 97 97 -1 -1 -1 -1 -1 85 85 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 35 28 30 65 45 35 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 95 95 95 25 -1 3 50 -1 -1
n 9 -1 -1 -1 -1 -1 -1 -1 -1 95 82 39 90 90 85 50 96 99 87 4 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 4 1 20 55 70 10 -1 -1 -1 -1 3 44 36 15 -1 -1 -1 -1 -1 -1 75 95 25 97 97 97 -1 -1 -1 -1 60 40 40 5 97 97 -1 -1 -1 -1 -1 85 85 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 33 28 30 65 45 30 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 95 95 95 25 -1 3 50 -1 -1
n 14 -1 -1 -1 -1 -1 -1 -1 -1 50 95 82 96 70 73 73 96 98 95 2 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 1 3 10 45 55 5 -1 -1 -1 -1 8 32 43 10 -1 -1 -1 -1 -1 -1 99 55 45 85 85 85 -1 -1 -1 -1 65 45 55 10 87 87 -1 -1 -1 -1 -1 97 97 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 15 15 15 67 54 25 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 35 35 35 25 -1 2 50 -1 -1
n 22 -1 -1 -1 -1 -1 -1 -1 -1 90 83 41 90 90 85 50 96 99 86 4 7 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 4 2 20 50 70 8 -1 -1 -1 -1 5 42 36 15 -1 -1 -1 -1 -1 -1 75 95 25 98 97 98 -1 -1 -1 -1 60 40 50 6 94 94 -1 -1 -1 -1 -1 86 86 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 25 22 20 62 42 30 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 80 80 80 25 -1 3 50 -1 -1
n 23 -1 -1 -1 -1 -1 -1 -1 -1 60 95 85 96 87 95 80 96 99 96 4 7 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 3 2 15 45 55 6 -1 -1 -1 -1 5 40 38 10 -1 -1 -1 -1 -1 -1 99 70 40 90 90 85 -1 -1 -1 -1 65 45 55 7 90 90 -1 -1 -1 -1 -1 93 93 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 15 20 20 62 42 24 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 80 75 75 25 -1 3 50 -1 -1
n 24 -1 -1 -1 -1 -1 -1 -1 -1 50 93 65 95 71 85 65 96 99 95 3 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 2 2 15 40 55 5 -1 -1 -1 -1 8 37 42 10 -1 -1 -1 -1 -1 -1 99 60 45 90 90 90 -1 -1 -1 -1 65 50 60 8 89 89 -1 -1 -1 -1 -1 94 94 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 15 18 15 60 41 22 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 60 50 50 25 -1 2 50 -1 -1
n 25 -1 -1 -1 -1 -1 -1 -1 -1 60 80 63 96 87 85 60 96 99 92 4 7 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 3 2 20 50 60 6 -1 -1 -1 -1 4 41 39 14 -1 -1 -1 -1 -1 -1 99 70 40 95 90 95 -1 -1 -1 -1 65 45 55 6 92 92 -1 -1 -1 -1 -1 89 89 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 25 22 20 62 41 25 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 70 70 70 25 -1 3 50 -1 -1
n 26 -1 -1 -1 -1 -1 -1 -1 -1 60 90 85 96 87 85 61 96 99 96 4 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 2 2 20 45 55 5 -1 -1 -1 -1 4 39 40 12 -1 -1 -1 -1 -1 -1 99 70 40 90 90 89 -1 -1 -1 -1 65 45 55 7 90 90 -1 -1 -1 -1 -1 93 93 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 25 20 20 60 42 24 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 70 60 60 25 -1 3 50 -1 -1
n 27 -1 -1 -1 -1 -1 -1 -1 -1 60 93 74 95 70 82 72 95 98 95 3 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 2 3 10 45 60 5 -1 -1 -1 -1 6 38 40 12 -1 -1 -1 -1 -1 -1 95 70 40 90 90 93 -1 -1 -1 -1 65 45 60 7 89 89 -1 -1 -1 -1 -1 96 96 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 20 19 20 58 41 22 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 60 50 50 25 -1 3 50 -1 -1
n 28 -1 -1 -1 -1 -1 -1 -1 -1 50 95 82 96 70 73 73 96 98 95 2 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 1 3 10 45 55 5 -1 -1 -1 -1 8 32 43 10 -1 -1 -1 -1 -1 -1 99 55 45 85 85 85 -1 -1 -1 -1 65 45 65 10 87 87 -1 -1 -1 -1 -1 97 97 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 15 15 15 67 54 25 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 30 30 30 25 -1 2 50 -1 -1
n 29 -1 -1 -1 -1 -1 -1 -1 -1 65 91 79 94 87 85 60 96 99 92 3 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 2 3 15 45 60 6 -1 -1 -1 -1 5 38 42 10 -1 -1 -1 -1 -1 -1 99 60 40 93 90 94 -1 -1 -1 -1 65 45 60 8 89 89 -1 -1 -1 -1 -1 96 96 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 20 18 18 66 42 23 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 50 50 50 25 -1 2 50 -1 -1
n 30 -1 -1 -1 -1 -1 -1 -1 -1 60 80 63 96 87 80 65 96 99 92 3 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 0 2 2 2 0 2 0 0 2 1 1 2 2 2 -1 -1 -1 -1 2 3 15 45 60 6 -1 -1 -1 -1 4 40 41 10 -1 -1 -1 -1 -1 -1 99 55 45 94 90 94 -1 -1 -1 -1 65 45 60 6 89 89 -1 -1 -1 -1 -1 94 94 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 20 18 18 63 40 21 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 60 50 50 25 -1 2 50 -1 -1
###############################################################################
At the beginning of init.ai, there are some explanatory comments. For every A/I parameter, it indicates
[*]the field number, in the 's' (side) or 'n' (nation) spec lines, for example '0' (the first value field, with field #s starting at 0)
[*]whether the parameter applies only to sides [s ], only to nations [ n], or both [sn]
[*]the parameter name, followed by
[*]a short description (lifted from the code; the preceding '//' is a C++ comment marker)
So for example
# 1 [sn] AI_hot_trigger // Value which causes hex to be hot.
AI_hot_trigger -- the value which causes a hex to be "hot" -- applies to both sides & nations, and is the second field (but field #1, starting from field #0).
The next section indicates the constant _AId[efault], internal to the code. These are the values that apply, unless overruled by a subsequent value specification. 12 is the default parameter 0 value, for AI_hot_max; 6 is the default parameter 1 value, for AI_hot_trigger; 0 is the default parameter 2 value, for AI_move_trigger_AttackHigh; and so on...
In the next section , we specify the side parameter values.
s 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
is for side 0 (side A). And
s 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
is for side 1 (side B).
Following the 's 0' or 's 1' are (for ME 1.00) 130 parameter values, corresponding to the 130 (numbered 0 through 129) A/I parameters indicated at the beginning of the file.
For now, don't worry about the -1 values. Their significance will be explained a bit later.
In the next section, we specify the nation parameter values.
n 8 -1 -1 -1 -1 -1 -1 -1 -1 95 82 39 90 90 85 50 97 99 87 4 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 1 0 1 2 1 0 1 0 0 2 1 1 2 1 2 -1 -1 -1 -1 4 1 20 55 75 10 -1 -1 -1 -1 3 44 36 15 -1 -1 -1 -1 -1 -1 75 95 25 98 98 98 -1 -1 -1 -1 60 40 40 5 97 97 -1 -1 -1 -1 -1 85 85 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 35 28 30 65 45 35 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 20 95 95 95 25 -1 3 50 -1 -1
is for nation 8 (XFranceNation).
And so on, for all 12 nations in the Middle East (1.00) game. (If values are not specified for the other nations among the 100 maximum nations, the A/I default values apply.)
Following the 'n ##' are 130 parameter values, corresponding to the 130 (numbered 0 through 129) A/I parameters indicated at the beginning of the file.
There ends the general init.ai file.
[to be continued...]