The Forums Are Now Closed!

The content will remain as a historical reference, thank you.

Demigod AI

By on January 28, 2009 8:45:28 PM from Demigod Forums Demigod Forums

dstaltman

Join Date 02/2008
0

Artificial Intelligence is an important part of any game. What AI is covers a large aspect of the game as well.  One focus on the game for me has been creating the AI for computer controlled Demigods. This is the skirmish AI for Demigod. 

In Demigod, we sought to create a skirmish AI that would be interesting and fun to fight against. We wanted to make sure the Demigods fought well, but we also wanted the AI to feel different when you fight against it. The AI doing the same thing every time you fight against it limits your replayability. 

We are using a type of Goal based AI referred to as Goal Oriented Action Planning or GOAP. A goal for the AI is an issue the AI wants to fix. If there is a “health” goal, the AI might want to use a health potion. In GOAP, there are a number of goals and the AI creates a series of actions to fulfill ALL of the goals. We are using a system based on this concept for Demigod. 

An AI agent has a number of sensors examining the world. These sensors populate a number of goals for the AI agent. Whenever the AI agent is idle, the AI agent will create a plan to fulfill all of the goals given to it. The AI has a number of actions and determines which action to do in what order. This is the “P” in GOAP. 

One of the great things about the system is that the AI will often do things you would not expect. Based on what an agent can do and what an agent thinks it can do, you can get some interesting and often unpredictable results. 

It also makes extending the functionality of an AI very achievable. If we change the abilities of a certain Demigod, we simply tell the AI for that Demigod what changed and away it goes. We do not have to spend time rebuilding complicated scenarios for what demigod should do in what situation!

This is exciting stuff for us. The use of GOAP has been a huge boon for making Demigod. We are really gunning to make the skirmish AI in this product something awesome.

Locked Post 14 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
January 28, 2009 8:53:39 PM from Demigod Forums Demigod Forums

Hate the font, love the insight.

Reason for Karma (Optional)
Successfully updated karma reason!
January 28, 2009 9:05:06 PM from Demigod Forums Demigod Forums

It's working great so far from what I've seen. The friendly AI can actually be depended upon to pursue a good plan of action, not just mingle about.

One problem I've seen is when the AI decides to pursue someone with extremely low health. Normally they will pursue that person a long way, and not ignore it which is what they do if you're not attacking them and at >40% health or so and running away. Anyway, sometimes they will pursue a person a long way into the enemy base, "hoping" to get the kill. So far so great. But sometimes it fails to get the kill, and gets stuck inside the enemy base. Instead of trying to escape, it will stand and fight towers until it reaches <20% health, and then try to run (which is often too late for most of the game).

A "run away!" plan is needed in case they are alone against a large amount of towers and going below a certain percentage of health (ideally significantly higher than the normal "run away!" trigger).

Edit: I would also like to see AI demigods play more with other friendly demigods. For example, they could literally follow human demigods around when it makes sense.

Reason for Karma (Optional)
Successfully updated karma reason!
January 28, 2009 9:39:33 PM from Demigod Forums Demigod Forums

My only worry is with Oak. His die and rez more powerful power seems to make things hard because the AI will decide to retreat for health and then die, rez, but continue back for health wasting the power, or at least I've seen that happen enough time for it to bug me.

Reason for Karma (Optional)
Successfully updated karma reason!
January 28, 2009 9:42:21 PM from Demigod Forums Demigod Forums

Interesting comments.  I was taken by surprise alright the first time the AI took my valor flag while all the towers were still up.

 

Any chance of making the AI remember and change based on player actions?  Right now the same tactic can be used over and over again.  An example of this is laying down mine fields as Regulus between the AI's citadel and one of their portals.  After the dying twice in a row it would be nice if they would check for mines the next time they try to get their flag back.  I would like it if the AI could learn where the most likely spots for my mines are and check for them instead of charging in. 

The ideal single player AI would learn between battles in the cmpaign so the job of ascending gets harder as you play.  However, the only AI I know of that adapts the more it is played was made for TA Spring.  A 'learning'  AI would make Demigod standout from all other games.  In theory 'super' AI's could be developed by giving them data on how the best Demigod players play.

If learning AI can't be put in the game now, then it might be a worthy goal of the year of free updates or in an expansion pack.

Reason for Karma (Optional)
Successfully updated karma reason!
January 28, 2009 10:04:21 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

I vote you change planning to tasking and call it GOAT.

 

Reason for Karma (Optional)
Successfully updated karma reason!
January 28, 2009 10:25:16 PM from Demigod Forums Demigod Forums

lol, I agree with every one so far even kitkun! Also ty for talking to us about stuff and plans.

Reason for Karma (Optional)
Successfully updated karma reason!
January 29, 2009 2:06:49 AM from Demigod Forums Demigod Forums

the only thing that i think could make it better is that instead of updating its series of actions when it is idle, it should also update when significant actions occur in game. This could potentially solve the oak problem stated above, as we as just making the AI react more quickly. Unless I am misunderstanding it, it sounds like the AI currently creates a list of actions, and then only creates new actions once it finishes the previous series of actions.

Regardless, the entire idea is great!

Reason for Karma (Optional)
Successfully updated karma reason!
January 29, 2009 2:35:27 AM from Demigod Forums Demigod Forums

Is this why my Yetis dance around in a circle stuck or doing nothing with enemies insight? All you have to do it play Senda once to see this. May be the AI isn't done just yet.

Reason for Karma (Optional)
Successfully updated karma reason!
January 29, 2009 3:15:40 AM from Demigod Forums Demigod Forums

Thanks for telling us, very interesting system. Very expierienced modders might be able to change the AI to make it use thier mods perfectly.

Reason for Karma (Optional)
Successfully updated karma reason!
January 29, 2009 10:06:32 AM from Demigod Forums Demigod Forums

Really interesting. 

Something to note - At high levels of play in a 2 human v 1 human and 1 nightmare AI - the team with the AI will always lose.  This is because the AI has no parameters which say "drop what I'm doing and go by the quickest route possible to where my ally is getting crucified by two opponents" or "somewhere on the map an opponent DG has less than 1k health, I should snipe them for the kill." 

I.E. A good team of 2 humans will beat 5 nightmare AI because the nightmares do not tagteam or synergize their abilities effectively. 

The self-preservation between this Beta and the last one is much better, but as HF says, if the AI is in a grim situation when priorities shift they can't exit effectively.

Nightmares chose great items like Heaven's Wrath for example - but they trigger lightning at game start on my citadel - not gonna do much for them.  They'd be alot more effective if they used it against grunts early for the xp and shifted to citadel targeting only when within a given radius (about to win, basically).  It seems like alot of favor item usage follows this pattern. 

Reason for Karma (Optional)
Successfully updated karma reason!
January 29, 2009 8:00:46 PM from Demigod Forums Demigod Forums

Agree with Ke5trel here.  AI at hard and especially at Nightmare should work together.  I don't want regulus always taking the one hit snipe, but in nightare they should definately work as a team, if at all possible.

Reason for Karma (Optional)
Successfully updated karma reason!
January 29, 2009 11:20:21 PM from Demigod Forums Demigod Forums

Kestrel hit the nail on the head alright. Another similar example is that the AI will chase a low hp Demigod regardless of whether they can kill it + they aren't very wary of towers.

Reason for Karma (Optional)
Successfully updated karma reason!
January 30, 2009 12:29:03 AM from Demigod Forums Demigod Forums

Some of the nightmare AI is finicky on the P part.

Rook refuses to carry potions only in nightmare (from what I've seen), prefering to summon a tower at the start of a skirmish and eat it when low.  If he had potions, he could do one first, then the other if called for.

Erebus only used bat swarm as an attack.  Big problem as it's one of the best defensive moves.

Oak doesn't prioritize well for his last stand.  Why hit the full health demigod when he could take down two low health towers.

Sedna seems to assume Silence is the way to start a fight with every demigod.  Good strat for some, bad for others.

Regulus wastes his Snipe most of the time.  Though the bolt from the blue is sometimes timed perfectly.

Unclean Beast seems the best of the bunch strat wise.  That is if you want an uber aggresive AI.

Torchbearer could use the most work.  He stuns more now, but he always seems to leave a spot open for retaliation or escape.

Queen of Thorns is easy to take down, but boy can she front-load the damage.

Reason for Karma (Optional)
Successfully updated karma reason!
January 30, 2009 11:22:25 PM from Demigod Forums Demigod Forums

i think the ai's are getting smarter. I've seen them use potions, teles, and caps lock. They seem to be getting smarter keep it up. Why are u talking about Erebus and Tb last time I checked we couldn't play them.

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