Command line AI vs AI play feature
-
@igbi
Hi
I have spent a lot of time trying to get the best out of the TripleA AI and prefer the less considered approach of Fast AI, it 'looks' like it takes risks and plays aggressively, unlike the Hard AI, which is more considered and calculates/ranks its moves/attacks accordingly.The map makers of the A&A boardgames did not attempt to get the best out of the AI because their focus was on PvP.
These might of interest?
https://forums.triplea-game.org/topic/3743/how-to-make-a-map-ai-friendlyhttps://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides
1941 Global Command Decision is probably the first game intended to played against the AI using Fast or Hard. It uses a TripleA function of isAI that tests if a player is being played by Fast or Hard AI.
I use isAI to make up for some of the short comings of the AI, like buying units on its behalf and placing them on the map and free units like Industry's/Factories that it should buy but doesn't and the AI places them from its stock.
It also has 50+ extra Capitals in the xml code, these are to guide the AI into what's important to the player and influences the AI play style.
It appears to be incredibly popular as it racks up over a 1000 views per day. :exploding_head:
https://forums.triplea-game.org/topic/3326/1941-global-command-decision-official-thread
-
@igbi You should be aware that the original version of Axis & Allies: 1942 2nd Edition has serious balance issues. I would suggest focusing on the Anniversary Edition (V3 in Triple A parlance). It is better balanced and a more interesting game. An alternative is the Revised Edition (V2) is well-balanced and the AI plays it well.
Approaching TripleA like Chess would be an exercise in frustration. The AI in TripleA is adequate as an opponent but a human with a few games played should be able to beat it.
TripleA is a game engine designed to simulate actual and hypothetical wars. The many mods aren't fragmentation, they should instead be seen as different approaches to simulating history (or even different wars). Axis & Allies is part of a broad group of wargames.
-
@thedog said in Command line AI vs AI play feature:
@igbi
HiAt this point, I don't know who the major developers are, and the user names on github.com/triplea-game don't match up with the user names here, but, hey, thanks for the software. It seems to be a good compromise between that which is practical and that which is artistic, with Java portability.
I have spent a lot of time trying to get the best out of the TripleA AI
I got no complaints. I assume developers here could up the sophistication, but it all takes time. On the other hand, AI engines are a specialty, and the best of engines are usually tied into some heavy computer science and mathematics theory. A game usually needs a huge following before the specialists jump on the bandwagon.
[...] and prefer the less considered approach of Fast AI, it 'looks' like it takes risks and plays aggressively, unlike the Hard AI, which is more considered and calculates/ranks its moves/attacks accordingly.
So yesterday, what I did is run a mod named
gezz_ww2_BRvSFE20 times withHard (AI). The split was 12 to 8, from 25 to 56 rounds, 40 rounds being typical.Today after reading your post, I ran
Fast (AI)on a mod, and it seemed to do okay, but then that wasn't the mod I did yesterday.On the first run for
gezz_ww2_BRvSFE,Fast (AI)didn't work at all. At the bottom of this post, I show a screenshot. The Japanese are clearly ahead180to120in production, butFast (AI)gets stuck in a bad loop. I've seen that occasionally with a mod namedgezz_270bc-ww2v3, maybe 1 time every 50 games, butHard (AI)generally makes progress against itself.What does this bad loop mean to me? It means doing computations is important, because making progress against the other side is not simple.
Occasionally, I observe the game play to check for activity in parts of the map that I want active.
Roger, above, largely confirms what I've seen. It does land battles good on contiguous groups of territories, but doesn't work near as well for islands in sea zones.
But my mod of
world_war_ii_v5_1942breaks with typical ww2v5 play, and I assume the AI is optimized for typical play.Explaining the mod a little, the starting point is two victory territories, each with only a factory. All other territories are either neutral or impassible. And there's the change
property name="Neutrals Are Impassable" value="false".As a beginner, I start the game, I look at the map. At least at the start, it's something that seems to make sense.
The map makers of the A&A boardgames did not attempt to get the best out of the AI because their focus was on PvP.
And that seems to reflect what I've seen when looking at forums on axisandallies.org, trying to figure out how it is that a person actually plays other people online.
There are high-level players, and they dominate, and though the AI may be useful to them, it seems it's not of great importance to them, because they're playing the bigger and more complicated mods and maps.
These might of interest?
https://forums.triplea-game.org/topic/3743/how-to-make-a-map-ai-friendlyhttps://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides
Before making this first post, I looked on GitHub and found the AI overview:
https://github.com/triplea-game/triplea/blob/master/docs/development/ai-overview-and-backlog.md
Several places now, I've something like this:
It performs pretty well on maps based on revised/V3/V1 rules in that order.From those, I pick ww2v5 because I assume it closely matches the box set Axis & Allies 1942 2nd Edition. There's 1941 and then Global, but ww2v5 seems to be the best compromise for what's being currently sold.
1941 Global Command Decision is probably the first game intended to played against the AI using Fast or Hard. It uses a TripleA function of isAI that tests if a player is being played by Fast or Hard AI.
I think it was in 2023 that I made my first attempt to do TripleA. I experimented a lot and then deleted everything.
In that time, I meticulously went through the maps on https://triplea-game.org/maps-list/maps/
Today, I looked there, but 1941 Global Command Decision is not there. However, it's on GitHub, and now I see that there are 329 repositories on https://github.com/triplea-maps
But I did see Total World War, which is a beautiful, big map. Ultimately, I decided to go the simpler, more standard route, which is the decision I make today, having thought it through in the past.
PROBLEM: To learn how to play 1941 Global Command Decision, I have to become a good player with the standard games, because most of the video tutorials and better rule books are primarily for those games.
And suppose I'm a good player at the standard games, that only makes me a competent beginner for the big maps.
It says 2.7.14848 is required which was released 2024-July-30, so optimizing the AI for solo play seems to be a current phenomena.
If you change ww2v5 in the wrong way, it ceases to be close to the game described in the rule book. But it seems stacking limitations don't fundamentally change the rules.
Looking at
1941_global_command_decision.xml, I see the<!-- Go Stack -->section.Maybe I'll experiment and add some of that to my ww2v5 mods. Or maybe I won't, because I don't see any numbers to change to limit the stacking.
At this point, it's all good. There are no problems, there are only workarounds.
--IGBI

-
@rogercooper said in Command line AI vs AI play feature:
@igbi You should be aware that the original version of Axis & Allies: 1942 2nd Edition has serious balance issues. I would suggest focusing on the Anniversary Edition (V3 in Triple A parlance). It is better balanced and a more interesting game. An alternative is the Revised Edition (V2) is well-balanced and the AI plays it well.
In my first research into TripleA, I had to work a little to match up the TripleA maps with the box sets. Eventually, I created PC folder titles for docs and links which are the following:
- ww2v0 - 2nd Edition (1986)
- ww2v2 - Revised (2004)
- ww2v3
- ww2v4 - Spring 1942
- ww2v5 - 1942 2nd Edition (2012)
- ww2v6 - 1941 (2012)
ww2v3confused me for a while, because I guess it doesn't match up with a boxed game.Based on your recommendation, I installed the map again and looked at it, and I suppose I was tempted to maybe try it, but my general rule is to try and stick with standards.
The artwork looks nicer, in my opinion, but ultimately, my decision comes down to what map is currently being sold, which means it has a good rule book, and what map has sufficient tutorials on YouTube, which indicates its popularity.
The balance thing is unfortunate, but seems like it's the easiest thing to fix.
Approaching TripleA like Chess would be an exercise in frustration.
Maybe we're thinking about it differently. I don't play chess, but chess tactics revolve around doing calculations, where a calculations is "if I do this, suppose he or she does that", and the good players will do this multiple calculations deep for multiple paths of calculations. (Something which lots of people know.)
I'm thinking good A&A players do this some, as in, from experience, they've seen that if the opponent makes a certain move, they can respond with moves which results in the opponent making another weak move. But that's just a guess. Maybe thinking 3 to 5 moves ahead doesn't apply in A&A.
There's also my very brief research into how chess engines work. Chess is complicated, so there's also a simpler game, Connect 4, where people write on how the AI works.
I try to build off of what others have done. Preferably, someone would write long, tutorials on how that super strong A&A AI engine works, but if the best AI engine action is in the chess world, that's where I have to go to learn, or see that I should just forget about it all.
The buzz words for algorithms I see in searches are
minimaxandalpha-beta pruning. Finding tutorial pages is the easy part.- Solving Connect 4: how to build a perfect AI, blog.gamesolver.org
- Building My Own Chess Engine, healeycodes.com
--IGBI
-
@igbi ww2v3 is the Anniversary edition. https://boardgamegeek.com/boardgame/35052/axis-and-allies-anniversary-edition. It is widely available as a boxed game.
There is no ww2v0. The 1986 edition is called World War II Classic. (The original 1981 game has been partially implemented
The MinMax algorithm and Alpha-Beta pruning are not workable approaches in a wargame. There are too many possible moves to try to brute force a solution. Writing an AI for Chess gives no help in writing an AI for A&A. You need to use completely different techniques.
The fundamental difference between chess-like games and wargames is that in wargames you can move multiple pieces in your turn.
-
@rogercooper said in Command line AI vs AI play feature:
@igbi ww2v3 is the Anniversary edition. https://boardgamegeek.com/boardgame/35052/axis-and-allies-anniversary-edition. It is widely available as a boxed game.
Thanks for the info.
So finally, I got that one straightened out. Straightened out means I finally matched up three things: the TripleA GitHub map filename, the manufacturer product name, and the PDF rule book.
The problem was that "Anniversary" is used multiple times in the name of different products. There's this page withe PDFs:
https://www.axisandallies.org/resources-downloads/
The release dates are what I finally started using to lock in on specific product names, but they call it
Axis & Allies 50th Anniversary Editionand don't provide a release date. This, axisallies.com/rule-books, calls the revised versionRevised (20th Anniversary).There is no ww2v0. The 1986 edition is called World War II Classic. (The original 1981 game has been partially implemented
The ww2v0 is my naming to make it line up with ww2v2 to ww2v6.
The MinMax algorithm and Alpha-Beta pruning are not workable approaches in a wargame. There are too many possible moves to try to brute force a solution.
First, any AI study on my part will be the tail-end part my pursuit here. It's doubtful I'll get that far.
As to brute force, using the Skid vs. PC chess GUI, I would watch the analysis window for Stockfish. I would set it up to analyze 20 paths, and each path would be about 20 or more moves deep. It was not deterministic at all, meaning it wouldn't always do the same thing.
To brute force is to potentially try all possible solutions. I know nothing much, but the number of possible 20 move sequences for a given chess board can be very large. Too bad my combinatorics skills are so weak.
I'm pretty sure that in chess engines, they use random number generators to pick one of many possible moves, as part of their complex algorithm.
Writing an AI for Chess gives no help in writing an AI for A&A. You need to use completely different techniques.
I wouldn't study chess engines to write a chess engine. I would study chess engines to see if there's anything there I can apply to a TripleA AI engine.
It's definitely not efficient, but that's the nature of trying to do things in a niche field where the world hasn't piled in.
The fundamental difference between chess-like games and wargames is that in wargames you can move multiple pieces in your turn.
So I did a quick search on war game ai (duckduckgo.com). It didn't offer me any hope of finding a tutorial on wargame AIs.
(UPDATE: After posting, I noticed that Roger said "wargame", but I had searched on "war game". However, searching on "wargame ai" returns links to government military style wargaming, like from that research group RAND.)
In the past, I think I searched on a generic phrase like "game AI". The problem is that first-shooter type games dominate. And I found gaming textbooks, but but their AI chapter is geared to things like humans moving around and shooting each other.
What you say is a little at odds with my overall view from reading stuff. There's checkers which has been solved, but chess hasn't been solved.
It's obvious that chess is much more simple that A&A, but it's not so simple that it's a solved game.
Graph Theory, First Things First
First I need to describe all the interdependencies for a fixed state of an A&A game. Graph theory. I'm pretty sure graph theory is the key to doing much of that.
Thanks for the feedback.
--IGBI
-
@igbi
Here is a list of Devs on this forum, some names dont match their GitHub names. Only wc_sumpton is active.
redrum (AI wiz)
Frigoref, LaFayette, Myrd, Trevan,
wc_sumpton (wrote isAI, but cannot change any code without one of the above Ok-ing it)
.
Just in case you dont know about AI logs
Debug> Hard AI> Show Logs
Very useful for balancing maps, as you can see what weight the AI puts on purchasing certain units. Sadly not all obvious values are weighted, like negative Atk/Def values..
Beta Features, sometimes the Devs 'hide' new stuff from most players, so others can test it.
Game> Engine Settings> Testing (tab)> Show Beta Features> True> Save(buton).
This link might be of interest, Trevan was working on FlowField (AI) as seen in the pull down menu, when Show Beta Features> True>
https://forums.triplea-game.org/topic/2486/ai-territory-valuation-visibility?_=1742112223979
Dont get excited it is not complete.This map page is years out of date, as you know.
https://triplea-game.org/maps-list/maps/.
This map is a bit like Chess, hexes, 4-6 units aside
It has to be played on Fast AI as Hard AI does not take risks and the human player will always win.
https://forums.triplea-game.org/topic/3264/arena-of-death-official-thread
https://github.com/triplea-maps/arena_of_deathProving that the AIs, although written for A&A can be bent to play lots of similar style war games.
-
@igbi said in Command line AI vs AI play feature:
The ww2v0 is my naming to make it line up with ww2v2 to ww2v6.
When 1, 2 and 3 actually mean first, second and third, there is no zero (traditionally). What comes immediately before 1 is -1.
Anyway, Classic Second Edition is V1. Mind you, "V1" stands for "Classic", not for the edition here: the Classic Third Editions, basic or Iron Blitz, are also V1.
-
@cernel The differences between Classic Second Edition, Classic Third Edition and Iron Blitz are minor.
-
@thedog said in Command line AI vs AI play feature:
@igbi
Here is a list of Devs...Nice to know if I can make future connections.
Just in case you dont know about AI logs
Debug> Hard AI> Show Logs
Very useful for balancing maps, as you can see what weight the AI puts on purchasing certain units. Sadly not all obvious values are weighted, like negative Atk/Def values.I looked at the dubug window once, but thanks for the note.
After all these years Java still doesn't have the magic to make things readable as a default. The font is really small (but usable), but the number of rounds field is not large enough to show the number.
On first thought today I said, "Don't really need that." On second thought I said, "Hmmm, undoubtedly, I should eventually parse that into a nice form so I can study it in-depth." One more thing to add to the pipedream.
Beta Features, sometimes the Devs 'hide' new stuff from most players, so others can test it.
Game> Engine Settings> Testing (tab)> Show Beta Features> True> Save(buton)Great. So
FlowField (AI)shows up as an option, but inDebugdropdown, there's no logfile option. But there are heatmaps to look at. Shows that somebody is thinking about trying to better enable multi-territory battle tactics (I guess). Long ago I figured out that if I have some formative idea, most likely some expert has already completely formalized it.All good, except that the list of heatmaps extends off the screen, and I have a 2560x1440 monitor. Not a problem for me actually, because I generally let others work out the problems for beta or alpha stuff.
Parsing and studying
Hard (AI)logs would probably teach me more anyway, with probability 0.14 that I'll ever get that far.This link might be of interest, Trevan was working on FlowField (AI) as seen in the pull down menu, when Show Beta Features> True>
https://forums.triplea-game.org/topic/2486/ai-territory-valuation-visibility?_=1742112223979Dont get excited it is not complete.
With information overload, everything becomes a blur. In writing my last stuff, I was thinking I had read something about what you say. Most likely it was your sentence just now.
This map page is years out of date, as you know.
https://triplea-game.org/maps-list/maps/A case of a person investing their life in the old rather than the latest and greatest. A person missing out on opportunities, abandoning what otherwise might have been pursued with great success. We've all seen when that person shows up and makes a post. Do we laugh? Do we pity them? A combination of both maybe, or we quickly scroll past to something more interesting.
In my case it turned out for the best. The market value is in the manufacturer box set names.
But 270BC, I'm glad it was there. It has a historical reference, is great art, has name value in "Romans" and "Greeks", and most people will have no expectations for how it's used, so it can be modded without people thinking, "What's up that? Skilled modders take into account history and geography. You're such an amateur."
It gave me the ideas I use for modding ww2v5, even though it's all wrong. All that's important to me is that when I play my mods, I'm learning the rules of Axis & Allies 1942, 2nd Edition.
On Amazon, ww2v3 costs $100, where ww2v5 costs $45. And there's a big series of videos on Youtube for ww2v5, I assume because they paid or sponsored the person, they being axisandalliesonline.com. But I wouldn't know. Not a bad thing, but even a good thing in this case.
--IGBI
P.S. The next post will most likely be the end of my long-winded posts here.
-
@cernel said in Command line AI vs AI play feature:
@igbi said in Command line AI vs AI play feature:
The ww2v0 is my naming to make it line up with ww2v2 to ww2v6.
When 1, 2 and 3 actually mean first, second and third, there is no zero (traditionally). What comes immediately before 1 is -1.
Anyway, Classic Second Edition is V1. Mind you, "V1" stands for "Classic", not for the edition here: the Classic Third Editions, basic or Iron Blitz, are also V1.
No need to reply here. But when writing a response to the last post, I thought there was a going to be context in another post to engage in long-windedness, but actually there's not.
And then I thought, I'll go ahead and summarize some thoughts anyway about "Some Hypothetical Great A&A Analysis Tool vs What is an AI", but in the light of that every good thing comes to an end, every marginally good thing needs to be brought to an end.
As to confusion amongst naming, there's the manufacturer, a large corporation, and then there's the user. The user is looking for free software written by benevolent developers, and confusion on the user's part results in the wasted effort of answering the same questions over and over.
As to the large corporations, confusion many times makes them money. Bought that $100 version instead of the $45 version, because you were confused?
The Original Topic Title
I put out a request. Maybe in a year or two the developers decide it's something they want.
I only created an account to make the request. The software is good as it is.
--IGBI
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login