AI Development Discussion

classic Classic list List threaded Threaded
1250 messages Options
1 ... 38394041424344 ... 63
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
This post was updated on .
Fun stuff! So far hardAI Japans seems to be doing well keeping its navies away from the Allies, and managing their capital defenses, despite a pretty hard KJF press. The IJN is bouncing all over the place desperately trying to avoid USN, and being sure not to expose themselves to an attack. This game is 7 rounds in, playing with the +5 flat rate to income for Axis AI...

I did notice something interesting at the outset though. Its possible to pin the Japanese fleet in sz 37, just by sending the UK Australian sub there in the first round on non-combat. You can see the effect here on J1 in the opening round.

I think it must have something to do with the AI not understanding the post v3 sub rules. The AI will attack subs it can't possibly sink.

Sometimes the AI will stay in sea zone with a sub of their own and attempt a defense, even when it can't possibly prevail, rather than just escaping out of the sz. I've often seen this before in v5 where German subs get pinned in sz11 rather than escaping. You can see a similar effect in this save on J7, where a Japanese sub pointlessly tries to defend a sz vs a superior Royal Navy off the coast of England.


Would still be nice to see the sub logic polished up a bit, since in all the latest games subs don't turn a sea zone hostile anymore and can't be hit without a destroyer present. ;)

US7_KJF.tsvg

Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@Black Elk - Yeah, the AI doesn't really handle v3 rules around subs yet. I have at least 2 TODO items on it:
- Consider V3 rule around subs not blocking naval movement
- Consider V3 rule where fighters don't defend against subs

Though it looks like you found some additional V3 sub items as the AI doesn't handle when its units start in a hostile sea zone.

I don't think it'll be too difficult to add some logic for V3 subs and the save game really helps. If you have other save games where you see obvious bad AI play around subs please upload so I have more test cases :)
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
Right on, sounds good. Figured it would get tackled eventually :)

Oh also, one other thing I noticed that might be helpful... So in this game, during the final battle for Tokyo, I noticed that the AI was really focused on keeping their bombers alive, basically waiting until the 3rd round of combat before they started knocking them off as casualties. Probably it comes from some general logic trying to keep the most expensive air units alive. But in a major amphibious battle for control of the capital, it would be smarter if the AI took their bombers as casualties in the first round of combat.

I ran the battle 3 times to see if there was any difference in the casualty selection. In this case, had the Japanese taken hits on their bombers in the first round of combat, their defense would have been 100%, but holding them until the second or third round, allowed the US to airblitz with ease. Its kind of a special case, but I think a human would definitely have kept the stronger defensive infantry alive (rather than the Bombers) to put up more hits, and prolong the endgame by forcing the US to attack Tokyo twice instead of taking it on the first attempt.

US14_KJF.tsvg
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@all - Just committed latest changes and updated the pre-release:
- Fixed V3 sub issue when an enemy sub starts in territory with AI sea units
- Fixed V3 sub issue when AI sub starts in territory with enemy sea units that it shouldn't attack

@Black Elk - Both of your V3 sub issues should be fixed.

Casualties is a tough one and the logic is decent but not perfect. The AI tries to save its expensive units as long as it thinks it can win (avoid getting strafed by the player and sacrificing all its bombers first). At a certain point, if it appears it may lose the battle then it no longer takes into account unit value and just tries to win at all costs by killing off the units with the least strength.

In your particular save, you could argue it should make sure its capital survives by sacrificing the bombers earlier but on the other hand if it loses all its bombers in the first round for a bunch of your infantry then the huge TUV swing would probably spell doom for it anyways. I don't think its convincing enough at this point to make any major changes.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

captaincrunch
I may wait for the next update and give my brain a rest but keep on chugging along its getting done.

@Black Elk I noticed the way you preferred Bomber Casualty selection 1st instead of last and I think it actually was that way before and then they changed it recently. I had battles and the Bomber was always 1st picked as a Casualty and I thought that was monetarily a bad decision and then recently I was playing and the AI started saving its Bombers to the end in big battles and now you are asking that they change it back I believe. It could be they added new logic that changed how it used to be but it's a tough call about how the decision should be made ... whether you kill the Bomber 1st for defensive purposes ... or you kill the Bomber last for monetary purposes.

I wonder what the lobby or A&A gamers club or w/e its called think how the order of Bomber Casualty should be?

I know Redrum + Veqryn have it figured out but I only mention it because I think that was a recent change and I am not sure which way was better for the AI.

All fun and good!

Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
Yeah, recently I enhanced the AI casualty selection to consider unit value so that it wouldn't sacrifice bombers first when on a defense that it should win. Before it only considered attack or defense strength as this is the default battle calculator to optimize win percentage not TUV swing.

It now considers unit value unless the battle is close then it starts ignoring unit value and reverts to the optimal win percentage casualties. It probably needs tweaked a little to ignore unit value a little sooner as it seems to wait a little too long.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

captaincrunch
Awesome! That's good to know.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
In reply to this post by redrum
Oh no I definitely prefer the bomber defense logic of the latest jars compared to the previous jars. The casualty selection now is much stronger. And in this case Japan AI intelligently flew their bombers home for the extra hitpoints once Tokyo was seriously under threat.

 I only brought it up because the battle was an amphibious island invasion (meaning that the attacker can't strafe and retreat) and I noticed that the AI defender would sometimes take hits even on tanks before they started losing bombers.

This might make sense in a normal battle, but for a do or die battle for control of a capital (ie large numbers and several rounds of combat) it's pretty dangerous.

My concern is that you don't want it to become too predictable, if for example the human knows that the AI will always try to keep their bombers alive until things become extremely narrow, then they can attack with less total hitpoints or power, since the human would know they're just facing down 1s on defense.

For more perspective, 4 tanks have the same defense power as a dozen bombers. So even if the AI were to sacrifice just a couple bombers to keep a couple heavy hitting tanks alive, this could reduce the length of the combat and give the defender a much better chance of surviving with at least some units remaining, rather than being totally annihilated and losing their whole purse. It's almost always better to lose your bombers than it is to lose your Capital, since the former can be replaced, whereas the latter effectively knocks you out of the game.

But again, the new logic is definitely better than the old logic of a few jars back ;)

Oh sweet! The v3 subs! Nice dude
will get to testing later tonight. Good looking out
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
In reply to this post by redrum
I dig the new sub logic :)

Just got in my first game with the latest updates to the jar. AI Axis were rocking it. They cracked Moscow and managed a pretty decent split defense vs the human Allies, who were pressing in on them from both directions.

I noticed a bit of weirdness in the endgame though. Right here in the 13th round... where the German AI allowed a 99% shot on Berlin, when they could have easily defended. They moved a huge stack to France, inexplicably leaving their Capital exposed to a rather simple gutting by the British.

Not sure what the glitch was, since it wasn't a multi-turn Allied hit, just a straight up UK solo invasion. Here's the save...

Elk_vs_AI_Axis_+5_flat_rate,_UK_13.tsvg
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@all - Latest changes committed and pre-release updated:
- More casualty selection improvements
- Capital defense fixes
- Improved factory purchases
- Increased fighter production especially when lots of owned empty carriers

@Black Elk - That's definitely a terrible move. I think I actually had already fixed the bug that caused it. I tested your save a few times and it always defends its capital properly with the latest code. You should be able to continue your game from the start of Germany's turn if you'd like :)

You should also see the casualty selection be more conservative now. Keep the feedback coming!
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
Right on! Downloading the new jar now. This one came in before I saw your last jar update there, but it was pretty cool for the Air War. This time against HardAI Allies +5 flat rate.

UK is stacking bombers like crazy, it's interesting to see how creative they get with their bomber positioning during the endgame. This time the RAF is operating out of the Yukon and Alaska to keep the Japanese on their toes, like 20 bombers deep. G has been keeping pace for the duration up to 17 bombers now, with a gang of BF109's in the cut haha. Axis took the honorable Victory in the 10th round. Didn't notice any goofs from the AI. They were pretty slick with their aircraft and the USN is still massive, creeping around the Med despite our huge bomber umbrella around Europe and Africa...
Well fought hardAI.


ELK_vs_AI_Allies_+5_flat_rate,_Air_War,_G12.tsvg

Off to play the new one. Keep up the great work!
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
OK first time out with the new jar posted tonight. HardAI Japan set up a pretty solid air expansion and nuked the Royal Navy. D-Day cracked off right about the time that Stalin was forced to abandoned Moscow haha. Japan was fairly deep into Africa, and the IJN had the Med on lock down...
but the western Allies stacked France big time! setting up USA on Berlin in 11th round

AI Japan couldn't fully flex against North America/Atlantic before the KGF was executed, but it wasn't for lack of effort. Nice play from the AI Axis I'd say with the +5 ipc boost! :)

Elk_vs_Axis_+5_flat_rate,_D-Day_KGF_US11.tsvg
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
This post was updated on .
Another enjoyable game against AI Axis with the +5 bonus.

This time I thought I'd try to see how many Russian bombers the AI would let me get away with purchasing haha. I got it up to 4 for the Red Air Force! Furious.

This game is especially notable for me, because Japan did some things that they never used to do, even just a few jars back. Crossing into the Atlantic to wreck the USA transport logistics, and pummeling Russia consistently. The Hard AI is already doing much much better than they used to, I think people will have fun when it makes the next stable.

In this game AI Axis were doing great right up until about the tenth round. Japan made it all the way to UK, where they were promptly jumped by US bombers. The pride of the Imperial Japanese navy was sent to the bottom of the Atlantic. Then Japan suffered a devastating blow to their bomber force! Allied bombers were too much for them, first in the water and then in the air. This is the situation at the end of the 12th...
Elk_vs_AI_Axis_+5_flat_rate,_Red_Bomber_Armada_US12.tsvg

ps. The Hard AI did pretty well in the endgame, they pushed me out another 10 rounds, but could not quite overcome the Russians at the center, with those crazy Red bomber crews haha. Still the Axis pushed hard and defended to the last. It took 22 rounds before the USA was finally able to negotiate a successful hit on Berlin!
Elk_vs_AI_Axis_+5_flat_rate,_Red_Bomber_Armada_US_22.tsvg

Another 10 rounds to actually clinch the Honorable Victory, I like how Japan went out with a bang, even after their whole empire got rolled up, with a final crazy strike against the USN in the 32nd round. Midway style! haha...
Elk_vs_AI_Axis_+5_flat_rate,_Red_Bomber_Armada_R_33.tsvg

Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

captaincrunch
This post was updated on .
 Allllright. Good news is I think this AI update is the strongest and best ever. I played 6 matches and lost 4 and won 2. My losses were bad but my wins were good:




Match 1 - I was the Allies and the AI was the Axis and I forfeited my 1st turn with Russia for fun and this is a hard scenario and I actually got smoked by the AI and the German AI captured my Russian capitol in round 4 lol and then I think I played a few more rounds but then gave up.



Match 2 - I was the Allies and the AI was the Axis again but I didn't forfeit my 1st turn with Russia this time but still the Japan AI marched and I had a hard time taking out the German AI units and after Russia fell from the Japan AI I still played a few more rounds but gave up because the German AI was building and I couldn't slow the Japan AI





Match 3 - I was the Allies and the AI was the Axis again but this time I kept the Japan AI from marching too much and I surrounded the German AI quick and I was kinda pissed at losing the previous match so I bared down and took the German AI capitol in round 6 and then beat back the  Japan AI and ended the game by taking it's capitol in round 14;


latestaxisaidefeated25.tsvg







Match 4 - I was the Axis and the AI was the Allies and this can be really tough these days and I started with a big battle in Karelia where both me and the Russian AI lost most of our units and I thought I was doing fine but I had lost too many German Planes early and couldn't stop the Allied AI Transporters and Navys and I was too slow using Japan and basically I gave up around round 12 maybe after Germany fell and I had no chance to liberate it with Japan






Match 5 - I decided to be less aggressive on my 1st attack with Germany on the Russian AI so I played safe and didn't lose any of my German Planes but after 10 or so rounds the Allied AI (especially the USA AI) finally wore down my German Airforce and I couldn't take down the Russian AI with Japan and the AI played well and I gave up around round 15 after I lost my German capitol.





Match 6 - A rematch where I was the Axis and the AI was the Allies and I learned something about the AI here ... I finally noticed that if I have a good DEFEND when the Russian AI had its first 2 attacks ... just 2 more kills on the Russian AI ( I still lost the battle where the Russian AI attacked with 9 pieces and I defended with 6 but the Russian AI won with only 1 piece left) and that result must rarely happen because only now ... although it could be the new AI update ... I now noticed that if I get a good defend in the 1st turn when the Russian AI attacks that THE RUSSIAN AI DOES NOT STACK MOST OF ITS ARMY AT KARELIA. This is huge because I am used to 15 Russian AI Units in Karelia after its 1st turn but instead in this game ( look at the save if you want) the Russian AI split its Units and somewhat retreated and thus it made it very easy for me to take Karelia on my German 1st turn and that set the tone for the whole match and I then promptly took the Russia AI capitol in round 5 and then built a German Navy and took the UK AI's capitol in round 13 and then finished the match taking the USA AI's capitol in round 14;

latestalliesaidefeated25.tsvg








Sooooo .... the AI is runnin tight and swift and I need some luck or a good start to have a chance really.



Was fun and look forward to the next AI update installment!


Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

feld
In reply to this post by redrum
I played a game of Rising Sun using your July 4th jar.  On complex maps like this one, much like NWO, the AI still has some struggles handling naval units.  The US in particular never did much of anything, even though it had the units in place to make a move that would have bought the other allies more time that they desperately needed.  It seemed like the AI was too afraid of losing its transports in the process, though it would have been a worthy sacrifice.  Once again, the AI naval purchases focus too much on defense with very few offense-oriented purchases, and it doesn't do a great job at keeping its carriers as fully populated with fighters as it can (though there was clear improvement from the NWO game I last posted).  Aside from being too passive and defensive, the naval AI does do a good job of defensive positioning, but sooner or later it will screw up due to not considering turn order and give a human opponent the opportunity to kill off its combined fleets in smaller pieces, or by tag teaming the AI with consecutive attacks from multiple opposing "nations".  Overall it again wasn't very difficult to defeat the AI, primarily due to it being too defensive minded and timid in general with naval units/combat.

And I definitely noticed some other odd behaviors by the AI, none of which were memory related this time.  As before, I made some notes as I went along:

-----------

Round 1 Dutch: Evacuated their capitol despite Yamamoto and Hisaichi being in position to attack it.  Oddly is evacuating Sumatra as well, when holding North Sumatra is key to slowing the rate Hisaichi can pressure the British fleet off of India.

Round 3 Dutch: Attacked a lone tank with a single early fighter - not an advisable move.  It looked like the AI meant to move a transport up with a couple of ground units but failed to do so for some reason.  His plane missed but he got lucky and my tank missed also, and he retreated right away.  Also, the Dutch AI somewhat strangely decided to move his ground troops in Bali and Lambok back to Soem rather than into Bali or attack Java like I would have expected.  Not sure if that is an error or a smart move on its part, but it just seemed odd to me.

Round 3 Americans: Moved a significant fleet into sz3 including a loaded transport, but declined to unload the troops either on the unoccupied Kamchatka under Masaharu's control, or the much safer Attla.  Instead they left the troops on board the ship and at risk of being destroyed without the opportunity to fire back.  Of course I did destroy them.

Round 5 Americans: It doesn't seem the AI is capable of optimally loading units onto an expanded capacity transport.  The US purchased and loaded troops onto 5 big transports which it moved into sz12, each of which has a transport capacity of 8 rather than the standard 5.  So the 5 big transports have a total maximum transporting capacity of 40, but the units the AI loaded onto the transport have a total transport value of 35.  An additional infantry and artillery could have been fit onto the big transports and those units were available to be loaded, but it did not happen.  This is a recurring issue and also requires extra care for a human player to fully load a group of big transports.

Round 6-7 Americans: AI is buying too many transports, more than required to hold all the US ground troops, and not enough other ships.  It also seemed like it took a turn or two too long for the AI to start building transports, but once it did it went overboard.

Round 9 British: The AI has marched troops up to help defend the Chinese, but once Japan is knocking on the Chinese capitol the British don't bother putting their troops in the capitol to help defend it.  Strangely, neither did the Chinese themselves.  Then I accidentally undid a Yamamoto tank blitz to take the nearly undefended capitol - oops on my part.

Round 12 Americans: The AI is doing bizarre things with its big transports in sz11 and sz25.  It loads troops from Midway onto sz11 big transports, moves them to sz25 and offloads onto Maui, then loads other troops from Maui onto other big transports in sz25, moves them to sz11 and unloads them on Midway.  What's the purpose of this?  It's nonsensical.  The same sort of irrational movements took place the following rounds.  I think they happened in prior rounds as well but wan't looking as closely.

Round 19 Americans: This is the first time since the first couple rounds that the Americans did anything of an offensive nature with their navy.  Way too little, way too late.  And it's odd that on moving his ships to sz4 the AI dropped 28 infantry on Umnak rather than Alaska or in an attempt to conquer Palana (which, quite frankly, it should have done ~10 rounds ago - that might have saved Russia, or at least slowed Japan's advance on Russia and China and given them some breathing room).  Now with all those troops on Umnak, they will be stranded after Masaharu and Yamamoto destroy the fleet in sz4 tag team style.

Round 20 British: In sz17 they kamikazee'd a pack of fighters. Kamikazee airplanes was not turned on, so the AI should not have been able to do this.  However, all airplanes should have been able to land on Marcus island, but for some reason didn't and crashed in the Pacific during non-combat movement.  The American AI followed up with the same attack with planes from the same starting location on its turn and was able to land on Marcus just fine.

Rising_Sun_Axis_end.tsvg
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
This post was updated on .
@all - We are looking to release the next official version of TripleA towards the end of July. I'm hoping that everyone can help to test the latest pre-release AI on as many maps as possible to make sure its stable. In particular, I want to first make sure it doesn't cause any crashes.

This can involve having the latest pre-release and just running all players as 'Hard AI' until the game ends. If you can then just post which map you tested and upload the save game that would be much appreciated. I'll keep a list on the first post of this thread on which maps have been successfully tested.

I'll still be reviewing all feedback and making any minor tweaks. If things are more major then I'll add them to the TODO list to prioritize for the following releases.

@feld - Comments:

1D. Looks like Dutch have no chance to hold its capital (~0%) which is why it doesn't try to hold it. It tries to consolidate its troops in Java from Sumatra to have a more formidable defense.

3D. There was a bug with canals that caused the AI to fail to transport units to the territory.

3A. Agree and I enhanced the unload algorithm to better consider unloading transports on nearby islands.

5A. The transport loading isn't perfect but given the chosen sea destinations the extra units that aren't transported are from Portland. Those units can't be loaded by those 5 transports and make it to SZ12.

6-7A. The issue was that the AI thought it could transport factories! Factories for some reason have a transport cost of 6 on this map... This caused the AI to think it needed lots of extra transports to load the 4 factories in California and Hawaii. I added some additional logic to make sure it understands factories can't be transported and this makes it purchases far fewer transports.

9B. This has to do with turn order as the UK doesn't think it can hold the Chinese capital and doesn't realize the Chinese can move before the enemy can.

12A. Good catch. There was a bug related to transport movement.

19A. I don't really think them being in Alaska is that much better and it doesn't attack Palana since they could all be easily wiped out.

20B. Good catch. There was a bug with air units only having one option to land.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

captaincrunch
@redrum, ook I'll test out the latest AI .jar update. Don't know what you added or changed but anyways I posted because 2 or 3 times now I mentioned that I can't get a "Military Victory" message after playing and defeating the Allies AI but ya I guess I'm supposed to submit it as a possible "bug" somewhere but I thought my gamesaves that I am posting would be good enough for someone to use and check into it.

I'll post and get back to you after I got some wins on this new AI update!
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

Black Elk
This post was updated on .
In reply to this post by redrum
HardAI vs HardAI!

I ran some simulations for v3 AA50. No kinks, and the AI performed reasonably well. Both years 1941 and 1942 produced Axis victories, what I'd expect given the spread.

HardAI_vs_HardAI_v3_1941_Axis_Victory_round_6.tsvg

HardAI_vs_HardAI_v3_1942_Axis_Victory_round_10.tsvg

Next I ran v6 the 1941 starter board. Again to Axis as might be expected. The AI didn't have any major hiccups. So at least the intro board seems to work pretty well.
HardAI_vs_HardAI_v6_1941_Axis_Victory_round_7.tsvg

v5 1942 sec ed is the map I have been playing most with the AI, I think it does well under the current AI. Here again the axis prevailed in the 14th round, which would seem to support the general feeling that most players have, about all those boards being Axis advantage OOB.
HardAI_vs_HardAI_v5_1942_Axis_Victory_round_14.tsvg

Finally tried a G40 match up. This was less exciting to watch, and the HardAI seemed to struggle with a direction. I'd say that for G40 the HardAI should declare war on everyone at the outset, with the exception of True Neutrals. Probably some logic that tells the HardAI to avoid attacking True Neutrals generally would be good. Germany in particular had trouble, never digging into Russia, but both of the other Axis powers floundered as well. Japan didn't seem to appreciate the value of the money islands. I'd suggest a round1 DoW for the Axis to get the ball rolling.

Here is my current game, running in round 10. Slow and go... Still no German invasion of the Soviet Union?
HardAI_vs_HardAI_Global1940_sec_ed_Axis_failing_round_10.tsvg

I'd suggest top priority at this point given to VC tracking for the AI. Objectives would be nice, but I think VCs are probably more important at the moment.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

redrum
Administrator
@Black Elk - Thanks for the tests and yeah the AI seems to do pretty well now on v1-v6. The issue with Global is politics. The AI doesn't understand politics so just makes random decisions which means it may never declare war or declare war on countries it shouldn't. I'm not sure yet how to deal with politics since each map is pretty different and the decisions are difficult to make. The AI should function on maps with politics (not crash) but probably plays poorly.
Reply | Threaded
Open this post in threaded view
|

Re: AI Development Discussion

RogerCooper
For Politics is it useful to distinguish 2 types of games, those with 2 alliances and free-for-all games (or multi-alliance games).

In alliance games you should have a low chance of declaring war on neutrals and a high chance of declaring war on members of the opposing alliance.

In free-for-all, the AI should use a king of the mountain strategy, tending to declare war on the leading nation (or alliance) and make peace with others (if possible). Management of the enmity ratio (the ratio of strength between your enemies and your friends) is desirable, with efforts made to move it towards 1.

Some randomness is desirable. Scenario designers who want powers to enter the war in a fixed way should use triggers rather than politics.

1 ... 38394041424344 ... 63