Scripted AI and Scenario Briefings
Welcome to the second part of my blog series on Scripted AI. In the first post of this series, I discussed Scripted AI in general. Then, before this one, I wrote about the two CSEE How-To documents that Berto created, which will soon be included in the game manual content. Now, let’s dissect the Scenario Briefings.
SMEAC
Our Scenario Briefings, courtesy of scenario-specific Campaign Series Event Engine (CSEE) Lua files, loosely follow the five-paragraph field order style: “S” for Situation, “M” for Mission, “E” for Execution, “A” for Administration and Logistics, and “C” for Command and Signal.
As we covered in the first blog, the csmkllua.pl (“make Lua”) utility initially generated what was mostly an empty skeleton for scenario designers to fill with the necessary details. The Scenario Briefing was one of those blank canvases. In the next update, the revised Make Lua utility will take things a step further.
Let’s dive into the details. As an example, I will use a Community mod available via the JSGME Mod Enabler that ships with the tool: Alan R. Arvold’s “Battle of Black Virgin Mountan, Octover 15, 1966, which is one of the three scenarios that are available under the Ode to Divided Ground Vietnam Mods Campaign, once enable.
Greetings, Commander!
Actually, even before the Situation paragraph, there’s a welcoming statement to this particular scenario.vided below. Carry out with accuracy.
With stock scenario files all starting with a two-letter country code as the prefix, csmklua uses that to set the scene. If, for any reason, such a prefix is not identified, the region name is used instead. For example: Welcome to Southeast Asia! Here, instead, as always suggested: I edited the Lua scenario file created by the Make Lua utility to introduce players to this Campaign set instead.
Next, there’s an encouragement to follow orders diligently. This message comes from a text array or table of sentences. Tables are easy to implement in Lua and are also used for other communications. For instance, when an objective falls into your hands after your genius strategy, a random commendation is sent your way.
So here we go:
Commander, welcome to Alan R. Arvold’s Ode to Divided Ground Vietnam Mod! Your SMEAC is provided below. Carry out with accuracy.
There is a wealth of intel about the scenario being opened on the game engine side. Some of this information was already available through the CSEE Lua API (application programming interface, or simply, a function you can call to process or retrieve data). However, since much of it was considered “chrome” (nonessential details), many aspects were not included.
Among the new APIs I wrote for this update, I added a function that retrieves the part of the scenario description template identifying the exact location where the depicted battle took place.
I. SITUATION:
Scenario: Battle of Black Virgin Mountain; 15 October, 1966
In addition, map intel such as Terrain type, Ground conditions, and Visibility is now retrieved and displayed under the Situation paragraph.
a. Area of Operations: Tay Ninh Province, South Vietnam. Terrain: Tropical Rainforest, dry ground. Weather: day, visibility 5000 meters.
For the Friendly and Enemy forces intel, I enhanced the Make Lua utility to include higher-level organizational names and calculate an average morale factor for those levels, alongside the usual unit IDs (trackids) used in CSEE code. This information is now presented to the player as well. It should prove to be valuable, especially when playing under Enhanced Fog of War, where intel on the map is scarce at the best of times. There’s a shout for the available support, typically Air Support, if any. Pay attention to your Command Reports as you play along, as all airstrikes are often not immediately available.
b. Enemy Forces: Elements of the 88th Rifle Regiment, 57th Heavy Mortar Battalion, 43rd NVA Special Action Group, 183rd VC Sniper Group, and Civilians. Enemy morale is assessed
as moderate. Adjust your tactics accordingly.c. Friendly Forces: Units of the 25th Infantry Division, and Relay Station Garrison.
d. Supporting: Full Air Support available: 4 flights of Close Air Support. Current missions allocated can be found in the Status > Command Report.
Finally, there is a warning regarding indirect fire from or to inhabited hexes or for calling airstrikes there. The CSEE skeleton includes Event Point penalties for such actions, so pay close attention.
e. Civilian Considerations: You will lose Event Points for indirect fire or airstrikes on inhabited areas (villages, cities, suburbs), regardless of enemy presence.
Here’s the complete Lua section that creates the Scenario Briefings for scenarios:
Mission
If Situation was still about “chrome” in some way, Mission is where things get interesting.
Those familiar with our Scenario Editor that comes with all games (alongside the Map and Organization editors) might recall there is a dialog to assign Mission Types for both sides. These mission types were not previously used by the game engine, but now they are being put to good use.
There is now a new CSEE API to retrieve Mission Types for both sides. Each mission type now has a weight attached to it, representing postures that range from tentative recon attacks to strong or even fanatical last-ditch defensive postures. Note another dynamically created phrase to bring some flare to this.
II. MISSION:
Your mission directives are: Mopping Up, from turn 1 to turn 24. Search and Destroy, from turn 1 to turn 24.
Enemy actions are anticipated to focus on: Ambush, from turn 1 to turn 24. Infantry Assault, from turn 1 to turn 24.
Prepare to act on all mission directives.
In addition to the mission weight, or mission posture, there is now a set duration for each mission. By default, since the Scenario Editor does not provide this level of detail, each mission is assigned a duration from turn one to the last turn of the scenario. However, there is a TO DO tag set for the scenario designer to edit these. For example, a Meeting Engagement for the first ten turns, followed by a Rearguard Action for the remaining turns as opposition was found to be too strong.
Which brings us to…
Execution
First, the scenario briefing is quite generic at this stage. To add situation intel, scenario designers are encouraged to chip in.
III. EXECUTION:
Stay agile and modify your approach based on battlefield changes. Pay close attention to CSEE events during combat, as they may affect your strategy.
Victory depends on reaching mission targets while maintaining operational strength. Monitor Status > SITREP for real-time updates on the operational situation.
With mission_posture now available in the CSEE Lua file, it can be put to good use in guiding the Scripted AI to execute according to the mission_posture in play. Weighed die rolls to determine between weak, normal, strong, or fanatical attack() or defend()? Yes, why not.
The Mission Type itself can also be utilized in CSEE, which is particularly useful if a Rearguard mission is in play. For example, units can fall back to the next objective behind the lines, defend weakly (where the defending unit is more likely to retreat than take casualties), and then fall back again to the next objective in the rear.
This kind of tactical execution was already implemented by scenario designers, such as in Vietnam 1.0, so it is not entirely new. What is new is that this type of execution can and will become more automated as we continue to enhance the Make Lua utility.
Administration and Logistics
“Amateurs talk about tactics, but professionals study logistics.” And why not, as logistics takes on a stronger role even in the mostly tactical battles depicted in Campaign Series scenarios. The new CSEE Lua skeleton now tracks the gradual decline of Ammo and Artillery Ammo levels once the first shots of both types are fired. The decline is slow, but in a long scenario, it can have a noticeable impact. Even at this tactical scale, not all units should be able to go all out all the time, right?
In Vietnam 1.0 scenarios, it was already common for losing a Supply source to decrease Ammo levels. Additionally, there were often scripted means in CSEE to replenish supply. Now, there is added automation for this. For every full set of 10 turns (a default that scenario designers can adjust), a Logistics Round is triggered, increasing Ammo levels by 10 percent.
IV. ADMIN AND LOGISTICS:
Current Supply levels: Ammo: 80%, Artillery Ammo: 80%, Smoke: 12, Flares: 0.
Be aware that supply levels will decrease as combat intensifies, so plan accordingly.
As of the current status, Logistics is prepared to deliver 2 Ammo resupply and 2 Artillery resupply rounds.
As another improvement, there is a new dialog to check for any orders available. The Make Lua utility will now include these Logistics Rounds by default.
Scenario designers can expand on them by incorporating other tactical options and considerations.
Command and Signal
Finally, Command and Signal. While the Scenario Briefing keeps this paragraph relatively brief, there is a lot happening on the Command side of the computer opponent, with Scripted AI working in its favor.
V. COMMAND AND SIGNAL:
Refer to the Status > Find Organizations dialog for your complete command structure.
Hold that thought, as the third installment of my Scripted AI blog series will dive into the Battle Plan portion of the new CSEE scenario skeletons.
Good luck, commander!
Thank you for reading this far, and stay tuned!











