AI Development Discussion and Feedback
-
@black_elk said in AI Development Discussion and Feedback:
@theredbaron said in AI Development Discussion and Feedback:
Perhaps something to be considered would be some sort of AI.properties where certain AI objectives could be laid out on a map by map basis without affecting human vs. human gameplay. I've heard it said in the past that AI shouldn't go into the XML (perhaps that isn't true anymore), but it might be nice for some maps to have something to manipulate that would increase the AI's valuation of a territory even if it cannot understand why that territory is valuable. Just some food for thought...
That would be pretty cool. In a lot of instances you could accomplish quite a bit with just few critical tiles flagged as the "key to winning" on a given map. This might be better than making say all VCs a critical priority at all times, since, as was pointed out earlier, they are not always the most important thing going on. But some sea zones or territories are always going to be critical on a map (the choke points, or core production regions) so it would be cool if we could use them to push the AI into certain play patterns. It would also be awesome if you could set a threshold for these, so that the AI would try to hold them even if they are clearly outgunned. Like for Moscow or Berlin, or any capital that is adjacent to another land territory (the AI is better about stacking island capitals, since the they don't have a way to walk off haha.) Then map makers could tune the AI to the needs of the map, or try to adjust opening behavior by tweaking with the priority target territories, to see if they can make the machine play in different ways.
This has been the main issue with the AI that I have had as well. Even in maps that are not won by VC you still have to control your capital in order to produce new units, and the AI is more interested in protecting its troops than its capital. All you have to do is move a large army close to the capital leaving a route for them to escape and they leave their capital undefended. Also the AI is not that keen on taking enemy capitals or re-conquering their own once they are taken. It is a easy win to out produce them when they are not producing.
No, no one wants a technical loss to VC but more value needs to be added to Capitals across the board, for the AI to play more like a human.
In addition once the stacks get big on a large map the AI becomes stagnant, not attacking even smaller stacks next to them. I wonder if placing more value on taking other factions out would correct this.
-
@justbleh I've played the AI tons on the WWIIClassic map and the AI primarily plays with the overall strategy of "losing small battles but winning the war" mentality (mentality ... what irony!) and by that, I mean the AI can summarize its complete overall analytical strength and forfeit its capitals because the AI knows it has the literal numbers to defeat other objectives and eventually take back any lost capitals it temporarily lost. Redrum the developer could better explain this to you but the only true weakness of the AI right now are the "can opener" moves that only exist because Axis and Allies is a turn-order based game and so multiple player/country moves can put the AI in a disadvantaged circumstance but overall I consider the current AI as very competitive and I do not yet see what suggestion you are giving to improve the current AI! Redrum should give more details to your concern that I'm interested to read but I don't know what tweak you want to specifically change to the AI and that reminds me I did suggest that we have a thread dedicated to "AI tweaks" that players submit with an AI that they have tweaked that is better than Redrums that we can test out and see who can submit the hardest AI to battle! All still interesting and always a good topic
-
Alright its my 8 week updated "war/gaming" Youtube video pick!
This one goes out to the "Low Luck Dice" option users!
Lucky Man by Emerson, Lake, and Palmer;
-
The AI is competitive, I agree, although once ousted from their capital it is easy to out produce them, inevitably winning. More importance on the capitals is what I was saying in my previous post.
The main tweak I would suggest would be to allow production as long as a capital was in their control, not necessarily their starting capital; and limited production as long as a factory is still in their control.
-
@justbleh There is a balance as staying in your capital where you are clearing going to be wiped out isn't useful. There is a balance in the AI understanding the value of their capital. If you have some save games showing where the AI didn't defend their capital as much as they should have please upload them so I can take a look.
-
It's my 8 week updated war/gaming Youtube pick!;
This one goes out to the AI developer(s)!
It's Tricky by RUN DMC;
https://www.youtube.com/watch?v=l-O5IHVhWj0
(when the AI is officially done maybe I'll start an "AI tweek challenge" thread and post my 8 week war/gaming Youtube picks there maybe)
-
Been a while, but I had some time to play Iron War vs the AI last night so thought I'd check in and say what's up. Predictably the start of the kid's new school year, rescuing a dog, and then the lady in crushing new nursing schedule has all conspired to reduce my tripleA game time. But a face to face game of global over the weekend had my interest in tripleA piqued once again hehe. Hope all has been going well!
Anyhow, here is a quick save as the German block (+Balkans and Finland) vs everyone else Hard AI. Overall was pretty pleased with the AI performance of my teammates and enemies. The IJN held there own in the far east, and Africa was a hotbed as usual. The game was cruising along until the 1945 (12th round) when the Germans were finally able to trap and destroy the combined Allied fleet in the Med. You can see here how we back them through Gibraltar then closed the strait and smoked 'em.
It had me thinking, something that might help the AI to stay more competitive on the water is a bit more destroyer/blocker screening. I guess this would be similar to what the AI already does on land, where it often leaves an infantry unit behind to block the blitz path, except in this case using destroyers to disrupt movement across the sea lanes.
Generally the AI fleets will mass together, and if they come under threat will back away the full distance giving up a strategic position to try preserve TUV. But there are a lot of instances where a relatively cheap blocker left behind would allow the AI to remain in place rather than withdraw, or to withdraw more effectively, by restricting their enemy's combat options. Taken to the extreme this sort of block and screen strategy from the AI would likely involve a fair amount of naval TUV sacrificed over time, but I think in the long run might make it more challenging.
I used the last stable build (the one currently available from front page of the main site.) I like how this one just updated my install, that's a nice feature.
-
Here is a similar sort of situation, again in Iron War, this time as USA vs the HardAI.
In this instance we conquered Truk, parking a large US invasion fleet within striking distance of Tokyo in the process. Rather than abandoning the capital and pulling the IJN away from the fight, it would have been possible for the Japanese AI to leave a blocker or two in the sea zone around Wake, and prevent the attack altogether. At the least it would stall the outcome by a round, or force the Allies to try and can open with a weaker power. Even if the Japanese threw a couple ships away each round to set up pickets and screen against a USN advance, it would be a cheaper sacrifice in the long run to lose some destroyers but gain another round to build and maneuver.
-
@black_elk Yeah, the AI currently doesn't try to use cheap naval ships as blockers. Its on the list of things to enhance but isn't an easy thing to implement. But thanks for the feedback and save game examples.
-
For sure. Its tricky because at sea it doesnt make as much sense to constantly leave blockers behind or try to occupy every sz the same way nations try to occupy land. At least not in a human vs human situation. Still, as a generalized strategy of the AI, I wonder how it would play out if they always tried to keep a cheap surface ship in every sea zone? Or in coastal sea zones at least. In Iron war sometimes the AI dupes itself into leaving patrol boats behind (because of their movement) or a transport, which can present entertaining challenges, but its more by accident than any grand designs of the enemy's AI admiral hehe.
Anyhow, just something to muse on. For the most part the AI is pretty efficient at shuffling around the globe, but that's one place where it gets tripped up with the big fleets.
-
@black_elk Yeah, every SZ or even coastal SZ is probably way too much. My initial thought was to check if leaving a cheap ship in any SZ adjacent to large allied or enemy fleets allows to either save the fleet or position it more aggressively.
-
@redrum Does AI currently recognize that a canal with it ability to block an entire enemy fleet. Is a viable option worth looking at? When considering defense of it's fleets or coastal territories threatened by enemy fleet.
-
@general_zod It doesn't consider conquering a land territory to close a canal in order to block enemy fleets. It does recognize whether canals are open/closed when calculating potential enemy attacks though. Considering canal 'value' is something that is on the list and I'll clarify that a bit.
-
If/when the AI begins valueing canal land territories, it will be a game changer for a map like Iron War. At that time I will have to play that map again and see if balancing or other changes are needed. @Black_Elk I'm glad you have not given up on Iron War and still play it. You might be the best qualified person to define what small changes would be fair after an AI update
-
How accessible (in terms of ease of readability) is the ai code? and how well documented is it?
been playing quite a few ai games lately on various maps; and while fun enough, it'd be nicer if I could make the ai smarter, so I wanted to look under the hood to see if I could tweak some values to tighten up the ai's play.
or are there any particular sub-problems wherein it would be helpful to have more thinking on how to design the algorithms?
(yes I'm in computer science and know how hard ai is) -
@zlefin Well, if you know Java well then it shouldn't be too difficult. I'd say the code is structured fairly well but definitely could use some refactoring in different areas. The first post of this thread lays out the high level flow and structure of the AI. I'd recommend pulling down the code and attempting to improve one specific thing. I'm glad to provide advice/assistance. There are tons of areas that could be improved in the AI including the list of things in the first post of this thread but also performance and even algorithms that are used. Really depends what you want to improve about it and what maps as really each map potentially has different priorities on the biggest weak points of the AI.
-
Thank you for being an active "TripleA" member (long timer), and for your contributions to our map depository. We hope you take advantage of the many new mapmaking features that are coming in our next official stable release. Although you can also use our current pre-releases in your map-making endeavors.
https://github.com/triplea-game/triplea/releases
The "TripleA" platform is currently entering it's new golden age. But we still have a lot of features and improvements on the backlogs. Which can really, even further propel, the quality of our existing games as well as those currently in development. "TripleA" is always in need of more assistance on the development team. Since you have experience with this sort of thing. Maybe consider joining the team and coordinating efforts on a higher level.
But if not, even tinkering on your free time is also very beneficial to "TripleA". You may post anything you find, that can be improved at our GitHub link, where they speak technical jargon. Or post on this forum. Also here is a convenient link to our current public features request page, that are on our backlog.
Best Regards, GZ
https://github.com/triplea-game/triplea/issues
https://forums.triplea-game.org/topic/182/guidelines-and-feature-request-list
-
@redrum
I can read java fine; but I'm quite rusty and haven't actually used dev tools in years. I think i'd like to use something like a debugger mode so I can go step by step and watch the ai perform it's calculations. that tends to be the easiest way to get a feel for how the ai is thinking; and to figure out exactly where to place a change to fix it. I looked through the ai files a bit with just a regular text editor; but it's so much easier when I have the right tools for the job, and a regular text editor isn't much of a specialized tool. any particular programs you recommend?the most common annoyance is the ai leaving itself overly exposed to counterattacks; the ai sent in too many forces to an attack it had a good enough odds at with less. especially on low luck setting wherein it's easier to exploit those. I've been playing balance of power 2 lately; and the ai does that a fair bit. when a battlefield is a back and forth over the turns, this causes the ai to suffer higher attrition over time than I do.
while design is fun, coding is a chore, so mostly I'm looking for thinsg wherein a well-placed change can make a nice improvement without taking too long to write.
-
@zlefin Most of the developers use Eclipse but IntelliJ works as well. Here are the general recommendations for settings up the code base: https://github.com/triplea-game/triplea/tree/master/docs/dev
For observing how the AI is thinking, you can turn on AI logging at different levels by going to the top menu bar in game 'Debug' -> 'Show Hard AI Logs'. Its pretty rough as I'm really the only person that ever looks at it so lots of data and might take a bit of time to understand the context. Using that combined with searching through the code or using a debugger should give you a picture of what's going on.
On the AI using too many units on attack, this is a bit on purpose because ensuring that attacks are successful and leave at least 1 land unit helps minimize the chance that attacks fail and leave unexpected counterattacks open which can be hard to handle.
If you have some save games, I'm glad to help walk through a few scenarios with you so you can understand the decisions the AI is making and whether tweaking things could help. The other thing to realize is currently the AI isn't optimized for any particular maps and runs the exact same algorithms all on maps. Eventually I'd like to provide map makers with AI configuration so it can be more optimized for each map.
-
ok; i'm gonna do some looking over for the results when Russia is set to hard ai for the opening move of Big world 2: balance of power.
The Canhold = X variable in the "Check if we should try to hold attack territories" section is supposed to measure whether the enemy would either be unable to recapture the territory, or it would be unprofitable for the enemy to recapture it, correct?edit: bah; I downloaded the most recent pre-release engine version and now the map is giving errors; i'd wanted to use it in case there's bugs in the ai calcs that were fixed since the regular release. guess I need to revert to a more stable version; I shouldn't have told it to overwrite my installation which version would be best to revert to?