Stupid AI tricks

By on November 22, 2010 12:13:12 PM from JoeUser Forums JoeUser Forums

Frogboy

Join Date 03/2001
+1120

image With Elemental: War of Magic v1.1 BETA now out, you can see the direction we’re heading with the game.  Global mana has made a huge positive impact on game play and having your population being put to work (literally) not only provides a great game mechanic but connects the player to the game more closely.

As you can imagine, such significant game play changes require a lot of new AI coding to make it effective.  With Kael joining us to relieve me as the Producer on Elemental, I have more time for working on the AI (I am still handling the role of senior lead developer on the game which is a position I’m looking to fill – hint hint). 

A 5 step process

The process I use to make good AI works roughly as follows:

Step #1: Make the AI multithreaded.

This is the most important thing because it allows the developers to focus on making the AI effective without worrying about time so much.  Games with single-threaded AI have painful late games where you can wait a long time between turns. 

This part was accomplished in the v1.1 beta. It still has to be debugged (90% of crashes are due to this) since you have to make sure the AI isn’t monkeying around with main game data.

Step #2: Play the game at a basic level

This is pretty obvious. Can the computer players do everything that the human can do? This is something that I’m working on this week.  This can be effectively described as playing the game without worrying about opposing forces.

Step #3: Play the game at a competitive level

This is where it plays the game knowing that there are others trying to thwart it or destroy it.

Step #4: Play the game at the meta-game level

This is where it gets good at handling diplomacy, its dynasty, trade, and maximizing resources.

Step #5: Eliminate stupid AI tricks

Stupid AI tricks are simply little holes or little exploits that really need to be explicitly looked for and eliminated.

So for those of you who have v1.1, can you list THREE (no more, no fewer) things that you see the AI do that are either stupid or result in its destruction and what you would do if you were them?

54 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 12:28:41 PM from Elemental Forums Elemental Forums

1) The AI expands, building cities everywhere, until it runs out of food. Often, this results in a team with extremely low population. This is especially an issue on low difficulty, where the AI has no AI-multipliers on food production.

2) The AI builds caravans and sends it to the first available city. Sometimes (at the start of games), this is the enemy city on the other side of the map.

3) The AI does not defend its cities properly. The AI needs to put massive armies at "frontier" cities. I can understand that the AI does not need more than 1 unit defending a city close to its hearth, but an AI putting 1 unit to defend a city that is at a chokepoint, against an enemy it is at war with is not acceptable behaviour. Not only is the city an important part of its resourceproduction, the city also holds significant defensive properties.

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 12:29:43 PM from Elemental Forums Elemental Forums

1) It sends waves after waves of undefended pioneer through my territory

2) It sends several small armies against my big ones (the ones with spellcasters and armored dudes), one after the other. Very inefficient. When it saw my mini-StackOfDoom, it should have retreated and gathered its forces or stayed on the defensive.

3) It choses targets poorly. It should do the maths: a spear is good to fight moderately armored dudes, but not the ones with 10+ armor, which are going to be very tough to kill without bigger weaponery. a mass of dudes with low-level equipment is good to destroy an army of moderately equiped ones, but not the elite fullplate guy who are virtually invulnerable.  

 

Then again, it's extremely hard to say what the AI should or shouldn't do, as a good part of the new mechanics aren't working yet (spells/resistance, dodge/accuracy, influence and prestige...)

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 12:39:33 PM from Elemental Forums Elemental Forums

1) undefended pioneers

if i were the AI, i would protect the pioneer with at least 1 army dude who could subsequently defend the settlement once its built.  in addition, i would not be sending my pioneers (even if protected) through territories of factions i'm at war with.

2) too many small groups of armies

if i were the AI, i would make fewer, larger stacks of doom to attack my opponent

3) get the goodie huts

if i were the AI, i would invest a little more time and research into goodie huts and then snatch them up asap!

too bad we can only submit 3 (no more, no less) cuz I have a couple of other stupid AI tricks for ya

 

EDIT: on second thought, since werewindlefr already submitted the same as my first two, i'm going to add two more.

4) during tactical battles, the AI just runs over to me so that I can make the first attack.

if i were the AI, i would use my units more strategically.  look for good defensive positions.  stay back and wait so they get first attack if they can.  in addition, the archers all seem to shoot once then move a step closer...stay back! 

5) doesn't ally well with other AIs against me

if i were the AI, i would bait the other AIs to join up and kill the human (especially on the higher difficulties)

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 1:00:21 PM from Elemental Forums Elemental Forums

I only have two right now, not sure if these are resolved--Havn't had time to try the new build since finals are coming around.

1) Saying-WE SHOULD TRADE-Then not accepting any offer or any possible trade-at all

2) Saying-OUR CHILDREN SHOULD MARRY-Then refusing all marriage proposals.

I love the dynasty/diplomacy-A.I...Just needs a bit of work!

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 1:25:34 PM from Elemental Forums Elemental Forums

the dumbest thing I've seen the AI do is;

 

1)The Resoln empire built their main city in an area with no resources, I found them at turn 30, at turn 100 they still had a level 1 city with no improvements, I simply took it over with a force of two heroes.

 

2)Every time I start a games there is always one or two factions that spam the living hell out of pioneers, while yes that is a good strategy if you have the resources, but these idiots had -5000 gilder I dont even understand how they were still building up armies or pioneers for that matter, AI needs to know its limitations and accordingly be strategic.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 1:28:22 PM from Elemental Forums Elemental Forums

1) Defend cities with more than one weak unit.

 

2) Notice that my archers tear you apart and put your best armor on your new units

 

3) target my ranged fighters (archers and spellcasters) in tactical battles first. Currently it seems to pick on the closest enemy. I always target the archers first, then the spellcaster. Unless it is spiders, then I go for the poison spitting one first.

 

 

Just to 'me too' one of the others - They built a road from their capital to mine in the first 20 turns. What a lovely way to find and get to their capital. He didn't make it to turn 35.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 1:46:41 PM from Elemental Forums Elemental Forums

This is a problem that you can game the AI with, though you can also game humans also.  This problem is half gameplay/half AI.

 

The player can refuse to research the adventure techs which reveal bonuses, and the AI will do it for him, revealing the bonuses- which is free research for the player.

 

I posted a suggested fix (kinda complex) in the Ideas forum.

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 2:07:39 PM from Elemental Forums Elemental Forums

1. No matter how many times I refuse the AI tries to be buddy buddy and get me to destroy other players. Even if I'm at war with the AI making the proposition and fully allied with the one they want destroyed. Every turn it's a constant "SRSLY Dude, no. I won't kill these guys."

2. I understand having AI personalities, but instead of hard coding them, where one civilization ALWAYS does the same thing, have an option for random personalities. Example Civ V's City State personalities. They have a different way of working economically _and_ acting towards other people. One could be a seafaring trading city but be completely hostile. Then you could have a peace loving militaristic nation.

3. Pending further thought.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 2:21:20 PM from Elemental Forums Elemental Forums

1/ I would most certainly go with the 'Sending Pioneers through enemy territory'

 

2/ Settling right next to my capital in an attempt to get my resources.

 

3/ Not collecting the goodies (unless they get goodies in different locations to us) I can always tell when i am approaching a new faction by the increased number of goodies laying around.)

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 3:20:53 PM from Elemental Forums Elemental Forums

1) The creature AI, which I have been extensively testing, is idiotic. They have no sense of value. They should be checking my attack rating and running or at least not bum rushing into certain death every other turn. How did these creatures survive in the first place, dumb luck?

Saving two for real frustration.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 3:34:38 PM from Elemental Forums Elemental Forums

Sorry about the long post, I got carried away.  BTW - Good job with the update!  I like the feel way more.

Caviat: I've been playing mostly on challenging, tiny map (improves my performance), selecting all opponents

1) The AI doesn't expand quickly.  I typically have 3-5 lvl3 settlements by the time the AI makes the 2nd settlement for them.  I also can expand without defending my settlements since no-one-as-yet will attack a non-defended settlement except brigands.

2) The faction AI doesn't adventure but non-aligned characters will.  Usually other faction's territories are littered with not done adventures.  I mostly sign non-agression pacts just to go adventuring when my territory's adventures run out.  It'd be neet to see Joe-the-dragon-killer lvl-bazillion NPC running around who's been adventuring on his own since turn1/lvl1.

3) The AI doesn't seem concerned with diplomacy.  I pay attention to the peace/war info, and I've never seen allied AI factions.  I've also never seen factions make treaties together to combat me when I'm more powerful than either, but together they'd give me a run for my money.  I've never been offered cash/goods/bribes for treaties.  It'd e neet to not attack the wimpy faction next door because it'd spike a WW1 response because of interlocking treaties/alliances.

 

Good Job:

The global mana pool.  I really, really like this.

The population pool.  This works out nice in that you have to figure out to build improvements or units.  But, I'd increase the costs in population of certain improvements.  My big cities can have hundreds of people doing nothing, because my faction as a whole's economy can't support another improvement.

The new spell divisions.  I like that you can't start with elemental spells.  This forces you to fight hand-to-hand more than I used to.  It also defeats the strategy of just grouping all your characters into one army while your sovereign blasts enemies with spells to increase everyones experience quickly. It's almost like there's a point to make one or more of your characters a Conan/thug/brute now.  Good job!

 

Things I've noticed:

The brigands are nasty!  I like them.  Their coding seems to make them more intelligent/plotting/agressive.  I am more concerned with individual brigands and brigand armies than I am with the AI faction units.  They are just that much more effective in my games.  Monsters, not brigands, just seem to sit in place and I've noticed that I can walk pioneers next to a monster with a better-than-average chance of not being attacked.  Not with brigands though...heck...they seem to be telepathic where my pioneers are concerned.

I haven't seen independant faction cities since I upgraded to version 1.09.  Even when I play a huge map, there's no independants there and I make sure I select them.  Before 1.09, they added a little spice...I like the idea of independant city-states that may sell you cool loot thats unique to them.

When your territory expands over another faction's unit(s), without a treaty, they won't leave your territory.  However, if it happens to your units, you get the leave-or-invade screen.

Factions choose to make lots, and lots of pioneers...even after all territory has been developed.  After a non-agression pact I'll have that factions pioneers all over my territory wandering around.  I'm not sure what they're doing, but they wander...and wander...and wander.  It irritates me simply because it affects my video performance.

When a faction makes a city, they seem to choose poor initial placement.  For example, say they are 1 hex from a field, 2 hexes from a mine and a gold mine, they will place right next to the field where if they moved one hex they could be adjacent to all three.

Capitar seems to be the most consistantly agressive AI faction.  I can depend on them to always build a large army and militarily take everyone else over or die trying.  Gildar seems middle of the road.  Tarth is peacefully expansive...they don't seem to build up armies until they are invaded.

If you find a golem token early on, before turn 20 or so, the game is pretty much over against the AI.  You can just wander around taking over opponent AI cities since your, and the golems, experience just keep going up and up.  It's almost like it gives you a blitzkreig (?sp) advantage.  And when you can add your familiar to this, it only gets worse.

Mine/Timber special tiles don't seem as important.  Later in the game, around turn 200-300, it's nothing to have a couple thousand materials sitting around.  Nothing you spend it on is really going to make a dent in it.  It'd be nice to see improvements to cities that made a turn-by-turn material cost requirement just like population and money.

Mounts just don't seem worth the cost/wait.  I'm more than willing just to pay for the +1 move boots for 10gp each than to wait for a horse or wolf to be available.  Maybe make the boots available later in the game or require a resource to produce them would eliminate this?

The new caravans make roads all over the place.  It's not as asthetically pleasing.

The raise terrain spell is too powerful.  You can raise a new continent early in the game now, but you can't kill someone with your spell selection.  I'd say take it back to one tile only, not the grouping of tiles where it is now.

 

Things requested:

Random maps.  I really enjoy the game, but sometimes I can identify where I am in relation to the continent on start-up.  It'd be neat to start up a game, even if I had to wait for a bit while the computer generated a map, just to have something "unknown".

The ability to change your faction's color and name.  Maybe even your faction's benefits/disadvantages.  I seem to play the Altar a lot, but am getting tired of red.

The ability to build roads without a caravan.  There are sometimes I'd just like to make a road that isn't between my cities for various reasons.

An earlier long ranged weapon like a sling.  I almost never bother with bows because by the time I get to them magic makes them pointless.  If I can imbue more than one character who can blast people with spells early on, why bother with bows?

Terrain addition: Rivers, streams and lakes.  Maybe a water fall.  Just for asthetics.  No other reason.

Figure out a way to make it worth your while to use the city-improving spells more.  They are really neat, but it seems like the only time I use them is when I can't, not un-willing-to but can't expand any more.  That seems to be the only time I use them.  Sometimes, when I've got my cities balanced later in the game, I bluntly forget about them as an option.  For instance, if you made farming occur later in the game like mining, you'd have to stick around your home city to magic up food before you could expand your territory.  That's keep your sovereign around home, instead of adventuring everywhere as you most powerful character.  It'd also force more infrastructure and lessen the horde tactics.

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 3:50:23 PM from Elemental Forums Elemental Forums

I found a bug with undefended cities (well not so much a bug but a misunderstanding). The Outposts are supposed to provide some basic population. The AI won't even attempt to defend a city that has 0 population.

 

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:00:58 PM from Elemental Forums Elemental Forums

From what I have seen, none of the AI outposts have any population. They just build some buildings but no houses.

 

I have noticed many times factions with negative gold and still having huge armies.

 

The AI builds cities very far away from its main city. They could have their main city at the bottom of one continent and then build another city extremely far north or something. 

 

I have seen their armies patrolling around a lot but not garrisoned in their cities.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:06:55 PM from Elemental Forums Elemental Forums

1. The AI builds cities on resources it cant use.

2. The AI "knows" where the resources are without having to "see" them like the player. If I recall you made a thread about the AI taking you to court because it could not cheat... well it seems to be cheating did you lose the case?

3. This is important the AI does not know how to claim multiple resources with a low level city and rather builds a city just by one. (For example there is gold mine, a fertile land and a wheat farm all about three to four tiles apart from each other and in a semi triangle formation. Instead of positioning his city in the middle of those resources so he can get them all when the city levels up it just builds by one.)

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:08:17 PM from Elemental Forums Elemental Forums

Another thing I found today was that the cached value for your units combat rating (the value the AI looks at) was alwyays 0 -- the AI would never think of your stuff had any combat rating in the new code.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:29:41 PM from Elemental Forums Elemental Forums

First comment: It's WAY better now!

About the AI:

1. It still remains very bad at defending itself - it does not react to armies that build up around it and sometimes leaves cities entirely undefended.

2. The Capitar often seem to be the strongest for some reason.

3. Tactic combat is stil way to easy as it will always march forward (even if being attacked) so that you can hang back and get the first attack.

3. Undefended Pioneers + adventures not being used by AI...

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:30:06 PM from Elemental Forums Elemental Forums

1. Everything the AI does looks like it doesn't have a plan.

It is much more forgivable if the AI plays badly by having a specific 'idea' and trying to execute it as opposed to having no idea at all and just spamming the player with mini armies, pioneers and the likes. I liked the implementation in GalCiv2 - every civ there had its own agenda - some just building up huge army, some a strong espionage system, some others tried to gather many allies. Would like to see that here as well.

Also make it a bit predictable (not too much). (like in GalCiv2)

 

2. Waste a huge and costrly spell on a puny familiar or peasant

3.  not protect the souvereign sufficiently

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:43:29 PM from Elemental Forums Elemental Forums


My biggest issue with the AI as of the beta, is that some factions(AI) will expand everywhere without regards to food or anything while others will do absolutely nothing and remain with only one city even after a while in.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:52:15 PM from Elemental Forums Elemental Forums

Quoting Frogboy,
Another thing I found today was that the cached value for your units combat rating (the value the AI looks at) was alwyays 0 -- the AI would never think of your stuff had any combat rating in the new code.

Ah see why it tends to throw small armies at well defended cities then

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 4:54:08 PM from Elemental Forums Elemental Forums

1. It still remains very bad at defending itself - it does not react to armies that build up around it and sometimes leaves cities entirely undefended.

I think frogboys posts explains this to if it always evaluates your armies combat rating to 0 when the AI is assessing your stacks and units it won't be seeing you as any threat.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 5:34:40 PM from Elemental Forums Elemental Forums

Frogboy: About evaluating combat ratings; I would emphasis defense over attack and here is why. As Werewindlefr pointed out, you can have only a few 10+ armor soldiers/champs walking around (with a relatively low total combat rating) and the AI might be spamming spear soldiers (attack 9 IIRC). WIth the current combat rating calcs, the AI might believe victory is assured when in realty it is near imposible. In the new system, the spear soldiers could never harm the 10+ armor soldiers. I would compare the AI unit's attack vs the defending stacks defense would be very valuable. It certainly would reduce the number of suicidal attacks on the computers part.

 

2). I would like to see the AI stack up their units more. When I play, the AI usually sends an equal CR army against mine (but i have armor) so the AI's force gets massarcred. Then another wave will follow and so on.

3) To tie into my second suggestion, it would be awesome if the AI gave you "one final chance" to pay up before onslaughting your cities. If the diplomatic AI would send you a message the turn before they conquered one of your cities. The message would be the standard "I'm bigger than you pay me" of sorts.

 

All in all, the beta made some very nice changes. Just curious, is your AI buff going to be in the next beta?

 

Jec

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 6:09:51 PM from Elemental Forums Elemental Forums

Regarding Step #2 (focus on strategic play, excluding tactical combat's issues):

1. Identify and claim resources via founding of settlements in proper locations. How agressive the faction founds settlements should be based on AI difficulty and faction personality. I was able to gobble up a number of city locations/resources lightyears before the AI. Disregarding choke points and such, the AI should know to lay claim to resources and where to best plant a settlement.

2. Properly and logically defend settlements based on AI difficulty and faction personality. I was able to conquer several settlements that had no defenders. I also witnessed random monsters ransacking AI resources over and over.

3. Know when to switch from colonization, to consolidation, and then to expansion via military means, influence, diplomacy, etc. The AI stayed in colonization mode long after the switch to consolidation or expansion should have occurred.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 6:15:17 PM from Elemental Forums Elemental Forums

With Elemental: War of Magic v1.1 BETA now out, you can see the direction we’re heading with the game.

Eh! Sorry, but on your main page, version 1.09 is shown. I launched impulse and there is no updated version. Do I really need to have preordered the game? If that is the case, when does version 1.1 will become public?

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 6:38:50 PM from Elemental Forums Elemental Forums

Quoting larienna,

With Elemental: War of Magic v1.1 BETA now out, you can see the direction we’re heading with the game.

Eh! Sorry, but on your main page, version 1.09 is shown. I launched impulse and there is no updated version. Do I really need to have preordered the game? If that is the case, when does version 1.1 will become public?

That is because it is a BETA, If you want to downloaded it (be warned it is a BETA and so prone to crashes and issues), you need to tick so prerelease versions in Impulse.

The latest released patch is still as noted on the website 1.09 the beta for 1.1 (known as 1.09n) doesn't count 1.1 has not been released.

Reason for Karma (Optional)
Successfully updated karma reason!
November 22, 2010 6:59:10 PM from Elemental Forums Elemental Forums

1. The AI declares war long before it is prepared or able to attack me. This gives me time to prepare a defense or to just attack them first.

2. The AI refuses to give me good diplomatic options for dealing with them (like demanding ridiculous trades for non-aggression pacts), forcing me to wipe them out for stupid reasons like their territory getting in the way of my travel.

3. Their armies don't run away when it is obvious that I will defeat them.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108432  walnut2   Server Load Time: 00:00:00.0000422   Page Render Time: