We use cookies to help give you the best possible experience on our site. Strictly necessary and functional cookies support login and shopping cart features, they cannot be disabled. Performance cookies support site performance analysis. These are optional and will be disabled if you click on Reject.

By clicking Accept you agree to our use of Performance cookies as detailed in our Privacy Policy.

 

Accept Reject
 
home / news / War in Spain 1936-39
< go back

War in Spain 1936-39 | Dev Diary #3

socials
Published on December 10, 2025

War in Spain - Artificial Intelligence (AI) System(s)

 

By Joe Wilkerson - Project Leader

War In Spain 1936-1939

Joint Warfare Simulations

 

As mentioned in Dev Diary #2, our team wanted to create a new series of games inspired by War in the Pacific Admiral’s Edition (AE).  The look and feel of the UX/UI and the player’s roles are very similar to AE. But the AI system in War In Spain (WIS) is a significant departure. AE relied heavily on scripted AI. The Tactical Land AI in WIS (which I will focus on today) does not use scripts. It is a true AI, which analyzes METT-L for each unit every turn before determining actions for that unit. METT-L means Mission, Enemy, Terrain, Troops and we add "Logistics" as a separate, called-out dimension, due to its overarching importance. German General Erhard Raus wrote in “German Operations Against Soviet Breakthroughs” that the War in the East was about attacking the enemy logistics and defending one’s own. Similarly, Jomini wrote that military operations must attack an enemy's lines of communication while protecting one's own - same idea. We based our Tactical AI around these principles, as after analyzing how we ourselves play, we finally realized, this was the essence of how we play!  

AI tied to Logistics



The screenshot above shows my plan as the Republicans for an attack towards Zaragoza at the start of the game. I choose to attack down the rail lines as these are the primary lines of communication, especially for Corps-level and larger formations. As explained in Dev Diary #2, players can also use the logistics-enhancing units, the LogR (rail), LogT(truck) and LogF(foot) to increase supply movement capacity in a given area. The LogR farther back for the Corps and the LogT and LogF farther forward for Division and below.  

   
We have trained the “Tactical Land AI” to plan and operate in this same way, the way we play.     

The goal of this operational offensive was to capture Zaragoza. I planned an inner ring to surround and then attack into Zaragoza, as well as an outer ring, facing out towards any counterattacking enemy to stave off their efforts. In scenario two (Zaragoza o muerte 1936), the player has 60 days to capture Zaragoza. In my 3rd attempt at this scenario I finally got it done. It is tough against the AI as it has a strong defense of Zaragoza (roughly division strength) and counterattacks from all directions to try to break the siege. It plays operationally just like I would. To be honest, it’s the best wargame (computer game) AI I’ve ever played against. And I’ve played against most of them!

 

To drill down further into the Zaragoza counterattack, in the above screen shot, the black box popup is the mouse over view of Zaragoza, showing the enemy (Nationalist) forces in the hex, and HQ, and Artillery unit and a few rear area units. Below in the bottom bar, we see one friendly infantry battalion and six enemy units, which have broken out of Zaragoza to the NW. In various hexes around Zaragoza, you see our purple units defending against Nationalist (yellow) forces attacking towards Zaragoza, mostly from the N, NW and NE. It took me several turns to regain control of the situation and refocus my efforts on Zaragoza.

Here’s a screen shot of what we had in Zaragoza.



Five Infantry, 3 Militia, 4 Engineers, 2 Artillery. Every few turns we would swap out these troops for others that were outside the town resting.  So we actually had about double this force in the inner ring. The outer ring was primarily weak militia companies and “regiments”. They could at least detect enemy counter attacks so more units could be shifted from quieter sectors of the outer ring to reinforce. To the NE and NW the AI had a number of units attack us and even recapturing some of the towns we had held. At one point I thought they would link up, but I managed to push the breakout force back into Z-town before the link up happened. These turns really did feel like I was playing a human.  

Defense Against Breakthroughs
We worked extra hard to implement General Raus’ and Jomini’s ideas. There was a point when our AI could do a great job at attacking, but would “freeze up” on defending against breakthroughs. So we re-read General Raus’ book and spent the better part of a year completely revamping the AI defense against breakthroughs. This includes when to reinforce (or not), when to counter attack (or not) and when to withdraw (or not). More complex choices, required more tweaking of the code and a LOT of testing.    


I recall playing a campaign game against the AI, with me as the Republicans and in the North East area of Spain. I had broken through and captured a few small Nationalist ports along the NE coast. In a few turns, the AI made an amphibious counter-landing up there and recaptured those ports. I was incredulous at this result and asked Alessandro (the Tech Team Lead and Lead Programmer) if he was surprised.   He said “Yes”, he also expected the AI just to move these reinforcements to the land front, instead of landing them in our (new) rear area and counter-attacking where we were weakest! So even the guy that wrote the code could see results he could not predict - wow!
 

Actual AI - No Scripts
Each turn, the AI considers each unit and the immediate environment around that unit. This includes the state of its people, disruption, fatigue, supply, effective troop strength, terrain, etc. It also considers what it knows about the enemy in these regards. It will then determine a mission for that unit, based on overall friendly and enemy posture in that area and all other relevant factors. There are no scripts, there are no scripted behaviors to guide the AI.  

A scenario designer “may” employ “start of scenario scripts” to create a specific historical event at the start of a scenario. At one point we had a few in War In Spain, but they have all been removed as we finally realized they were unnecessary. There might be cases where they are, but we don’t have any such cases in WIS, even for the triphibious operations such as the Balearic Islands scenarios.  

 

Counter-Attack versus Defend In Place

I also recall playing several games as the Nationalist versus Republican AI in the “Battle of Republic del Norte 1937” scenario. My goal was to break through, somewhere, to the coast. I tried 3 different games. I finally, barely succeeded the third time. If I left any small hole in my line, to improve concentration at an attack point the AI would quickly gather forces and counterattack there. I learned I had at least some small units covering my gaps to buy time for reinforcements if needed. For most AIs I’ve played against, having air recon covering such gaps is usually sufficient. But not in WIS, the AI moves too fast!   Eventually, I was able to break through to the coast at Gijon, using lots of faints and transferring many units from other fronts. It’s rare for me to have to play so historically to beat an AI!   

 



While the AI was keeping me honest around my weak spots, it was also reinforcing the positions to my front. The AI tracked my base captures and realized one of its major cities (Gijon) was threatened and acted accordingly. Time and time again, I got stopped on one path and had to shift emphasis laterally.    Fortunately, the dumb human was able to do that. And having more troops overall to begin with and continuously shifting my specific line of attack (in the same overall area) I was able to slug forward and reach the goal before time ran out. But I’d say the AI played as well if not better than I did.  

Replay Value

The key aspect of this sort of unscripted AI is replay value. It is far more unpredictable than the “formularized” and predictable AIs in most games. Even the guy who wrote it gets surprised, and for the players, that translates to significantly enhanced replay value as the same actions on your part will still generate different reactions on the part of the AI. We hope you enjoy this new experience with what we would call a “real AI”!

WISHLIST THE GAME.

 

Target Games
Search News
Archive
2025
< go to all news