Tag Archives: AI

Fixing a Major Mistake

This screen shot is an example of the design flaw that has now been corrected. Units don’t instantly change from line to column formation. Note that the red infantry unit is first in line formation (facing northwest), it receives orders from the HQ to switch to column formation advance to a position, switch to line formation, travel in line formation, then switch to column formation and travel in that formation. If you observe closely, the unit one instant is in column formation and the next it is in line formation occupying a different portion of the terrain.

The first lecture I would give at the beginning of every semester started: “The greatest asset you can have as a programmer – or as a human being – is the ability to admit that ‘I screwed1)Full disclosure: I wouldn’t say ‘screwed up’. If you want to get an undergraduate’s attention use the ‘f word’. up’ fifty times a day if necessary. Because, until you admit you made a mistake, you can’t find you mistake. And until you find you mistake you can’t fix your mistake. The first step to fixing a mistake is to first admit you made it.”

In the above screen shot there is a glaring error and I didn’t see it for years. In my defense, nobody else saw it, either. The screen shot, below, shows the correct movement and unit formations:

In this screen shot you can see that the unit is switching formations correctly. Note how the unit first changes from line to column formation by ‘a left face’ command, then moves in column formation, avoiding the artillery battery, moving on to the road and advancing to the assigned location where the unit stops, changes into line formation via another ‘left face’, advances in line formation as ordered until it reaches its destination, stops, forms column by another ‘left face’ and then advances to its destination.

Without getting into details, this was a pretty complicated fix. Looking for help with this, and some MonoGame2)MonoGame is a community supported version of Microsoft’s XNA which was created specifically for making cross-platform games. Microsoft stopped all support for XNA in April 2014. Previously, I had used XNA for some work that I had done for the US Army and the Department of Defense and thought it had great potential for creating computer wargames and simulations. specific problems, I encountered Matthew T. from the MonoGame forum who very kindly volunteered to help. Not only did Matthew fix the line / column formation problems but he identified and fixed a bug with the typography for the game, too:

These two screen shots show the difference in the clarity and spacing (called kerning) of the letters. In the left screen shot notice the lowercase ‘g’ in Debug and the spacing of the letters in the word ‘positions’. In the right screen capture, after applying Matthew’s typographical fixes, the letters are clear and properly spaced.

Matthew is also cleaning up the codebase. I have a tendency to write code ‘fast and furious’ and then hope to go back and optimize and clean it up later. Matthew has already begun cleaning it up and has reduced the codebase by something like 7,000 lines of code! Furthermore, Matthew has also sped up the load time and the time between game turns from about a minute to about 10 seconds (obviously, time varies based on scenario).

Steam Update

Darin Jones has been working on the Steam side. He created the Installer and is working on setting up Player versus Player (PvP) leveraging Steam’s built-in features. While this has been a steep learning curve, Darin has made some significant progress:

Screen shot of Steam Player vs. Player invitation for General Staff: Black Powder. This is not a Play by Email (PBEM) system, rather it uses Steam’s internal messaging system

Darin is also setting up a ‘Workshop’ area where you can upload scenarios, armies and maps that you create and want to use in a PvP game.

What’s Next

Our goal remains to get General Staff: Black Powder into beta-testing (that’s you guys playing with it) as soon as possible. We want to use the Steam PvP method, above, as the vehicle for testing. I’m grateful for the emails that I’ve received that are encouraging me to not rush General Staff: Black Powder out before it’s ready and to deliver a solid game (see also, Gabe Newall on why game delays are OK: ‘Late is just for a little while. Suck is forever.’).

As always, please feel free to contact me directly at Ezra[at]RiverviewAI.com.

 

References

References
1 Full disclosure: I wouldn’t say ‘screwed up’. If you want to get an undergraduate’s attention use the ‘f word’.
2 MonoGame is a community supported version of Microsoft’s XNA which was created specifically for making cross-platform games. Microsoft stopped all support for XNA in April 2014. Previously, I had used XNA for some work that I had done for the US Army and the Department of Defense and thought it had great potential for creating computer wargames and simulations.

Why the Pundits are Completely Wrong About AI

I have a lot of respect for Steve Wozniak – quite a bit less for Elon Musk 1)Though I have to admit losing $20 billion in a few months is impressive. – who both recently signed a letter calling for, “all AI labs to immediately pause for at least 6 months the training of AI systems more powerful than GPT-4.” Woz is a true computer hardware pioneer; but he’s certainly not an AI expert and Elon, well, I’m not sure where his expertise lies, but it’s not AI.

When it comes to creating AI capable of commanding troops on a battlefield, I am probably one of the world’s top experts on the subject (it’s not a crowded field). I’ve been writing and studying ‘computational military reasoning’ for my entire professional career, it was the subject of my doctoral thesis, I’ve written AI for numerous computer wargames and I’ve been a Principal Investigator for DARPA (Defense Advanced Research Project Agency) on this very subject.

I am confident in stating that no humans have been injured or died as a result of my work in computational military reasoning. However, the most recent NHTSA data reports that there have been at least, “419 crashes [and]… 18 definite fatalities of autonomous self-driving vehicles (like Mr. Musk’s Teslas). So, clearly, in some circumstances AI can be dangerous. In all fairness, I should state that the reason the self-driving autonomous vehicles keep having fatal crashes isn’t technically the AI; it’s that the AI has imperfect information about the world in which it operates. The AI for self-driving vehicles gets that information from cameras and radar (LIDAR would be good, too). However, Telsa just removed the radar from it’s vehicles (“Elon Musk Overruled Tesla Engineers Who Said Removing Radar Would Be Problematic: Report,”) leaving the AI even more in the dark about the world in which it operates. So, is the AI at fault or corporate management? Maybe the problem isn’t AI.

Furthermore, most of what’s being sold to the public as AI are just some string manipulation parlor tricks tacked on to an internet search. ChatGPT-4, which is making all the headlines these days, was recently accurately described:

“Put simply, ChatGPT takes an initial prompt and determines – on an individual, word by word basis – what most often comes next based on the existing texts that it has scanned throughout the internet. In Wolfram’s words, “it’s just adding one word at a time” – but doing it so quickly that it seems as though a robot is writing an original, whole block of text.

Essentially, ChatGPT is a gigantic version of Google autocomplete.” – ​AI or BS? How to tell if a marketing tool really uses artificial intelligence

I recently asked ChatGPT for a quote from U. S. Grant about war and it responded:

Actually, it was W. T. Sherman who said, “War is hell.” But, ChatGPT has no real intelligence. How it erroneously linked Grant to the quote I have no idea. The greatest fear we should have of ChatGPT is incorrect citations in reference papers. The creators of ChatGPT have clearly traded accuracy for glitz and hype; it’s not even a good internet search engine, but it sure seems impressive!

There’s one more thing you should know. There are two kinds of machine learning: supervised and unsupervised. Probably >95% of machine learning programs are ‘supervised’; which means they are ‘trained’ on a data set. Whenever you see the words ‘training’ in reference to machine learning you know it’s supervised. Here’s an example of supervised machine learning: Netflix movie recommendations. Every time you select a movie on Netflix you are training their system on your likes and dislikes. It does a great job, doesn’t it? No, it does a terrible job. It once recommended Sound of Music to me because I watched Das Boot. Makes perfect sense. They both take place during WWII.

What I’m saying is that there is no ‘there’ there. There is no intelligence there. Somebody at Netflix (at one time I read they employed out of work screenwriters) tagged both Das Boot and Sound of Music with the same descriptor; presumably ‘WWII’ or ‘war movie’ and that was all that was necessary for Netflix to make a terrible suggestion.

I work in unsupervised machine learning. It doesn’t search the internet, or look for similar words in a big data base. It tries to make sense of the world in which it operates (a historic battlefield) and attempts to make optimal decisions for moving units based on math, geometry, trigonometry and boolean logic.

That’s AI. And it’s not dangerous. Autonomous self-driving cars? They’re dangerous.

References

References
1 Though I have to admit losing $20 billion in a few months is impressive.

Schwerpunkt: Calculating the Optimal Point of Attack

MATE’s analysis of Blue (Union) position at Antietam. NB: Unable to outflank Red’s position, MATE has calculated the Schwerpunkt, or optimal point of attack on Red’s lines. Click to enlarge.

The holy grail of military science is an algorithm that calculates the optimal point of attack upon an enemy’s lines. In German, the word is Schwerpunkt and is commonly translated as “the point of maximum effort.” I have written extensively about Schwerpunkt previously in this blog, in academic papers and in my doctoral thesis.

MATE (Machine Analysis of Tactical Environments 2.0, the AI behind General Staff: Black Powder) is now able to calculate Schwerpunkt to a new, substantially greater, degree of accuracy. There are a number of reasons why this is now possible, but the primary cause must be the ability to analyze the battlefield in 3D and to accurately map where every unit on the map can project its force. Indeed, for many years now I have looked at the problem of computational military reasoning (AI for tactical situations) as a force projection problem.

Below, is a visual representation of the total force projection of all units at Gettysburg, Day 3 (July 3, 1863 0600 hours):

Visual representation of the total force projection (Range of Influence, or ROI) for all units at Gettysburg Day 3. Note: normalization and alpha values affect color output. Also, note how the terrain (woods, depressions, hills) shape the projection of force. Also, all projections are independent of unit facing. Click to enlarge.

If we ask MATE to determine the Schwerpunkt for the Confederates in the above situation, it responds with:

MATE’s selection (labeled OBJECTIVE) for Red Schwerpunkt. Click to enlarge.

And adds the following commentary (edited for brevity, the numbers are the Premise Statement ID#s. This is basically a logic trace of MATE’s thinking):

8|∴ The enemy does not need to capture more Victory Points.
9|∴ The enemy will be on the defensive.
...
22|The enemy's flanks are anchored.
23|[9] + [22] ∴ Frontal assault is the only remaining option.
...
25|COA: Battle Group #1 (Mixed) assigned objective Weak Point Calculated by ROI coords: 551,232
...
33|Red Battle Group #1 is opposed by Blue Battle Group #6
34|Red Battlegroup # 1's strength = 21,663
35|Blue Battlegroup # 6's strength = 13,635
36|Red Battlegroup # 1 has a numerical advantage of 8,028. Red has a 1.59 / 1 advantage over Blue Battle Group #6.
37|Distance to objective is 1,029.86 meters.
38|The maximum slope along the line of attack will be on an upward slope of 3.64%.
39|The attacking avenue of approach will be in enemy ROI for 541.18 meters.
40|The greatest enemy ROI along the avenue of approach is: 1,276.00 .
41|There is an unrestricted avenue of attack.

In other words, MATE has found a path to its objective that encounters the least amount of enemy projection of force. MATE would much prefer to flank the enemy position but it has calculated that this is impossible (#22, above).

ROI (Range of Influence) is calculated using values set up for each unit in the General Staff Army Editor and running a 3D Bresenham line algorithm to ensure that there is direct Line of Sight (LOS) to that point.

Screen shot of the General Staff Army Editor showing the interface for entering values for a typical artillery unit. Note that the accuracy curve is user editable (there are also default curves for various common weapons). Click to enlarge.

It is because every unit has an accuracy curve attached to it we can exactly map out the overlapping fields of fire (see above) and we can precisely calculate how long each attacking unit will be under fire and its intensity. That is how MATE chooses the optimal attack point: the path where its troops will be under the least amount of fire.

When MATE is presented with a tactical problem it first determines what it needs to do to win; is it on the offense or defense? On the offense, MATE will next check to find the enemy’s open flank and, if there is one, are there any crucial choke points on the flanking route? If MATE is unable to ‘fix and flank’ the enemy, and it has determined that it must be on the offensive, MATE then calculates Schwerpunkt (above). With this new Schwerpunkt algorithm the last big piece of the offensive AI puzzle is in place. Ironically, much of MATE’s defensive calculations involve first figuring out how to attack itself and then countering what it determines are its own optimal moves against itself (see this blog).

As always, please feel free to contact me directly with comments or questions.

A Human-Level Intelligence at Quatre Bras

Quatre Bras, June 16, 1815. Click to enlarge

Napoleon has humbugged me, by God!” Lord Wellington swore. “He has gained twenty-four hours’ march on me!” 1)David Chandler, Waterloo: The Hundred Days, Macmillan Publishing Co., Inc. New York 1980, p. 85 And, indeed, he had.

The Armée du Nord, racing north on the roadnet from Paris to Brussels, now occupied the crucial strategic ‘central position’ between the Anglo-Allied army under Wellington assembling at Quatre Bras in the west, and the Prussian army under Blücher at Ligny in the east. Napoleon, outnumbered by the combined forces of Wellington and Blücher only had one realistic option: destroy his opponent’s armies separately before they could combine and destroy him.

Napoleon divided the Armée du Nord into two wings (the left commanded by Marshal Ney and the right by the Emperor, himself). The Imperial Guard would serve as the strategic reserve. In our previous blog, we showed the MATE (Machine Analysis of Tactical Environments) artificial intelligence analysis of the battle of Ligny.

The starting positions of the Armée du Nord (Blue) and the Anglo-Allied Army (Red) at the battle of Quatre Bras. Screen shot from General Staff: Black Powder. Click to enlarge.

The positions in the above screen shot come from the West Point Atlas of the Napoleonic Wars and Chandler’s Waterloo: The Hundred Days. I’ve ordered Mike Robinson’s The Battle of Quatre Bras, 1815 (which is very highly regarded) but it’s coming from Europe and will be a while before it arrives. I’ll update the positions accordingly when it arrives.

Today MATE is going to show off a new trick that it learned.

MATE AI analysis of Blue’s position. General Staff screen shot. Click to enlarge.

Text output and author’s commentary of MATE’s analysis of Blue’s position at the battle of Quatre Bras.

The salient points of MATE’s analysis of Blue (Ney’s) position at the battle of Quatre Bras are:

  • Red (Wellington) has an open flank (in fact, both of Red’s flanks are exposed but MATE has calculated a left flanking maneuver is shorter than a right flanking maneuver)
  • Blue has a reserve cavalry division (Line #25 in the text output above, Battle Group #3, Pire’s 2nd Cavalry Division) that is in position to spearhead the left flanking maneuver ahead of
  • Battle Group #1 (the 6th Division commanded by Prince Jerome) which will follow as the main strike force of the left flanking maneuver (Line #23)
  • Battle Groups #0 and #2 (Reilles and Foy’s divisions) will be the fixing force attacking Gémioncourt in the classic envelopment maneuver (see below):
  • Battle Group #4 (Kellerman’s reserve cavalry division) will snatch the important crossroads at Thyle.

In other words, Battle Groups #3 and #1 will be the Enveloping Force and Battle Groups #0 and #2 will be the Fixing Force as illustrated in the above graphic from the U. S. Army Field Manual 3-21. Algorithms for implementing this maneuver (an early version of MATE) first appear in my paper, Implementing the Five Canonical Offensive Maneuvers in a CGF Environment.

And MATE’s new trick? It’s in line #25, above. If there is a Battle Group that is composed entirely of  cavalry and horse artillery, and it is close enough, it will be used as the spearhead for the flanking maneuver.

MATE’s analysis of Ligny. Screen shot from General Staff AI Editor. Click to enlarge.

But, in this situation (Ligny, above) MATE has calculated that Battle Group #1 will get to the crucial Choke Point (labeled in black, above) before the reserve cavalry Battle Group #4 will arrive and would create a tremendous bottleneck at the very choke point that MATE wants to quickly capture. Consequently, the cavalry has been left in reserve.

Mini MATE FAQ

Can MATE read and analyze any battle map from history?

No. MATE is integrated into the General Staff Wargaming System. MATE can only ‘understand’ Order of Battle (OOB) tables created in the General Staff Army Editor, maps created in the General Staff Map Editor and scenarios created in the General Staff Scenario Editor.

What is meant by a ‘human-level’ artificial intelligence?

Perhaps you have heard of the famous Turing Test (from Alan Turing’s Computing Machinery and Intelligence). In it he describes, “The Imitation Game,” where a computer is in one room behind a closed door, and a human is another room behind a closed door. A third person, the ‘interrogator’, can only ask questions via a teletype (an ancient I/O device consisting of a keyboard and a printer) and must determine in which room the computer is and in which room is the human. In Turing’s original paper the interrogator would ask questions of the two subjects such as, “Please write me a sonnet on the subject of the Forth Bridge,” and, “Add 34957 to 70764.” Currently, no Artificial Intelligence (AI) could pass such a test; the subject area is far too broad. However, it has been my thesis, that an AI could pass such a test if the subject area is restricted to a narrow field of human endeavor, such as commanding units on a battlefield. If, in the above Turing test, the computer in one room was replaced with MATE, the human in the other room was replaced by Napoleon, and the teletype was replaced by the General Staff Wargaming System, I argue that MATE could (or soon will be able to) pass such a test (subject matter experts would not be able to discern if it was MATE or Napoleon giving orders).

Can MATE analyze current military situations?

Though MATE came out of the TIGER (Tactical Inference GenERator) project funded by DARPA, it is currently set up specifically for the General Staff: Black Powder project which limits analysis to scenarios in the 18th and 19th centuries. It is intended that this project will be followed up with General Staff: Modern Warfare to specifically work with 20th and 21st century combat.

References

References
1 David Chandler, Waterloo: The Hundred Days, Macmillan Publishing Co., Inc. New York 1980, p. 85