AI Development Discussion and Feedback
-
ok, hopefully that uploads right. it's right before germany's turn which is set to be hard ai. made in 7621
0_1520785568570_AIgermancountermoves.tsvgwhile the ai's moves are reasonable; i'm just trying to understand how it's gettin some of its numbers here; like in the first section of its can it hold the territories checks I see this: (using finer logging setting)
Western Russia, value=51.35751298216039, averageAttackFromValue=20.57303311797783, MyAttackers=14, RemainingUnits=9
Western Russia, CanHold=true, MyDefenders=9, EnemyAttackers=1, win%=0.0, EnemyTUVSwing=-10.09375, hasLandUnitRemaining=false
SZ 10 North Sea, value=15.82651924854822, averageAttackFromValue=6.364376154510273, MyAttackers=16, RemainingUnits=8
SZ 10 North Sea, CanHold=true, MyDefenders=8, EnemyAttackers=12, win%=30.434782608695656, EnemyTUVSwing=-1.4891304347826022, hasLandUnitRemaining=false
Northern Russia, value=57.61767455300545, averageAttackFromValue=21.22610523348412, MyAttackers=9, RemainingUnits=4
Northern Russia, CanHold=true, MyDefenders=4, EnemyAttackers=1, win%=0.0, EnemyTUVSwing=-10.03125, hasLandUnitRemaining=falsebut western and northern russia are both next to moscow, which is/will be intact and has a bunch of units. a bit above that in the logs there was
Removing territory that we can't successfully attack: Moscow, maxWin%=0.0, maxAttackers=2
so it should know that moscow will be intact and its troops available for counters.other oddities are
Leningrad, value=30.751588092760592, averageAttackFromValue=21.22610523348412, MyAttackers=15, RemainingUnits=3
Leningrad, CanHold=true, MyDefenders=3, EnemyAttackers=1, win%=0.0, EnemyTUVSwing=-9.25, hasLandUnitRemaining=false
where, again at the least the air attackers from moscow are missing; as it has 4 air that would be in range to counterattack if the ai took leningrad.and
Finland, value=16.73492259416393, averageAttackFromValue=6.142684580406411, MyAttackers=14, RemainingUnits=7
Finland, CanHold=true, MyDefenders=7, EnemyAttackers=3, win%=0.0, EnemyTUVSwing=-26.875, hasLandUnitRemaining=false
where I don't see which 3 attackers it could possibly be coming up with; as it's clearly using some air, but not all of the air if it's takin gfrom russia, or maybe it's takin from britain and ignoring the russian counterattack, I don't know. but if the ai did a 14 attackers on attack on finland then it wouldn't have taken leningrad, which would leave the leningrad stack available to counter. It makes me wonder more generally what the logs would show if I setup a scenario wherein province A has 8 units, and is adjacent to provinces B/C, which are hostile, and each have 6 units (let's say all units have att/def 2 and i'ts LL, and all other units are too far away to be relevant). in such a scenario it would be capable of taking either province reliably, but not both, and would not be able to hold onto either of them. maybe later i'll setup a test for that.when it does the second round of its Check if it can hold territories checks, using the smaller list of targets it's selected, it's showin those same numbers again. I just don' tsee how it getting those values for EnemyAttackers in those cases.
-
@zlefin I think you've found a bug
I did some quick debugging and saw the following:
Germany Attack Options After Removing Can't Attack Territories:
[Southern Russia, Western Russia, SZ 10 North Sea, Northern Russia, SZ 16 North Atlantic, SZ 18 West Atlantic, Sweden, SZ 4 Denmark Straight, SZ 9 North Atlantic, SZ 13 Gulf of St Lawrence, SZ 7 Barents Sea, Leningrad, Switzerland, Spain, SZ 23 West Mediterranean, SZ 2 Labrador Sea, SZ 37 Caribbean Sea, Finland, SZ 17 English Channel]Enemy Counter Attacks on Western Russia: [bomber owned by British]
I think what is happening is the British counter attack is overriding the Russian counter attack that is why you see the 1 unit instead of this:
[armour owned by Russians, armour owned by Russians, armour owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, armour owned by Russians, armour owned by Russians, tactical_bomber owned by Russians, bomber owned by Russians, fighter owned by Russians, tactical_bomber owned by Russians, fighter owned by Russians]Enemy Turn Order was one of the last things I added to the AI which I think caused a bug. Here was the PR: https://github.com/triplea-game/triplea/pull/282
I'll need to look more into this but its probably either a bug in this method or the data being passed into it:
https://github.com/triplea-game/triplea/blob/master/game-core/src/main/java/games/strategy/triplea/ai/pro/data/ProTerritoryManager.java#L440 -
Ok;
looking at another case to understand stuff generally, using finest logs (same savegame), I think I figured out wha'ts going on in this one and it's fine; it adjusted the enemy attackers up because it removed an unprofitable attack on caucasus from it's possible attacks stream, thus meaning those 3 inf can join in a counterattack on southern russia, right?:in the section:
Determine units to attack each territory with
Territory=Southern Russia, CanHold=false, MyDefenders=2, EnemyAttackers=22, win%=100.0, EnemyTUVSwing=3.9375, hasLandUnitRemaining=true
territory=Southern Russia, win%=100.0, TUVSwing=4.34375, hasRemainingLandUnit=true, attackValue=5.71875, territoryValue=4.0, allUnitsCanAttackOtherTerritory=true with attackers=[infantry owned by Germans, infantry owned by Germans, infantry owned by Germans, tactical_bomber owned by Germans]which shows the 22 enemy counterattackers; but earlier in the phase
Check if we should try to hold attack territories
Southern Russia, value=61.00113178010893, averageAttackFromValue=20.92354576175239, MyAttackers=16, RemainingUnits=10
Southern Russia, CanHold=false, MyDefenders=10, EnemyAttackers=19, win%=100.0, EnemyTUVSwing=23.534090909090907, hasLandUnitRemaining=truewith a lower number of enemy attackers;
unrelated question: how does the ai decide whether or not to submerge submarines?
-
@zlefin Correct, at a high level it first goes through an iteration of determining which territories to attack then updates enemy counter attacks based on that reduced list of territories then decides which units to actually use for each attack (and potentially removes some more attacks).
If I recall correctly, submerge is treated essentially just like any other retreat where it tries to determine if it has positive TUV for the remaining battle and if not then submerge.
Oh and I just ran a quick test to validate my theory by removing the UK bomber which then gives these results:
Germany Attack Options After Removing Can't Attack Territories:
[Southern Russia, Western Russia, SZ 10 North Sea, Northern Russia, SZ 16 North Atlantic, SZ 18 West Atlantic, Sweden, SZ 4 Denmark Straight, SZ 9 North Atlantic, SZ 13 Gulf of St Lawrence, SZ 7 Barents Sea, Leningrad, Switzerland, Spain, Caucasus, SZ 23 West Mediterranean, SZ 2 Labrador Sea, SZ 37 Caribbean Sea, Finland, SZ 17 English Channel]Enemy Counter Attacks on Western Russia: [armour owned by Russians, armour owned by Russians, armour owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, infantry owned by Russians, tactical_bomber owned by Russians, bomber owned by Russians, fighter owned by Russians, tactical_bomber owned by Russians, fighter owned by Russians]
German attacks after removing the UK bomber:
-
@zlefin I looked at the code and I think after the enemy turn order changes I mentioned above, the territoriesToCheck needs to be set to ensure the potential territories to attack are all checked for all enemies. I did some testing and updating that seemed to fix the max enemy attackers issue and not cause any side effects. Here is the PR: https://github.com/triplea-game/triplea/pull/3271
This can be tested with the latest pre-release: https://github.com/triplea-game/triplea/releases/tag/1.9.0.0.9743
-
I don't know that anyone cares about what I have to say and I hope I am posting this in the right place, but for the first time since I discovered Triple A I find it utterly unenjoyable. Entirely due to the AI.
I have been playing for many years, ever since I found it on Sourceforge, but only single player. My preference is toward World at War (or before that, New World Order), though I think I have tried pretty much every map which has been offered. Some are better than others. Ironically, the best single player experience for me currently has been Greyhawk, which I have absolutely no interest in, but which is immensely fun to play and very well balanced while still retaining its challenge.
The AI has always been progressively improving. I remember when Moore N Able Russia was all bombers and infantry, or the US would just conscript fleets of Patrol Boats to swarm the Atlantic. They were things which were effective, sometimes brutally so, though really quite silly . .But currently, World of War as it exists now is just. . .Well its a nightmare..
Hard AI doesn't, as near as I can tell, carry any additional strategic sophistication, but rather just gives more favorable rolls (even with low luck set, and I do hate low luck since that favors the AI calculations). France, rather than folding in six months, cannot be taken before turn four (I used to be able to take it in two), and if the AI is in charge of Germany (even on Hard) sometimes it won't fall at all.The Dutch and Australians can practically take out Japan's naval forces all by themselves, with only token assistance from the British and none at all from the Americans. In fact, if America does nothing, the Axis powers are defeated entirely within about twenty turns. There is never, and I mean absolutely never, a point at which Britain appears distressed, let alone pressed anywhere on the globe. Japan used to be poised for a Pearl Harbor strike even if it was somewhat out of sync with the setting, but now that is virtually impossible. Even if one commits everything within reach, it is a failure more often than not, and even when it is successful the next turn sees every ship destroyed. It is little wonder why the AI will not do it on their own, and really, an early Pearl Harbor strike is no more anomalous than the US conquering South America, so why not allow what is a trademark moment in the war.
I like a challenge. it is the reason I usually play the Axis, but this goes beyond merely being disadvantaged. I have played games in the past as Finland or China where through patience and careful planning I could tip the scales of victory for my side, but it was always a struggle. That fine balance is no longer present in the game. I don't know why, and wish I could offer something more helpful that these feeble observations, but I sorely miss the game I used to love so I am just offering you what I have.
Also, a personal annoyance I have always harbored but never felt particularly inclined to mention (though I may as well while I am here). . .I absolutely loathe how AI allies will sweep in and steal territories I have just barely lost (or just opened up access to through a pressed engagement) before I have a chance to (re)claim them. Seeing checkerboard islands of other nations in the heart of my territory bugs the, uh daylights, out of me. I realize they are opportunistic and tactically make some sense, but that frequent siphoning of IP is like death by a thousand cuts since their 'help" is otherwise pretty nonexistent. I will have Italy, Romania and Finland spilling through breaches I open, to claim territories they can't hold, while the British cross up through Turkey without any concern whatsoever from them. Ideally, Romania and Italy should be concentrating wholly upon Africa and the Middle East, leaving Russia to Germany. Italy can barely make headway in Africa as it is and has absolutely no chance of holding it against the Americans, its even worse when they seem to ignore the continent completely.
Anyway, this sounds like a lot of griping, mostly because it is, but for many years I have been a loyal if silent fan and I really do appreciate all the work you guys have put into this and hope to see good things going forward. The way I figure it though, you can't fix problems you don't know about.
-
@cody-young I've never played World At War, but, aside from the AI, Yamamoto can attack 91, on round 1, with 5 Submarine, 1 Destroyer, 4 Fighter, 1 Bomber.
With Low Luck, taking Destroyer first, then Submarine, then Fighter, this is, on average, 1 Bomber, 4 Fighter and 0.67 Submarine surviving.
If you take Fighter before Submarine, you would have 1 Bomber, 5 Submarine and 0.33 Fighter surviving; tho you don't want to do that (just saying it gives you some more safety, if rolls are bad).
Then, you can have the Fighters land on carriers in 96 (easily safe) or 104 (can be made safe with some effort).
Just remember to have 1 land unit where the bomber is going to land (Kwajalein or Jaluit). -
@cernel I didn't say it was impossible, but anything which survives that strike is annihilated the next turn by outlying American ships and aircraft. The AI won't even attempt a Pearl Harbor strike, and I really do think that is telling.
-
@cody-young Yeah, you can't sit in Pearl Harbor. Anything that attacks it and stays there is due to be destroyed (so, try to save air units). Still, not doing that attack is a really bad choice, and the AI has a big problem, if does it anything less than 100% times.
-
I mispoke, when I said next turn, I should have said before your next turn. Japan does not even have the opportunity to move anything out of Pearl Harbor. It is destroyed by the Americans at the end of that same round.
And I agree, Pearl Harbor should always occur. . .But I think the two World at War offerings are set in 1939 and 1940 respectively, which would make the occurrence somewhat incongruent so maybe it was left out of the AI priority tasks on purpose
-
@cernel You know it never occured to me it may just be a problem on my end. Maybe something on my side might be corrupted. Let me try and fresh install and see what happens. My apologies in advance if I just wasted your time.
-
@cody-young You may want to take a look at the latest savegame of this PBF:
https://forums.triplea-game.org/topic/622/waw-charlesthescot-vs-wirkey
Those players are very experienced on the map.
The Yamamoto player made the very interesting opening of also taking Wake and Midway round 1, that allows sitting in 88 Sea Zone.
You can see, in that savegame he didn't even send the Bomber in 91, tho that is very risky, and most people usually send the Bomber too in 91, as per what I said, and regroup in 96 or 104.
I'm guessing CharlestheScot did that for the fun of trying something uncommon, but I guess it is a reasonable risk.The WaW map is actually anachronistic: Europe is late 1939, but without the non-aggression pact, so it is kind of mid 1941 in the east too, while China is 1937 and Pacific is december 1941. That was just what the mapmaker preferred.
I would agree that the AI doesn't look good at playing WaW, by just letting it playing and watching it, but I'm not a player. It also looks like it gets distracted by Neutral (like Switzerland) too much. I think @redrum didn't get a lot of feedback on the WaW map with AI, to fine tune it.
-
@cody-young Actually, I didn't mean that I saw the AI doing it or not. I would be surely surprised to se a human player not doing it.
-
@cernel How would I upload my own save like that for review. Because I just ran everyone on hard AI, and in my game, Japan ignores Pearl Harbor complete. I am willing to accept that my gamefiles may have been corrupted, but I would feel better being able to prove I am not a madman
-
@cody-young Click on this thing:
-
So this is for World At War 1940, if that distinction makes a difference.
-
@cody-young Of course, "WAW" and "WAW 1940" are two different games. The fact that they are the same map (share the same skin) doesn't mean much, so you should always be sure to clarify which one you are referring too, just like if they were two different maps. I'm sorry, I assumed that you meant "game", when you said "map".
Well, "WAW 1940" is really a question mark, since I never see anyone playing it. I just ran the battlecalculator, I see there is a 100% Low Luck with +19 TUV swing and 2.67 Fighter left, sending 6 Fighters.
That is probably a terrific risk with dice.
Maybe it is good to sacrifice a Carrier, to get some better odds.
But if you clean 91, then you should be able to retreat the surviving air to 96 safely, as, for the Americans, only 1 Bomber and 3 Fighter reach, there, but I see attacking 91 on round 1 might be not a must, there; and surely much less appealing than in the original game (of the two games, "WAW" is the original and "WAW 1940" is the mod). Hard to say for me, not having played the map.
We would need the original game creator (ice) to consider the situation, or at least some reliable players of the game, to tell if WAW 1940 needs to be fixed, but I doubt we will, as I don't believe this game has a playerbase.
If you have setup changes proposals for "WAW 1940", you can open a topic for it. But I'm not sure if @redrum would review them, like he would do for the other game of the map? Let's wait what he has to say on the matter, I guess. -
@cernel Ah alright man. Thanks for your help. I guess I will wait to see if there is a reply here and make a specific post otherwise. Thanks for all your assistance though, I do appreciate it.
-
@cody-young You're welcomed (to the forum too).
-
@cody-young So feedback on maps or the AI is always welcome. You seem to touch on a number of different points in your posts so its a bit hard to follow.
If you are looking to have a discussion about WaW or WaW40 balance/strategy/etc then this probably isn't the right thread to do so in. That appears to primarily be what you've discussed with @Cernel so far. I'm not an expert at either WaW or WaW40 so can't add much there.
If you have feedback on the AI then this would be a good place to discuss it. Generally, its best to have a more specific conversation on AI moves/purchases and having a save game to look at. WaW is a fairly large map which gives the AI some challenges but its also a map that in order for the Axis to be competitive the first few rounds are fairly scripted in attacks that need to take place. Due to that map design, the AI plays the Allies much better than the Axis (as do most non-expert players). I would recommend you give the AI some small bonuses to income and probably a bit more for Axis than Allies to make a more competitive game.
If you have specific save games where you think the AI played particularly poorly or you'd like to better understand why it did something then I'm glad to take a look at those as well.