Coder Diary #30 -- The Adaptive A/I

The Campaign Series: Middle East 1948-1985 is a new turn-based, tactical wargame that focuses on conflicts in the Middle East.

Moderator: Jason Petho

User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

Coder Diary #30 -- The Adaptive A/I

Post by berto »


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.

Image


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...]
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »


Coder Diary #30 -- The Adaptive A/I, part 2



SCENARIO .AI FILES

There may also optionally be per-scenario .ai files, in the scenarios folder, for example:

###############################################################################

# Harib_1963.ai

###############################################################################

# see init.ai for parameters list

###############################################################################

# 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 _AIs

# side A (0) XGenericProWestNation
# side B (1) XEgyptNation

# 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 2 0 2 2 2 0 2 0 0 2 1 1 2 2 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 2 0 2 2 2 0 2 0 0 2 1 1 2 2 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

# 14 XGenericProWestNation
# 23 XEgyptNation

# 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 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 16 35 65 35 25 -1 2 40 -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 30 20 20 62 42 24 -1 70 90 0 0 -1 -1 -1 -1 -1 -1 19 80 78 75 25 -1 3 65 -1 -1

###############################################################################

As you can see, the scenario-specific .ai file is much like the generic init.ai file, except

[*]there is no explanatory preamble, comments listing and describing the various A/I parameters (though there could be)
[*]since each scenario has two sides, there are two s[cenario] lines
[*]since each scenario has just two or several nations, there are only n[ation] lines appropriate to the scenario (in the Harib_1963 scenario, nations 14 (XGenericProWestNation) & 23 (XEgyptNation))
[*]values specified therein apply only to the indicated scenario

That's the general layout of the .ai files. In the next section, we'll begin describing the interaction of these two files in more detail.


INIT.AI VERSUS <SCENARIO>.AI

So how do these two file types -- init.ai & <scenario>.ai -- work together?

For side values

[*]the in-code default values are overruled by
[*]the side values in init.ai (if any), which are overruled by
[*]the side values in the <scenario>.ai file (if any)

In other words, per-side values in <scenario>.ai trump those in the general init.ai file, which trump the hard-coded defaults.

And similarly for the per-nation values: <scenario.ai> trumps init.ai trumps the hard-coded defaults.

A -1 value says to ignore, just go with the lower ranked value.

So in the example init.ai file

###############################################################################

# _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

###############################################################################

since the s[ide] values, both sides (0 & 1), are mainly (excepting the oplimit values) all -1, the hard-coded _AId[efault] values all apply. (In the code, all _AIs reset values -- when using Cautious/Audacious A/I -- are set to the hard-coded defaults.)

What if we change init.ai to have

s 0 -1 7 ...
s 1 -1 5 ...

If so written

[*]For side 0 (side A), we override the default 6 hot_trigger value (field #1, 2nd field after the 's 0' side designation) with a new higher value, 7.
[*]For side 1 (side B), we override the default 6 hot_trigger value with a new lower value, 5.

We could of course add more overrides, for example

s 0 -1 7 -1 -1 -1 -1 -1 3 50 -1 -1 -1 ...
s 1 -1 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 75 ...

says that

[*]For side 0 (side A), replace its default move_trigger_doubletime 4 with 3; and reduce its move_doubletime_prob from the default 100 down to 50.
[*]For side 1 (side B), reduce its move_leaderhq_runaway_prob from the default 100 value down to 75.

As you can see, there is no requirement to change parameter values in tandem. You can change values for one side, or the other, or both.

In the example, for all other parameters with -1 values, the default values still apply.

n[ation] specs work similarly. For example

n 22 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 80 -1 ...
n 23 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 90 ...

indicates

[*]For nation 22 (Israel), decrease its move_exitmap_prob value from the default 100 down to the new value 80.
[*]For nation 23 (Egypt), decrease its move_unload_prob value from the default 100 down to 90.


S[IDE] VERSUS N[ATION] SPECS

Let's talk some about s[ide] vs. n[ation] specs.

Remember: On each side, you can have more than one nation (allies fighting together).

In the code, where these parameters are referenced, in some places (in some functions) we know the side, but not the nation, depending on the context (and the purpose of the called function).

In other places (in other code functions), we know the side, but we further also know the nation. Given the context, if the code knows the nation, it prefers using the n[ation] parameter value, and completely ignores the side value.

Wherever possible, we prefer to use the n[ation] values, not the s[ide] values. But that is not always possible.

If an A/I parameter is marked [s ], it is pointless to specify its n[ation] value, as the code with ignore it. Likewise, if an A/I parameter is marked [ n], it is pointless to specify its s[ide] value, as the code will ignore that too. For A/I parameters marked [sn], feeel free to specify both s[ide] and n[ation] values.

Deciding whether to apply a s[ide] or a n[ation] effect. Where and how in the code precisely to apply the effect. These are tricky questions, sometimes with no easy answers. There is "artistry" in coding this.

You'll get a better sense of the difference between s[ide] vs. n[ation] parameter usage as we go along. But to continue...

Again, for every scenario, we have

[*]the hard-coded defaults
[*]the general init.ai values
[*]the scenario-specific <scenario>.ai values

in increasing order of rank, i.e., "later" values in the sequence trump "earlier" values.

If we have this, in init.ai:

# _AId constant defaults

# 0 1 2 3 4 5 6 7 8 ...
# 12 6 0 2 3 4 6 4 100 ...

...

n 8 -1 -1 -1 -1 -1 -1 -1 -1 90 ...

...

And also this, in the <scenario>.ai file:

...

n 8 -1 -1 -1 -1 -1 -1 -1 -1 75 ...

...

By default, and without any further overrides, the probability of French (nation #8) troops moving doubletime is 100% -- the generic move_doubletime_prob for all sides, all nations, all scenarios.

Further down the init.ai file, we have reduced the nation 8 move_doubletime_prob down to 90%. Which would apply to all French troops, any scenario...

Except that in the <scenario>.ai file, we have further specified that for the given scenario, French troops have a move_doubletime_prob of 75% (this scenario only).

We could achieve the same effect -- for this scenario (only) -- have French troops with a move_doubletime_prob of 75% by means of (first init.ai, then <scenario>.ai):

# _AId constant defaults

# 0 1 2 3 4 5 6 7 8 ...
# 12 6 0 2 3 4 6 4 100 ...

...

n 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

...

...

n 8 -1 -1 -1 -1 -1 -1 -1 -1 75 ...

...

For this scenario only, French (nation 8) troops have a 75% move_doubletime_prob.

Otherwise, their move_doubletime_prob is 100%, same as for every other nation (without special qualification), because we have omitted any special general nation 8 override in the init.ai file.

We could achieve a similar effect -- for all scenarios -- have French troops with a move_doubletime_prob of 75% by means of (first init.ai, then <scenario>.ai):

# _AId constant defaults

# 0 1 2 3 4 5 6 7 8 ...
# 12 6 0 2 3 4 6 4 100 ...

...

n 8 -1 -1 -1 -1 -1 -1 -1 -1 75 ...

...

...

n 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

...

For all scenarios, generally speaking, French (nation 8) troops have a 75% move_doubletime_prob.

If it's not clear, in this last example, we could -- in the <scenario>.ai file -- also indicate a 75% nation 8 move_doubletime_prob, but that would be redundant, and unnecessary, because we have specified that generally, before, in the init.ai file.

This system of

[*]tandem .ai files (init.ai & <scenario>.ai)
[*]<scenario>.ai values trumping init.ai values trumping default values
[*]-1 ignores

is designed for the greatest flexibility, and to minimize redundancy and extra work. You drop in to fine tune a parameter exactly where you need to, no more, no less.

This might seem confusing to you now. But as you play around with this, as you tweak and experiment, and as you follow along the inevitable forum discussions about this, it should all become much clearer to you. You'll get the hang of it!

NOTE: All of this applies to modders only, who wish to modify the A/I values. In ordinary play, for ordinary players who don't care to mod, don't worry! We have figured out the A/I parameters in the appropriate ways in the appropriate places for you. Just play!

[to be continued...]
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »


Coder Diary #30 -- The Adaptive A/I, part 3



THE AI PARAMETERS

Let's consider more carefully the different A/I parameters...

###############################################################################

# 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

###############################################################################

The first 8 parameters

# 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.

all have to do with how close the enemy is, and what kind of response the enemy proximity elicits. For now, just ignore these. Don't replace any -1 values anywhere for the first seven parameter fields. If any parameters go to the heart of the CS A/I, these are it. If you screw around with these too much, these as much as anything will drastically alter the usual game A/I behavior, even potentially making it go whacko.

The next 10 parameters

# 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.

are probabilities -- 0% chance to 100% chance -- of performing the indicated action.

Important: These and other such probabilities are not absolutes. Other factors and conditions might come into play, in the code, before the decision point is reached -- do the action or not. So, for example, setting the move_runaway_prog to 100% will not have all units begin to frantically run away! They may instead be on the attack, not imperiled (nearby hexes are not "hot"), doing something else (such as digging in), etc. Only if these other special circumstances do not apply, and only if the conditions are just right -- then the dig_prob is factored in. Same story for the other _prob values. _prob values are like logical gate keepers. Just before the indicated action is taken, or the indicated effect is applied, there is one final probability check: Will the action/effect happen with certainty (100%), else with less than certainty (_prob value less than 100%)?

# 18 [ n] AI_unload // Unload distance.
# 19 [ n] AI_standoff // Stand-off distance for vulnerable units.

indicate

[*]how close (in hexes) it is "safe" (maybe not!) to unload passengers from vehicles.
[*]how far away (in hexes) "vulnerable" units should stay away from the enemy.

That's a quick run-down of the first 20 customizable Adaptive A/I parameters. Refer to the init.ai preamble for the names and descriptions of the other 110. Their purpose should be clear. If not, just ask at the forum. At the forum, we will be commenting on the parameters from time to time.

The initial list of 130 parameters (actually less than that, since some of the slots are "reserved" for future use) -- these are a beginning. Over time, we will be expanding the customizable Adaptive A/I system to other aspects of game play. The sky's the limit!

Many of these game aspects were previously impacted by the computer code comparing a random "die roll" against some hard-coded, fixed probability factor. By means of customizable A/I parameters, we can affect the chance of this or that happening, or not happening. In other game aspects, there used to be a 100% certainty that something will happen, or not happen, under certain circumstances. By means of these new parameters, we have introduced randomness to these aspects of game play.

NOTE: We have opened up scenario/player influence not just to what may properly be considered "A/I" behavior, but also aspects of physical reality. How likely/quickly a unit loses/gains morale or disruption, for example -- is that a true "A/I" parameter, reflecting national fighting effectiveness/doctrine; or is it something immutable, "just the way things are"?

ALSO: Is tweaking the A/I in this way enabling the A/I to "cheat"? Well, it depends. If we apply ridiculous parameter values, giving the A/I obvious, exorbitant advantages, yes, we are giving the A/I undue advantages, cheats. But more reasonable values?

There are several goals in refining the .ai files, not mutually exclusive, all may pertain to some extent:

[*]To coach the A/I in ways and things it is too dumb to figure out by itself.

If in a given <scenario>.ai file, we tailor the A/I to act in certain ways according to the mission type, whether attacking or defending, etc. -- if we provide the A/I contextual hints -- is that any more cheating than the human player scoping out the scenario beforehand; or replaying a known scenario; or applying his knowledge of the different combatants, how the battle actually played out in history, applying his superior meta-knowledge and wisdom? With sensible, effective A/I .ai file value tweaks, we are just providing advice and guidance much like a superior, higher org level commander (or intelligence services) would.

[*]To achieve game play "balance".

If you see the game in this way, if you think every scenario should be a fair fight, to heck with "realism" or actual history ... there's nothing stopping you, play the game your way. It's not what we want to play, it's not how we would design the scenario, or tweak the <scenario>.ai file, however.

[*]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".

In the OOB files, we give the various nation's units different strengths, weaknesses, and special attributes. Fine tuning this further in the .ai files is just one more way we make the game a better simulation, if maybe not above all a "balanced", "fair fight" of a game.

[*]To add randomness.

Among the A/I parameters, there are

move_doubletime_prob // Probability of doubletime moving.
fatigue_prob // Probability doubletiming unit will become fatigued.
recover_from_fatigue_prob // Probability a fatigued unit will recover.

With the Adaptive A/I optional rule in effect, these probabilities are no longer 100%! You will no longer be able to doubletime move, force march your units with 100% certainty. A doubletiming unit will not necessarily become fatigued. And a fatigued unit will not always recover from fatigue the very next turn. More fit, better trained units might succeed at force marching always, might not become fatigued, but if fatigued might recover from fatigue without exception. Conversely, less fit, poorly trained units might balk at doubletime moving, might become fatigued more surely, and might remain fatigued turn after turn, depending on the A/I parameter setting, and the internal "die rolls". Heroes here, slackers there!

Real combat is full of surprises, chance occurrences. It's messy and unpredictable. Real combat is chaotic!

[*]Thereby increasing replayability.

From game to game, the random factors, the "die rolls", will vary. No scenario will ever play out the same way.

[to be continued...]
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »


Coder Diary #30 -- The Adaptive A/I, part 4



EXPERIMENTING, TRYING IT OUT

We invite you to play around with, tweak, experiment with changing the various A/I parameters. Whatever your purpose, mod and play the game your own way!

But be sure to use the -X NoEncryption option if you do so. Why? It's because, especially for competitive PBEM play, we have encrypted all .ai files to .aix counterparts. In normal mode, without use of the -X NoEncryption option, the game engine in fact references the encrypted .aix files, not the .ai files. In the default installation, the encrypted .aix values match their human readable .ai counterparts. Since you don't have the encrypter program and can't .ai > .aix yourself, your only recourse is to modify the .ai files, then bypass the .aix files, reference the .ai files directly, by means of the -X NoEncryption option.

If you are the modding type, you will get the hang of it. If you have been able to figure out and cope with the complexities and obscurities of the other game data file formats, you will eventually get comfy with these new .ai data files also.

If later you still don't understand it, ask questions at the forum. We should help you figure things out.

Here's another trick to try, whether when testing your A/I mods, else if you are just curious in the course of normal game play: Start up a normal game, any scenario. At any point, do an Alt-F10 hot key. You should see a pop-up window detailing all of the many, many A/I parameters.

Image

Remember: The game begins with an A/I setting. But the player can alter that setting, by choosing Cautious/Audacious A/I, or Shifting A/I.

Depending, the game engine occasionally needs to reset the the A/I parameters, for one and/or the other side, to the game startup settings. The settings -- the individual A/I parameters -- may change during the course of the game (or not at all, if the player just leaves things alone, no A/I options).

So, in the A/I Dump dialog, we have:

* AI_ constant defaults -- these are values hard-coded, in the code.

* _AId defaults -- hard-coded values applied to a more easily manageable set of internal "constant variables". These are the "variables" referenced when the other _AIs & _AIn variables are reset. These _AId values are set at the very beginning of game engine startup.

* _AIs & _AIn values -- Still another form of reset values, but after all .ai file processing. These are the in-game authoritative resets.

* _ais & _ain values -- These are the true variables that various places in the code reference when making A/I decisions.

* other A/I parameters

A bunch of gobbledygook that you can ignore for the most part, or entirely. Good to reference -- if you're brave enough!


DON'T WORRY, BE HAPPY!

Don't fully understand the above? Don't worry about it! It bears repeating here also: Using the Adaptive A/I, much less modding it, is entirely optional. It is one of the optional rules you set, or not, as you launch the game. Use it, or not, as you wish!

Of course, by introducing all these new _prob this and _prob that parameters, we are making game play more random.

To the Developers' way of thinking -- not to everybody's! -- that is A Very Good Thing.

Real combat is full of surprises, chance occurrences. It's messy and unpredictable. Anything that adds to the chaos (within limits!) makes it a better simulation of real combat, and to us a better game.

With the increasing randomness (that is, if we begin deviating away from the legacy default 100% chance values), the Campaign Series game play becomes more of a "black box". Stuff happens, sometimes bewildering stuff happens, that lay waste to your best plans and intentions. Nerve wracking, hair pulling, exciting!

And annoying to competitive PBEM players, who want a more even-handed, predictable, chess-like game for tournament purposes, for proving themselves in "fair fights" with other competitors. That is why the Adaptive A/I System is an Optional Rule, activated by default in Middle East, but you have the option to turn it off.

That way, old-timer grognards can continue to play the traditional game as they have always known it. And the rest of us "realism" freaks can have so much more of a good time.

Another thing, about improving the A/I...

With increasing randomness (still within limits, though), the human player experiences more and more WTF?! moments. Adding to the chaos creates uncertainty and mental confusion -- for the player. However, the "unthinking", rote A/I is unperturbed by this. It just continues to do its thing, taking the increased randomness in stride. In this way alone, we think that -- by impairing the human player's game play somewhat -- the A/I is thereby comparatively advantaged.

This game is really taking on personality. It's becoming a much more interesting -- and fun! -- game. (And will become even more so, in future, when we can extend unpredictability to other aspects of the game system. As always, as Optional Rules!)

We hope the new Adaptive A/I will give you a better game experience. We hope you enjoy the new-and-improved A/I!

Until the next time...
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Jafele
Posts: 776
Joined: Wed Apr 20, 2011 7:27 am
Location: Seville (Spain)
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by Jafele »

I´ve always thought the AI is the "brain" of the game, the most important part, but also the most hidden one. Berto, I´m very impressed with the work you´re doing, it´s not easy to find in other games. [X(] Thanks a lot. [&o]

Will the adaptative AI be possible for JTCS some day? Perhaps, a future patch? I love the idea to play the same scenario many times with different results. Replayability is the key to become a classic. Definitely.
Las batallas contra las mujeres son las únicas que se ganan huyendo.

NAPOLEÓN BONAPARTE


Cuando el necio oye la verdad se carcajea, porque si no lo hiciera la verdad no sería la verdad.

LAO TSE
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »


For sure, we will be back porting the Adaptive A/I to the older games. With a common codebase for all the games, we will strive to maintain them all at one and the same standard.
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Jafele
Posts: 776
Joined: Wed Apr 20, 2011 7:27 am
Location: Seville (Spain)
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by Jafele »

Great!!! [:D] The classics will live with us for a long, long time.

Thank you so much
Las batallas contra las mujeres son las únicas que se ganan huyendo.

NAPOLEÓN BONAPARTE


Cuando el necio oye la verdad se carcajea, porque si no lo hiciera la verdad no sería la verdad.

LAO TSE
User avatar
Hexagon
Posts: 1113
Joined: Sun Jun 14, 2009 8:36 am

RE: Coder Diary #30 -- The Adaptive A/I

Post by Hexagon »

I need care about Skynet and go dug-in with some supplies??? [:D]

The new adaptive AI sounds fantastic, a good way to give more interest VS AI games.

User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »

ORIGINAL: Hexagon

The new adaptive AI sounds fantastic, a good way to give more interest VS AI games.
It may not be clear, but even in human vs. human games, such as PBEM, the Adaptive A/I still applies, if you select that optional rule.

In any game mode -- vs. A/I, PBEM, H2H local, H2H network -- the A/I guides Opportunity Fire, and has always done so. The new Adaptive A/I system applies this guidance much more widely to other areas of game play -- if you select the Adaptive A/I optional rule.

So even when human vs. human, it's a "good way to give more interest" to any mode of game play.

Confused enough yet? [:'(]
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »


Well, I'm obviously confused. Deleted the mistaken post! [:'(]
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
carll11
Posts: 951
Joined: Thu Nov 26, 2009 2:07 pm

RE: Coder Diary #30 -- The Adaptive A/I

Post by carll11 »

wow, love this, I would love to add as much randomness and allow the AI to adapt as much as possible in say generated battles, so how do I install the feature that will give me the choice to click on 'adaptive AI'? ( If I missed it I apologize ahead of time) [:D]
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »


Adaptive A/I is an optional rule that you select (alongside the other Optional Rules) at scenario start.

For the standard scenarios, we have individual, tailor-made <scenario>.ai files (in the scenarios folder). For random battles, they default to the standard default init.ai file (found in the top-level game folder, alongside the game EXEs).
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
carll11
Posts: 951
Joined: Thu Nov 26, 2009 2:07 pm

RE: Coder Diary #30 -- The Adaptive A/I

Post by carll11 »

ah for ME, I thought (?) I had read that it was available in JTCS after the update? There is a sparse AI file in jtcs, is that it? I never saw the adaptive selection....
User avatar
Jason Petho
Posts: 16629
Joined: Tue Jun 22, 2004 10:31 am
Location: Terrace, BC, Canada
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by Jason Petho »

No, the Adaptive A/I is new to CSME and will be carried forward to the new games.

That is a different AI file.
User avatar
carll11
Posts: 951
Joined: Thu Nov 26, 2009 2:07 pm

RE: Coder Diary #30 -- The Adaptive A/I

Post by carll11 »

Thx Jason, however I am confused, above, berto said;

"For sure, we will be back porting the Adaptive A/I to the older games. With a common codebase for all the games, we will strive to maintain them all at one and the same standard."

User avatar
Crossroads
Posts: 17498
Joined: Sun Jul 05, 2009 8:57 am

RE: Coder Diary #30 -- The Adaptive A/I

Post by Crossroads »

He is referring to the upcoming new, unbundled WW II titles, methinks.

Similarly, new features introduced in CS: Vietnam will be back ported to CS: Middle East UPDATE once VN is out.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < Available now
CS: Middle East 1948-1985 2.0 < 3.0 In the works
User avatar
carll11
Posts: 951
Joined: Thu Nov 26, 2009 2:07 pm

RE: Coder Diary #30 -- The Adaptive A/I

Post by carll11 »

which won't be JTCS...(?) [:(]
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by berto »

ORIGINAL: carl11

which won't be JTCS...(?) [:(]
No. JTCS 2.02 is the end of the line. The old, bundled JTCS will remain unchanged, as is.

Any future development, including back porting of features and other improvements, will apply to CSME and newer games only.
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Jason Petho
Posts: 16629
Joined: Tue Jun 22, 2004 10:31 am
Location: Terrace, BC, Canada
Contact:

RE: Coder Diary #30 -- The Adaptive A/I

Post by Jason Petho »

Meaning, we will be releasing new World War 2 games.
User avatar
carll11
Posts: 951
Joined: Thu Nov 26, 2009 2:07 pm

RE: Coder Diary #30 -- The Adaptive A/I

Post by carll11 »

in response to both Berto and Jason;

Ah, I see.


I am not trying to be obtuse here, but if you're not going to back port, then the debate over at JTCS re: the unbundling, where in some have surmised there will not be updates to those games any longer ( ef,wf, rs), BUT, I believe one of you have said there will be updates to them(?), or back porting to keep them viable, even in the unbundled form; would this not be...an update worth making?
Post Reply

Return to “Campaign Series: Middle East 1948-1985”