Jump to content
  • Advertisement
Sign in to follow this  
Baiame

Planner-based AI and action costs

This topic is 4073 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I read Jeff Orkin's "Three States and a Plan: The A.I. of F.E.A.R." and found it easy enough to understand. However, he doesn't go into great detail about the costs per action. I suspect that implementing the system such that the A.I. completes actions that satisfy the goal would be easy enough, but what about completing the best actions? He implies the use of constant values for the action costs, but I doubt that's sufficient in all cases (generally higher-level actions). For example, suppose you have a squad-level "flank" action. When is flanking better than just standing and shooting? It seems that you'd need a function that evaluates how dangerous the flank would be for the cost to be relevant to anything. Has anyone here used procedural costs before? Also, because it is also skimmed over by Orkin, what ideas do you have for the goals and their competition? Thanks for any input.

Share this post


Link to post
Share on other sites
Advertisement
You can bet that the movies demonstrated in the F.E.A.R. presentation involved alot of magic number tweaking for useful results, probably simple stuff like timers limiting how often a given action can activate or other such things. A hierarchical behavior tree like the Halo 2 one has the same issue with having to balance the priorities of competing actions. IMO the F.E.A.R. presentation attempts to make it sound overly simple, when the reality was probably not so simple as creating an action and dropping it in. It was more like creating an action, dropping it in, and testing it quite a bit to get the priority evaluation to a level where it looks good. I'm personally using the Halo2 system in my projects as explained decently on Gamasutra with followups talks available from the latest GDC, as are many studios. It's an incredibly simple concept that ends up being very powerful and quick to plug behavior into.

Either way though there's no magic in figuring out your priority functions, you just gotta test and come up with stuff that looks good. Often that comes from simple things like timers to limit the frequency, or biasing a pathfinding query to some distance off an optimal path to vary the paths returned, or weighting evasive actions against some time scalar since they last did one, etc

Share this post


Link to post
Share on other sites
The way you do a behavior system like that is to attach a probability to each behavior that designers can tune. Each behavior also has it's own binary heuristic: "can i run right now"

You evaluate all potential behaviors and collect a list of ones that "can run". After that you randomly choose weighted by probability.

Many of the flanks and stuff in F.E.A.R were also controlled by scripts and carefully designed maps. If you place that AI into any random level layout it fails pretty horribly. But that's fine. It's a great AI because:

1) design fully understands how it works
2) design can control it
3) it does what you expect it to do

-me

Share this post


Link to post
Share on other sites
In my experience you'd be hard pressed to find an AI programmer that would give the designers that low level of control. Designers are more times than not, ignorant/incapable of understanding how an AI works well enough to be tweaking low level behavior priorities. In my experience the AI programmer comes up with what looks good, and you toss the designers some bones for very limited customization of some behaviors. I'd be very curious if any studio at all gave the designers that degree of customization.

Share this post


Link to post
Share on other sites
Quote:
Original post by DrEvil
In my experience you'd be hard pressed to find an AI programmer that would give the designers that low level of control. Designers are more times than not, ignorant/incapable of understanding how an AI works well enough to be tweaking low level behavior priorities. In my experience the AI programmer comes up with what looks good, and you toss the designers some bones for very limited customization of some behaviors. I'd be very curious if any studio at all gave the designers that degree of customization.


So I'm an AI programmer at a major studio, that's more or less in the ballpark of how we do our AI. It's all based on the experience and competency of your design team. Our lead designers are respectively: math major, statistics major, history major. The former 2 are extremely technical 1 of which came from Bungee on Halo (and that was how their AI worked).

The purpose of design (in my experience) is to design levels and encounters. If they cannot control the AI, how do they control the encounter?

I've seen other teams with the philosophy of designers get the bone, and IMHO their games suffered from it.

[EDIT: I should point out that only the lead designers are allowed to tweak the behaviors in the unit archetypes. The level designers place the units as-is. However, the unit designers certainly have script hooks to the AI so that they can do things like: "when player enters trigger A, send AI to Node group X", and such. That latter type of script, IIRC, is how a lot of the "flanks" in F.E.A.R. work.]

-me

Share this post


Link to post
Share on other sites
That's fair. We have a philosophy of being a bit on the careful side of how much power the designers get. We have a few much more technical designer types among our 3 teams which get varying degrees of flexibility on their respective projects. On our project we're simplifying the interface with the AI quite a bit. They generally don't get to control the lower level behavior like when to take a knee, how often to move cover, when to combat roll, etc. Their control is at a bit higher level. Go here, get in this vehicle, drive here, etc. and more control over how they use weapons by specifying a number of weapon properties and AI 'hints' dealing with them. The weapon usage is a big part of designing encounters, other than that, higher level movement control seems to make up the bulk of the rest. Million ways to do stuff, ultimately you need to determine what degree of technical ability the designers can handle, preferably without constantly bothering you with 'bugs' due to improperly set up control mechanisms.

Share this post


Link to post
Share on other sites
Well, I need to design things such that there are no per-encounter or per-level scripts, so the AI must be versatile and require no extra human input.

Palidine, I was aware of the basics, I just doubt that constant costs for high-level actions (think squad or even platoon level) would work well. Constant values make sense only for actions that don't change under varying circumstances (for example, an NPC's reload speed will probably always be the same, so the "reload" action can have a constant cost).

[Edited by - Baiame on June 13, 2007 1:33:46 PM]

Share this post


Link to post
Share on other sites
If you expect that action cost is context dependent, then what attributes of the domain do you expect affect your action cost? Answer that and you have a means of answering your original question.

Cheers,

Timkin

Share this post


Link to post
Share on other sites
Ive used procedural cost in my homebrew planning system, it was one of my improvement over Orkin's system.

First, it depends on what you want to minimize. Do you want to minimize the time length of the plan? Optimize the chances of success? Minimize the risk of failure? (they might not be complementary!)

Another thing that you have to take into account is the order of actions. Unless you do a re-ordering of the actions after the planing, the cost of your actions may change the order they play.

Share this post


Link to post
Share on other sites
Timkin, I guess what makes it tricky is how abstract (or maybe just complex) the attributes are. For squad or higher level tactics, you'd have to consider the enemy's relative positions, firing range, numbers, defensive strength (cover, armour, etc.), and mobility. If you knew all this, you could make good descisions for almost any tactic; but I'm not sure how best to represent the data.

Steadtler, I guess I'm trying to minimize casualties, and (to a lesser extent) optimizing the chance of success. Reordering actions sounds a bit complex. I think I'll just continually check the current results of the action, and if it's horribly failing, cancel it (which can trigger some relatively simple and immutable "regroup" goal).

Thanks for the help so far, everyone.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!