From: metro Chicago, Illinois, USA
A Tale of Two AutoPlaytests
This post will tell the tale of two automated AI vs. AI playtests of the CSVN VN_600325_Vinh_An scenario, the first with the LAI/SAI (Legacy AI, Scripted AI) working in tandem, the second employing the LAI only (no scripting).
In the historical battle of Vinh An (from the scenario briefing notes):
Early in 1960, Viet Cong activities had become more prevalent in the Mekong Delta region. It was commonplace for the ARVN military to conduct road clearing and sweeping operations in hopes of catching the Viet Cong in the open. Road sweeping operations typically meant clearing mines and roadblocks for supply traffic to move freely from district to another. While these were standard affairs, one such operation culminated into a full scale ambush by the newly created Viet Cong U Minh Main Force battalion. This battalion would be the bane of the ARVN divisions operating in the area for years to come. In this case, it is the 2nd Battalion, 31st Infantry Regiment, 21st ARVN Division that would have their teething experience on QL 12 during a road clearing and sweeping operation.
In short, this scenario is thus a basic convoy ambush type scenario.
In the screenshot following:
The VC 1st Coy lies in wait in the vicinity of Vinh An.
The VC 2nd Coy is directed to sit tight, then attack Xom Ben Luong if and when fighting erupts around Vinh An.
The VC 3rd Coy is set to ambush any ARVN forces moving northwards up Highway 12.
The ARVN 2 Coy, the road clearing convoy, is ordered to move northward up Highway 12, and clear any mines or roadblocks in its path, then veer eastward to Vinh An. Meanwhile, the mine clearing engineers are to continue up the road northward, eventually as far as Xom Ban Oi.
Beginning at Turn 5 (or possibly sooner, if the ARVN 2 Coy is attacked), the ARVN 1st Coy is directed to load onto trucks, then motor up Highway 12 as far as Xom Ben Luong, also with the mission to clear any mines or roadblocks discovered along the way.
Beginning at Turn 5 (or possibly sooner), the ARVN Weapons Coy is to load onto trucks, then proceed up along the left river bank as far northward as Kinh Song Trem Trem, there to provide fire support for ARVN 1st Coy. (Moving anywhere beyond that point is too slow going.)
With the SAI/LAI working in tandem, how did the first playtest play out? Let's see (the situation at the end of Turn 13):
The ARVN 2nd Coy and VC 1st Coy are fighting to control Vinh An. The mine clearing engineers (with engineer trucks close behind them) continue on their primary mission.
The VC 2nd Coy has taken Xom Ban Luong. If the fight for Vinh An goes too badly, the VC 2nd Coy is directed to help out the VC 1st Coy in that fight.
After hitting a minefield along Highway 12 just beyond Xom Chac Bang, the ARVN 1st Coy was indeed ambushed by the VC 3rd Coy. The ARVN Weapons Coy assists from just across the river.
A second ARVN engineer company has trucked northward to, hopefully, clear the minefield just northeast of Xom Chac Bang.
In other words, this scenario has pretty much developed as intended: an ambush, and a main fight around Vinh An.
Hmm, I wonder what would happen if we remove the SAI (Scripted AI) and let the LAI (Legacy AI) alone play itself. Let's find out:
The VC1st & 2nd Coys operate about the same as in the first autoplaytest.
The ARVN 2nd Coy abandons its road clearing mission and retreats back down Highway 12 to Xom Vam Chac Bang.
The VC 3rd Coy moves cross country northeastward and away from Highway 12. There is no ambush!
Leaving its trucks behind, The ARVN 1st Coy marches on foot up Highway 12 only as far Ap Vinh Dong.
The ARVN Weapons Coy stays put, goes nowhere.
More or less the end result (also at the end of Turn 13; there is little change after that point):
The VC are clustered around Xom Ben Luong and Vinh An to the north.
The ARVN cower in fear midway along Highway 12.
Many ARVN lie dormant to the southwest around Kien Long.
Except for incidental clashes, there has been very little combat.
In this unscripted autoplaytest, it played out entirely unhistorically, and with near total disregard of the scenario designer's intent.
Now imagine if you the human were to play one side or the other vs. the opposing (a) SAI/LAI tandem or (b) LAI only.
Here are some talking points shared with the Dev Team recently:
In all of the following, "LAI" means "Legacy AI", while "SAI" means "Scripted AI". CSEE means "Campaign Series Event Engine".
--CSVN introduces many special new features: helos, riverines, complex terrain, civilians, no-go zones, politics, unconventional warfare, search & destroy, search & rescue, tunnels, etc. Things difficult to impossible to program with the LAI. Without the CSEE/SAI, there is no Vietnam game.
--The LAI is entirely guided by Objectives, nothing else. With the SAI, we can direct units to move to, attack, defend, etc. any arbitrary hex, whether an Objective or not. We can now have scenarios without any formal Objective hexes whatsoever! (As in LA_690915_SAR_A.scn.)
--Since the SAI is no longer tied to Objectives, we can direct forces to do flanking attacks, end runarounds and attacks from rear, move to staging areas, assume temporary defensive positions, etc. All of this was impossible under the LAI.
--With the SAI, we can direct a series of waypoint movements.
--With the SAI, we can order any series of stop/go movements.
--With the SAI, we can order retreats for whatever reason (whether triggered at some turn, due to high casualties, because accomplished some assigned purpose, etc.).
--Thus, with the SAI, for the first time ever the AI can have strategy. Before, the LAI was only tactical.
--Although we can, with great difficulty, micromanage the AI tactics, tactics are still best guided by the LAI. We will continue to improve the LAI as best we can.
--With the SAI, battle plans can be rigid and inflexible, or dynamic, reacting to changing battlefield (or even political) conditions.
--There can be one battle plan per side, or several. Selected initially at random, or per some other consideration.
--There are limits to what, and when, the game engine communicates to, shares with, the event engine; and vice versa. Although walled off one from the other, we do our best to facilitate game engine/event engine data sharing in real time. With some exceptions (e.g., real-time hex-to-hex unit movement), it is usually best to assume that data is passed from one engine to the other in on_next_turn() and on_next_phase() only.
--The event engine does not have access to the detailed information processing in the game engine (LOS determination, for instance). In some sense, the event engine is "dumber" than the game engine. But we can offset that by "intelligent" scripting.
--SAI orders are processed only in on_next_phase() (which calls one or the other side's battle plan functions). Once given at phase beginning, they will not change in mid phase; orders remain fixed until the next phase comes around. There are practical limits to how nimble the SAI can be. (Which is "realistic", if you think about it.)
--A unit can be assigned more than one SAI order, but a later order in the processing sequence overrides any earlier order(s). Only the last given order applies (until the next phase comes around).
--The SAI sometimes wrestles with the LAI for control. Sometimes, the LAI will block the SAI from doing some intended action. In programming the SAI, there are the occasional "gotchas" AKA bugs. We will continue to fix these as we go along.
--Often, the LAI will do seemingly stupid moves. We can rationalize that as being due to bad intelligence, misinformation, enemy misdirection (spies), inaccurate maps, missing roadway signs, or just simply getting lost. SNAFUs are normal, and to be expected.
--In complicated map situations (e.g., a complicated river network), the LAI path finding can be poor. Forces can go around and around in circles, get lost, get stuck. The LAI cannot "see" past rivers, only *maybe* "see" across bridges, fords, etc., but there are practical limits (time, CPU cycles) to how far and circuitous it can "see". In such cases, through appropriate SAI scripting, we might need to nudge the LAI, even micromanage movements as needed.
--With the SAI, can we cheat? Yes. For example, by setting verified_only inputs to false, we can have the SAI be all knowing. But should we cheat? With few exceptions, and except for practical reasons, the answer should be: no! Scenario scripters should avoid giving the SAI unfair advantages in an attempt to make it more competitive.
--We can and should aim to have a competent, competitive AI. But the higher goal is to achieve a more human-like AI, to give the human player the illusion he is playing against a real, live human opponent, not against some robotic, lifeless algorithm.
--Military history is filled with a wide range of military leadership, the good, the bad, and everything in between. The SAI/LAI should not, and cannot, play like Napoleon or Alexander each and every game. And even history's greatest commanders made mistakes, had their bad days. We should not, and cannot, expect infallibility from the computer opponent. There will be mistakes.
--Does this serve to excuse, to rationalize the SAI/LAI shortcomings? Yes, to some extent it does. But the above is no less true. Real-life human commanders are by varying degrees "intelligent". Sub-par AI is as much a feature as it is a bug.
--Thus far, our scenario battle plans have tended to be inflexibly choreographed, proceeding according to some more or less fixed series of steps. As much as possible, we should make the battle plans more dynamic, adapting in real time to changing battlefield conditions.
--Micromanaging the LAI is hard. The SAI decision trees can quickly become quite complex, with lots and lots of deeply nested if-elseif-else's. Overly complex battle plans are buggy battle plans. The trick is to KISS the AI as much as possible.
--The CSEE/SAI are based on the embedded scripting language Lua (embedded within the game engine). Lua "scripting" is still programming. Programming at any level is hard. Scenario scripters are generally not programmers, in many cases are complete newbies. They will struggle and make mistakes (bugs). Another reason to KISS the CSEE/SAI as much as possible. And to be forgiving, not so harsh in judging the scripters' work.
--Achieving the "perfect" battle plan is quite time consuming, assuming it is even at all possible. With so many scenarios, with a limited amount of time until game's release, we must not let perfection be the enemy of the good. We must be pragmatic. Good enough is just that.
--The CSEE, the SAI, and the LAI will continue to evolve, and to improve. (And we will continue to discover and to fix bugs.) We must acknowledge the practical impossibility of revisiting and revising earlier scripting efforts. Hindsight is 20/20. But again, good enough is good enough.
--The bottom line: When judging the game's AI, we should not solely consider: Can it beat me? We should also judge whether: Is it life-like, imaginative, interesting, engaging, entertaining?
Will this game's AI be perfect? No. Will it be better than ever? We think so!
< Message edited by berto -- 6/21/2019 10:18:48 AM >