AI Interesting Moves and Points of Improvement on Revised


  • Admin

    Played against AI on revised - @redrum it was pretty fun and some challenge : )

    There were a few interesting moves and some adjustments that could have made the AI stronger. Save game attached and below called out some of the interesting moves made.

    ai_could_do_better.tsvg

    Round 1: Germany uses a tank to capture archangel. There is only a single 50/50 change that it'll be an even trade assuming the tank can kill an infantry while on the defensive. Meanwhile AI then loses the tactical advantage of having a tank near the front line. Attacking the lone tank is a good trade for russia provided the air power and can do so with better than a 50/50 chance of winning.

    Round 2: Japan lost Manchuria with a factory in round 1 against improbable odds. Instead of retaking in round 2, it attacks Buryatia

    Round 3: Germany does SBR in Karelia instead of attacking BeloRussia with one infantry and bomber.

    Round 5: Japan buys an AA gun even though there are no bombers in range


  • Admin

    @LaFayette Thanks for the feedback and showing no mercy to the AI with the full map paint! Here are some responses:

    Round 1: Yeah, this is a tough one. I actually usually make that move with the tank myself and see a decent number of good players do it. While you probably lose a little bit of TUV initially you force Russia to use units/planes in another place. Another way to think about this as well is if you make Archangel worth 3 or 4 instead of 2 then it would probably be a no brainer to capture with a tank which I think shows how close this type of move is. I prefer the AI be a bit over aggressive rather than not take enough territories and this is difficult to perfectly balance across maps given different territory and unit values.

    Round 2: Yeah, that's really bad and geez you had quite some luck round 1/2. I think most Axis players would rage quit if they had the openings that germany and japan did 🙂 This has to do with the AI trying to attack too many territories and ends up aborting 1 of the attacks and in this case it was Manchuria (not a good choice). I'll take a closer look at this.

    Round 3: Agree. This one has to do with the AI wanting to attack Western Europe and Algeria so it deprioritizes other attacks. Then it decides it can't get quite enough units to attack Algeria and aborts that attack. Some of this behavior is caused by dice rather than LL which causes more randomness in the AI. But this is a good turn to train the AI on as there are lots of places it can attack.

    Round 5: The AA gun logic is pretty poor. It tends to be overly conservative and in this case sees the UK fighter in Caucasus as a potential threat where it could lose say Sinkiang or another territory within landing range of bombing Kwangtung. This could be improved a bit but not as high priority IMO compared to your examples in Round 2/3.


  • Admin

    @redrum another test game attached: vs_ai.tsvg

    AI had some pretty good play. Eventually Japan blundered in round 5 effectively handing the game to allies. AI could have made some other good moves, notes below:

    Round 1: Germany allows 2 AA to be in Germany, it may as well move the AA to eastern europe or to Balkans

    Round 2: single tank attack at likely negative net PU. Could conquer West Russia with tank and then retreat

    Round 4: germany used 2 tanks to attack Karelia, bad trade-off as UK can take the units. Losing 10 PU for max likely trade of 8 PU (Germany kills one infantry (+3), territory capture (+2), and likely kills one infantry on defense (+3))

    Round 4: Germany non-combat, moves big tank stack without infantry cover

    Round 4: Japan leaves undefended AA gun in India

    Round 5: 2 tanks and bomber attack archangel, should probably be one tank

    Round 5: BLUNDER: Japan divides fleet and loses most of it to a 99% combat with +60 TUV expected for Americans.

    Round 8: 2 tanks taking siankang, excessive.

    Round 11: Germany retake of Western europe with 1 arty and 2 figs. Should use 2 infantry with figs.



  • I'm not sure if there's interest in additional feedback about the AI - or whether the issues I'm reporting have already been fixed, but here's a saved game from Global 40 2nd e where there were a number of bad moves by the AI. This is still from 1.9, so if there are AI improvements in 2.0, this was not benefiting from them.

    For context, in this game all countries were Hard AI except for Germany and Japan which were being played by human players.

    Round 10:
    Japan completely eliminates a US fleet in Sea Zone 11 that the AI placed in a vulnerable location (US AI placed them there on turn 9).
    A similar thing happens on Round 16 in Sea Zone 14.

    Round 14:
    UK bombs Western Germany with 1 Bomber, which is intercepted by 4 fighters and dies. Seems like a very wasteful move.

    Round 16:
    US has 28 transports next to Gibraltar and 74 units in Gibraltar (of which 56 can be transported).

    It can land them in Normandy or Southern France uncontested. Possibly also in Northern Italy and Southern Italy with a small combat (assuming the British naval base can boost their movement).

    If 56 units are moved, the counter strike from Germany is only 44% with a TUV swing of -125 (i.e. greatly favouring US). Also, UK gets a turn before Germany's next turn and can reinforce with 2 planes and 4 infantry.

    Also, if a Southern Italy landing is possible, then there is essentially no counter-attack available to the Axis.

    I believe this was a must-do for the US player, but the AI did not take the opportunity. Instead, it moved its 28 transports away and left its 70 units stranded in Gibraltar for the rest of the game, with the Axis ultimately winning.

    Other things:

    • ANZAC was messing around all over the map, like sending troops to Africa and Russia, instead of doing something that would be more useful to it locally.
    • US send some troops to Australia at some point, for no reason that I could see.

    As I said, I'm sure there's lots of other blunders, but those were some of the biggest ones I noticed.

    Global_Oct14.tsvg


  • Admin

    Interesting, I've almost noticed that the AI "does not go for the win". It lacks a drive for a death-blow.

    For example, a recent game with allies on revised, AI Germany was doing really well after some bad Russian dice rolls and was pushing to Moscow. It had enough tanks where Russia could have been dead in 2 or 3 rounds. Instead of pushing tanks next to Moscow, building for a round and killing Russia, the AI started to divert towards the middle east for more PUs.

    It makes me think there should be more weight for advancing towards a capital and even more weight for capturing a capital. The subtraction of enemy PUs by not collecting income is very valuable, far outweighing say a +10 or +20 from capturing more territory.


  • Admin

    @Alexei-Svitkine AI testing is always helpful but doing it with the pre-release is definitely more useful as there are a decent number of AI updates there and stable release save games aren't compatible with the pre-release so hard to then retest. I'm primarily waiting til we release 2.0 until doing more AI changes.

    @LaFayette The AI doesn't really plan more than a turn at a time and prefers to attack anything that is beneficial immediately rather than building up for a larger attack. Advancing towards capitals and factories is already pretty high but that won't stop the AI from attacking things it can win immediately.



  • @redrum said in AI Interesting Moves and Points of Improvement on Revised:

    @Alexei-Svitkine AI testing is always helpful but doing it with the pre-release is definitely more useful as there are a decent number of AI updates there and stable release save games aren't compatible with the pre-release so hard to then retest. I'm primarily waiting til we release 2.0 until doing more AI changes.

    The purpose of the game wasn't to do testing, but to play a game. 🙂 I just shared it, in case it was helpful.

    We played on 1.9 because that's the last stable release. (For example, until a couple of days ago, 2.0 had a bug where the game could not advance past the Repair phase - which I just fixed recently in https://github.com/triplea-game/triplea/commit/fcf04c96796bac7bda8b586518b1087ef83009fc.)

    It's unfortunate that 2.0 save game incompatibility is blocking AI improvements.

    Have we considered having 2.0 be able to load 1.9 saves? For example, via a helper .jar built from the 1.9 code that can export to 2.0 format?



  • Okay, I have a save game from Great War map on 2.0 (so save game compatible), where AI played badly.
    For context, in this game, Ottomans and Austria is played by humans and all other countries played by AI.

    Here are some particular dumb things:

    • Early on - e.g. Round 8 - Germany could attack US transports with some subs and sink troops. Yes, transports defend on a 1 on this map, but still, its worth it to sink troops. Also, US should be defending its navy better.
      Screen Shot 2019-11-02 at 7.48.28 PM.png

    • In Round 8, US builds a plane in US. There are no ACs on this map and that plane literally cannot make it out of there. Later in the game, it builds another.

    • In Round 10, Russia built some boats. Why?

    • In Round 11, Germany attacks with a bad force. It has lots of Artillery and infantry, but chooses to attack mostly with infantry. In general, it seems AI was not pairing up Artillery and Infantry in this game - and just left lots of Artillery behind - and moved them into the same territory after in non-combat. Why? (20 Artillery left behind:)
      Screen Shot 2019-11-02 at 7.39.57 PM.png

    • Round 13: Germany does a dumb attack on Crimea when Russia has a strong counter attack
      Screen Shot 2019-11-02 at 7.45.46 PM.png

    • Round 18: Russia is fighting for its life. It decides to buy Cavalry instead of defensive units.

    • In Round 20, lots of Artillery left behind. Attack with 22 infantry and 2 out of 31 artillery. WTF? (The red army is Ottoman who is on the same side as Germany, so no counter attack there.)
      Screen Shot 2019-10-31 at 8.38.53 PM.png

    There's a bunch of other silly stuff in there, but those are some of the most dubious.

    Some other things:

    • AI was basically never buying planes in Europe.
    • Western front battles were very wonky (between France AI and Germany AI). I think neither side played well.
    • Germany spent lots of resources building fleets in the Mediterranean where it was not useful most of the game.

  • Admin

    @Alexei-Svitkine I don't think you actually attached the save game? If you still have it, can you add it here.



  • @redrum said in AI Interesting Moves and Points of Improvement on Revised:

    @Alexei-Svitkine I don't think you actually attached the save game? If you still have it, can you add it here.

    Oops, my bad. Here it is.

    Nov2_GreatWar.tsvg


  • Admin

    @Alexei-Svitkine Responses on the save game:

    • Round 8 Germany - Not sure I agree. Attacking the cruiser is about 4 TUV attack and attacking the transport stack is about 0 TUV attack (80% chance to kill 1 transport which is worth about 12 itself + 6 in units so 18 total but trading 14 TUV in subs for that)
    • Round 8 USA - Yeah, the AI defaults to spending extra cash on planes assuming there is either carriers that can eventually move them or that they have enough range to reach enemies eventually. This is one of the few maps that this assumption isn't true for and additional logic needs added to prevent buying planes in this situation.
    • Round 10 Russia - In this case, the AI didn't know what else to purchase. It maxes out units in Moscow and realizes building units in Petrograd is a waste as they will just die. At that point, it doesn't have anywhere else to place units so decides to buy a few ships. I think you could argue its better to just buy inf in Petrograd or buy some planes instead of land units in Moscow.
    • Round 11 Germany - This is a current limitation of the AI. It essentially attacks with enough units so that it has overwhelming odds and tends to prefer to attack with cheapest units first. Once it hits a certain odds threshold it doesn't add any more units into the attack. The main reason for this is to give it some flexibility in NCM in case another nearby battle goes poorly. But it should have more logic to add in additional units in cases like this though in the end adding those 20 art into the attack only improves TUV trade by like 3-4 so not a huge difference just seems a little odd.
    • Round 13 Germany - I'd probably disagree here. The AI tries to use the minimum number of units to capture the factory (probably should use more art and less inf) and has around a +10 TUV average here for that battle and gets unlucky. It would force Russia to then attack there with probably a +15-20 TUV. So would lose a bit in the trade but stop factory production and force Russia to attack there. Plus trading units with Russia is good to wear them down.
    • Round 18 Russia - Ha. This one is a bit funny looking at it. So the AI tries to use all of its PUs so originally wanted to buy 6 inf but then tries to spend all of its PUs to upgrades 2 of the inf to cavs. It should really upgrade them to arts instead but the "spend remaining resources" logic is a bit basic at the moment.
    • Round 20 Germany - I think you have the wrong screenshot or something here???
    • Planes - AI generally doesn't buy enough planes but this is a tough thing to balance. Generally its better to favor land units as the AI doesn't use planes as effectively as humans.
    • Germany Med Fleet - I quickly glanced through and didn't see them buying too many ships. Mostly just looks like the consolidated what they had to the Med.

    Overall, some good feedback. I think it falls into a few categories.

    1. AI doesn't really have enough production capacity or doesn't know what else to buy so it does kind of whacky things like buy a few ships it really shouldn't, buy a plane where its stuck, or replace buying inf to cav.
    2. Attacking without all units it could and not using higher attack units enough (art). This just has to do with the AI attack algorithms preferring cheap units first and it preferring to 'save' units for NCM after a certain threshold.

    That being said, it does appear the AI does pretty well and eventually the all AI side is winning.



  • That being said, it does appear the AI does pretty well and eventually the all AI side is winning.

    I would argue this is mostly due to Germany (played by AI) not pulling its weight. Besides the issues I mentioned, it basically doesn't focus enough on western front and keeps a massive amount of units in the middle of its territory where it's not useful for most of the game.

    In general, I find both AIs of France and Germany don't manage the western front well. But there is no single disastrous move - just lots of bad moves - i.e. attacking with very few units and leaving them to die later, rather than keeping forces consolidated.



  • @redrum said in AI Interesting Moves and Points of Improvement on Revised:

    • Round 13 Germany - I'd probably disagree here. The AI tries to use the minimum number of units to capture the factory (probably should use more art and less inf) and has around a +10 TUV average here for that battle and gets unlucky. It would force Russia to then attack there with probably a +15-20 TUV. So would lose a bit in the trade but stop factory production and force Russia to attack there. Plus trading units with Russia is good to wear them down.

    Ok, doing the odds, it looks like the attack is a 88% in favor of Germany, which is not as bad as I thought. Still, sending a couple of extra units arti would bring it to 99%. So it should have sent a stronger force to guarantee the win. Gambling with a 12% failure rate is not great for a "hard AI".

    Also, for example, just going from 22/2 inf/arti to e.g. 16/6 (which costs 2 less TUV) results in a 95% win percentage with more units left for the attacker (and thus more trouble for Russia to retake since they all defend on a 2), while spending less TUV on it.

    So I think it boils down to the AI needing to do infantry/arti attacks smarter.


  • Admin

    @Alexei-Svitkine I'll have to look a bit closer at the overall game.

    Here is a PR to address the weird buying cavalry instead of stronger units when its capital is about to fall: https://github.com/triplea-game/triplea/pull/5505


  • Admin

    @Alexei-Svitkine I glanced over the game as a whole and actually the thing that jumps out most is that the Austrians played very poorly (I'd say more so than Germany or Ottos). They often weren't spending their PUs, lost control of Istria area, didn't help Germany much with Russia or Italy, etc. Really their only good play is taking out Petrograd (which was actually kind of lucky and poor play by the Russians). This then causes Germany to have to spend a lot of PUs to help defend Austria and deal with Russia which left it very little for the western front where it just gets overwhelmed by France/UK. It also takes the CPs way too long to take out Russia and by the time they do, Allies have just too much of a sheer numerical advantage.

    Yeah, the AI right now prioritizes using too many cheap units for attacks (inf) and should balance this more with high attack units (art). This is a difficult problem to solve across all maps and all unit sets which is why the AI tends to overly prefer using cheap units.



  • @redrum said in AI Interesting Moves and Points of Improvement on Revised:

    @Alexei-Svitkine I glanced over the game as a whole and actually the thing that jumps out most is that the Austrians played very poorly (I'd say more so than Germany or Ottos). They often weren't spending their PUs, lost control of Istria area, didn't help Germany much with Russia or Italy, etc. Really their only good play is taking out Petrograd (which was actually kind of lucky and poor play by the Russians). This then causes Germany to have to spend a lot of PUs to help defend Austria and deal with Russia which left it very little for the western front where it just gets overwhelmed by France/UK. It also takes the CPs way too long to take out Russia and by the time they do, Allies have just too much of a sheer numerical advantage.

    Yeah, the AI right now prioritizes using too many cheap units for attacks (inf) and should balance this more with high attack units (art). This is a difficult problem to solve across all maps and all unit sets which is why the AI tends to overly prefer using cheap units.

    I agree that Austria played poorly that game. Austria and Italy typically have a stale mate, holding a neighbouring territory each and exchanging control of another each turn. Austria wasn't quick enough at the start of the game to move that border into Italy and so the game of tag was in Austria's borders, which was awful for it.

    Having said that, I think until Russia gets defeated, Germany has a lot of trouble figuring out what to do with its big forces. Often, they hang around in Warsaw or elsewhere in the middle of its territory (I'm talking 40-100 guys) - not contributing to either front.

    I have another save game with the same scenario where Central powers do better, but again similar blunders by the AI are observed.
    Nov17_GreatWar_Try2.tsvg

    In this new save game, here are some issues:

    Round 17:
    At this point, Russia's fall is imminent.
    Germany moves units from East Prussia to Lodz (towards Russia), even though they're not needed there. It should be moving towards the western front, since Russia will be eliminated by Austria by the time these units can actually threaten Russia.
    Germany also moves lots of units to Kiev, again which are not needed there.
    Please note that at this point, Western front desperately needs help and Germany is losing Hanover each turn and has to retake it, so moving their big force away from there is a bad move.
    They leave Konigsberg undefended - which lets a transport land a unit there and capture it that round. Sure, they can kill on the counterattack, but it's better to just leave one or two units there to prevent this.

    Round 18:
    Germany decides to move back from Lodz to Silesia - basically undoing the move it did last time - it could have been ahead instead.
    Germany also sends its large force from Kiev to Crimea, which is not useful there. I believe it's trying to amass a secondary force next to Russia to threaten it, but given that Austria really does not need help there and the fact that Germany is having troubles elsewhere, it really shouldn't be doing this.

    Italy tries to take back its capital. It's desperate. It attacks with a percent chance to win of 38%. However, it just forgets an artillery that could have participated that would have raised the chance to 53%.
    Screen Shot 2019-11-17 at 6.50.01 PM.png

    Round 20:
    Germany builds a factory in Serbia. This doesn't seem useful as its focus should still be on the western front and it doesn't need a factory there.
    Later it will use this factory to send some units to help in Italy, but really it's just not needed. Germany already has two factories neighbouring Serbia - in Greece and Bulgaria.

    Round 21:
    British take East Prussia and Konigsberg from Germany who again fails to leave a token force behind - just leaving them completely empty and then having to retake them back next turn.

    I have to check my notes, I might have other things I've observed in this playthrough, but these are from the most recent session.

    EDIT:

    Here are some more from earlier turns:

    Round 5:
    Germany has 8 subs in Sea Zone 10 near US navy. They decide to move (non combat) to Sea Zone 6. However, in the process (if they did as a combat move), they could have taken the Sea Zone 7 convoy center from the French.
    Screen Shot 2019-11-17 at 7.02.53 PM.png

    Round 7:
    Germany has a good force near Bar-le-Duc and could easily defend it. It's a factory on the western front - so a very good thing to keep. (Sure they can retake next turn, but that means they can't build units there.)
    Instead, they abandon it.
    Before:
    Screen Shot 2019-11-17 at 7.03.37 PM.png
    After:
    Screen Shot 2019-11-17 at 7.05.05 PM.png



  • glossing over your conversations it reminds me the curious observation I made about the AI years ago I said to redrum that when playing the WWIIClassic map I thought the AI bought too many Artillery and not enough cheaper Infantry yet in this thread conversation perhaps the AI needs to purchase the more expensive Artillery type units ... as redrum just mentioned so it shows you how fickle the "probability of victory" percent roll is when trying to set the algorithm just right (requires many trials amiright)


Log in to reply