How to make a map AI friendly?
-
How to make a map AI friendly?
Currently the best example is 1941 Global Command Decision, 1941 GCD, but I would say that
@Black_Elk & I spent many hours, too many hours trying to make the AI play better.It has;
- Liberal use of "capital" xml code that tells the AI what is important to players, like Oil Field territories, Panama Canal SZ, Straits of Gibraltar SZ, SZ15 in the middle of the Pacific and Capitals of nations, total of 79, of these 29 are for Victory Centres and a liberal 50 to make the AI play better. So 50 more than you would normally have.
- No Objectives, the AI does not understand these, unless it is helped with Capital code and/or in the case of 1941 GCD, it has Oil-Fields with a high TUV. Sea Zones can have pu values and this will also guide the AI.
- No Politics, this is just random and the AI just blunders randomly its way to a political stance, however with lots of triggers it could be made a lot better
- No A&A style Technology, as the AI does not buy it, Frostions Age of Empire Tech tree works and so does the trigger turn based+random of 1941 GCD. Also World War II v3 (AA50) with techTokens being produced in specific territories, like capitals, victory cities or by factories.
- Use of 2.6 isAI xml code to control the AI players, like making purchases and placing units that the AI would not normally make and to give it an edge. 1941 GCD AI has units & Factory's bought and placed for it for free intermittently.
- Stacking rules/Upkeep to limit units in a territory, like only 10 Tactical Bombers in a territory or only 5 Aircraft Carriers in a Sea Zone, otherwise the AI goes wild and stacks 40+ Bomber-Tac in Brazil and does not use them.
As a guide if your map has 20+ units of the same type in a territory you need stacking rules.
Note: this is not needed on low unit density maps.
Note: Upkeep can be a substitute for Stacking rules on medium/high unit density maps, where each unit costs 1pu+/turn to maintain.
Note: maxBuild can prevent the overbuying of specific units. - Only PU as a resource. The AI does not understand other resources and can only really spend resources, and not save them up. There is no trigger to test the number of a resource an AI faction has.
.
As a guide AI friendly maps should have four or more of the above.Have I missed any, if so please comment.
Not strictly needed to be AI friendly, but, Upkeep, each unit on the map costs say 1pu per turn to simulate logistical supply, it reduces the number of units you can buy the bigger your armed forces get, it can be that sometimes you cannot buy anything, also means you have less chance of super stacks.
So if we rate a few maps out of 7;
7 1941 Global Command Decision (All 7 & Upkeep)
6 Middle Earth 3rd Age (capital, No Objectives, No Politics, No A&A style Technology, Only PU, Upkeep)
5 The Shogun (capital, No Objectives, No A&A style Technology, Only PU, Upkeep)
4 Shogun Advanced (capital, No A&A style Technology, isAI, Upkeep) -
@thedog You can use maxBuild to prevent the overbuying of specific units.
Be careful with upkeep, as garrisons on islands can drain resources from the AI. You may want to use a specific unit type, with no move or upkeep for garrisons.
Another issue with upkeep is that it can leave the AI without resources to respond to a thrust against its capital by building new units. Garrison units can help here as well.
For Technology a simple trick is to use AA50 style tech with techTokens being produced in specific territories (like capitals or victory cities) or by factories.
Avoid the use of special resources like oil. The AI does not really understand them. You cab get rid them, give them through the isAI code or use Capitals to direct the AI to them.
-
@RogerCooper
Thanks!
Added in #7 Only PU as a resource and other changes to 1st post -
I think we should rename the "HardAI" to something that doesn't have AI in the name. Like "Computer" or something along those lines? Would seem less fraught. "Comp" would be 2 letters shorter anyway for the UI windows. "Not_AI" would be kinda amusing if keeping the same number of characters. Although the idea of beating up on an AI (and a Hard one at that!) is pretty funny, I think the diphthong is well and thoroughly tainted by this point. The term just has a different register in 24 than ever it did before. What exists in tripleA is definitely not an AI, surely not in the way that the term is getting thrown around of late. Peeps just refer to it by the shorthand provided, so probably avoids spambots and such down the road too. I guess if keeping the Hard/Fast distinction they could maybe just be called that, instead of HardAI/FastAI.
For games that work well given what the computer can do, I think the critical assessment there would be under v1-v2 rulesets it performs ok and almost works with v3 ruleset, but anything much more complex and you have to guide the computer with stuff like triggers or more resources. Some kind of advance that's bonused in. The Computer goes after a capital and that seems to be sorta the only thing that's going to matter for how it moves, outside of TUV contested in battles over specific tiles. I think the Computer can provide a decent challenge provided it's given enough a resource modifier. It bids rather poorly, but does alright via the normal purchasing mechanisms.
Maps that use the v2-v3 ruleset as the basis, without any sort of objectives or politics I still think are the friendliest overall. You can still get a pretty good challenge going vs the Computer in say Classic or Revised, but it doesn't mimic human players. I think that would require a scripted opener of a sort where the computer is prepositioned to hit it's early marks and then whatever comes after is sorta just the computer playing at advantage in some way by resources/units that it gets (more than the player). Some sort of ticking clock thing where the player is trying to get points or win in a set amount of time vs a less competent computer opponent. I think that might also have some appeal.
If work isn't really being done on the Computer player, then I think it's down to the map design to sort of account for how the computer will play there, assuming nothing new coming down the pike. Basically looking to what the computer player is actually doing, rather than what we might wish it would do if it was an actual player. There's no data set or anything, it's not like learning as it goes, again not an AI the way new users might assume, it's just running through it's paces in the battle calculator with a simple set of goals on the calc all framed off TUV basically. If it doesn't have it's TUV juiced to keep pace, it just collapses under pressure and withdraws, which is why I think the steady boost is probably better (income modifier method for SP). Otherwise kinda hard to make a game that is both SP and MP friendly, since the conditions there for the game start will be pretty different. Just for an example playing against the HardAI in Classic or Revised or even v3 and giving the computer a decent income modifier, the computer can be made very challenging. If you give it a bid of 100, it'll just blow the whole wad on transports and such probably hehe. Not the most elegant of approaches, but I think it just performs a bit better with a consistent (if smaller) boost round to round, than a big pile at the outset. It basically needs a leg up the whole game to keep pace.
Just my thoughts. I never know how to rate or categorize tripleA maps, I think it's sorta just the big giant grab bag sometimes. I haven't played even half the tripleA games that exist to know .
I think a tag like SP or PvP might be good too maybe? since some maps are very much designed only for PvP, like any of Hepsters individual creations for example, as he seemed fond of including rules that the computer just couldn't use really, as an intentional design choice. Redrum made the HardAI/FastAI into what it is currently, to spruce up whatever simplified thing we had going before, and I think the name HardAI was pretty appropriate like 10 years ago, but that's cause AI didn't exist in the way it does now back then. I think an update there would maybe be timely. SP friendly could be different things for different maps for sure, just needs some kinda ballpark there, like what settings to provide the SP player. The same way a standard bid might be determined in a PvP match, with whatever preconditions to offset board balance or player skill, just a version of that which the computer can work with more consistently.
-
@black_elk I don't see the problem with calling the 3 computer player types for the game AI's as that is exactly what they are. Despite the buzz of the past year, LLM's are a type of AI, not the definition of an AI.
As AI's for wargames go, the Hard/Fast AI is pretty good. It is much better than the AI than for the games from say Avalon Digital. It has a few glitches, but the overall construction is quite sound. The new isAI function, will now allow designers to program in strategies for the AI's.
-
@rogercooper I take the point for sure, but was trying to stress that right now (and especially over the past several months) the general awareness and attitudes towards this simple phrase have shifted pretty markedly. Were I a new user to tripleA and thought the application was somehow making use of generative AI or riding that wave, I might just pass on installing tripleA entirely. The mass grift that happened in the creative arts very recently (visual arts concept art especially) colored it red for me and just left a very bitter taste in the mouth. I made the same point a year ago, but I think even since then things have only become more charged and less nuanced.
Just seems like something that might be worth getting ahead of. I feel like if tripleA somehow had legacy production units called 'BitCoins' or if TUV was somehow called 'NFT' in tripleA, that I would ring the same alarm bells for the wisdom of minor adjustments in a name change, if only to avoid the spambots which will inevitably start poking around to tell us about amazing investment opportunities or whatever heheh.
Ps. Also I don't really expect a change in the code to materialize on this, like I'm not holding my breath on that lol. It's also quite common for players to refer to the computer script or pathing issues as AI issues, that's all pretty familiar for years and years now. I just mean that little designation that flashes across the screen when selecting the player type in the UI initially, or which displays in the columns or button boxes from there, since that's what the end user is actually seeing and interacting with. I think it could be just about any name there and peeps wouldn't miss a beat on it. Just that they'd have a different way to refer to it, perhaps something still amusing?
Hard/Fast still reads like an inside joke to me (Easy/DoesNothing was pretty hilarious too hehe) but anyhow, just an idea. Its not germane to this exact conversation about which maps work best in SP, except for our shorthand.
-
@thedog said in How to make a map AI friendly?:
No Politics, this is just random and the AI just blunders randomly its way to a political stance, however with lots of triggers it could be made a lot better
I was just thinking of a way around and wondering if anybody ever tested it:
Let's assume a very primitive political situation, for example: Switzerland is neutral, it is worth some IPCs and has a small army. The only parameters to be taken into account to decide whether or not going to war against it are "Do I want this money and do I have enough units to attack".
Would it work to change the relationship during AI turn (let's say, Germany) to "At war" and to let it decide based on the usual algorithm if it will send units there or not? If it does, then the decision is interpreted as a war declaration. It it doesn't, then relationship turns to neutral again as if nothing happened (because actually, nothing happened).
What do you think?
-
Short answer yes.
Using isAI and say rounds 4-5, 8-9, 12-13 or another condition
Have 2 or more turns give the AI a chance to assemble forces for the attack.