Goal-Oriented Action Planning: Ten Years of AI Programming
ฝัง
- เผยแพร่เมื่อ 19 พ.ย. 2024
- In this 2015 GDC talk, AI Programmers Chris Conway, Peter Higley and Eric Jacopin revisit the Goal-Oriented Action Planning method of game AI programming to see how it's held up for the last 10 years, and how it influenced the AI of Middle Earth: Shadow of Mordor and Tomb Radier.
GDC talks cover a range of developmental topics including game design, programming, audio, visual arts, business management, production, online games, and much more. We post a fresh GDC video every day. Subscribe to the channel to stay on top of regular updates, and check out GDC Vault for thousands of more in-depth talks from our archives.
Follow us on Twitter
/ official_gdc
Check out our Facebook page for GDC exclusives
/ gamedevelopersconference
Visit our site: ubm.io/2ctNvqZ
it's so simple but using a* to traverse a graph of actions is something i've never thought of. it's burnt into my brain that a* is for a graph of, well, places.
A graph can represent many things. Usually a node represents some kind of state while an edge, which goes from one node to another, indicates a change of state, that is, an action over state. If you want to and if your application domain allows it, then you can chain actions into a plan; it's "only" a matter of making sure that the preconditions of each action of the plan are matched by some (previous) action effects. If you go one step further and add a cost to each edge of your graph, then you can decide to choose an edge because it's cheaper, for instance. Now, why not use A* if it's already in your code base?
I had the very same reaction when he mentioned A* as a mean to plan a route of actions.
So obvious.
I take this as a reminder of how important it is to think outside the box.
Using A* to traverse a graph of actions to achieve a desired world state and find the shortest path from current world state to desired world state is brilliant. So damn clever! Please excuse me, I must start prototyping! 100/10 talk within the first 10 minutes.
Agree the first 10 minute basically gave me a complete list of things I need to do to just implement GOAP. It made me GOAP!
It is actually the inverse, you find the shortest path from the desired world state to the current state, which in the case of situations with many actions but only a few leading to your goal drastically prune the number of transitions.
@@trollolotommy that makes so much sense. Thanks for clarifying 🙂
@@trollolotommyno, that’s a misconception. Doing so will not give emergent behaviour. Give it a try.
@@sirhc8927 explain?! I have implementations of both and a decent understanding of the mathematics and what you are saying makes no sense to me. I even have a bidirectional implementation where the forward and backward plan are both developed on different threads till they land on a common node.
simply persuasively thinking about my own life about it in terms of A* makes me think about how sub optimal I have been, especially lately. I'm like a complex GOAP with a 10% chance of changing my goal for every node traversal
lol
People watching this should check out LGOAP. It's a layered version of GOAP that allows to generate much longer plans without a massive computational overhead. Basically, the idea is generate a high level plan (build base -> build army -> attack). Then, for each actions world state in the high level plan, generate a mid level plan that satisfies those conditions. So , for build command center the mid level plan would be (build workers -> build barracks). Then, again, for each mid level actions world state, generate a low level plan that satisfies those conditions. So, for build workers it would be (build scv -> mine -> build scv -> mine -> build scv).
So you'd end up with a plan like so (when you concat all the low level plans together):
(build scv -> mine -> build scv -> mine -> build scv) -> (send worker to -> build barracks -> mine) -> (build marine -> build marine -> build marine -> build marine) -> (move army to -> attack on sight)
Has LGOAP been used in a commercial game?
Sounds a lot like HTN to me, where each high level task can be composed of smaller tasks. Definitely a system that needs more intention.
Makes sense probably for an RTS I assume, or something with many many units? Not sure the terminology but it seems like you should be able just to incorporate a shared data structure into your local agents world view, and that should basically handle it. If you just allow the value of the higher level attributes to dominate the decision making it should work, alternatively could just swap out to a different graph altogether.
GOAP is surprisingly easy to write, relatively. I used Unreal Engine 4 to write an AI that looks for a weapon, then ammo, then attacks. It was super cool.
F.E.A.R. still has one of the most deadliest A.I. I can remember in a game. They will try to get you out of your position and will flank you. One of the memorable things about them is they really seemed to communicate and do their actions. Interesting to see how they achieved it.
th-cam.com/video/rf2T_j-FlDE/w-d-xo.html
+ELH Imp he should start with actual FEAR AI document which was made available years ago.
As surprisingly as it sounds, AI agents in FEAR wheren't aware about the existence of other agents.
THIS IS GOLD. Thank you so much, exactly what I was looking for.
Thank you! :-)
I'm seeing a lot of wannabe developers knocking systems they can't even understand in the comments. This is impressive stuff.
What's not to understand lol?
Damn, this was a cool listen. Been thinking for a while about a somewhat complex RPG system, and this is an amazing addition to the toolkit.
Almost didn't watch this due to some critical comments, but glad I did. Recommended viewing if you are thinking about or are implementing GOAP!
I LOVE this Talk!!! I am having to stop watching this because me as a "Player" doesn't want to be aware of all the AMAZING System in the game...right now. I have to say though as a "Programmer and designer" I love what I am learning about how GOAP and The Nemesis System along with others which were implemented in Middle Earth: Shadow of Mordor
He's the Spider-Man of AI development. I wish more developers invested in game AI. Online multiplayer games have kind of disrupted this. I'm hoping cloud service integration and use of multiplayer mobs inspire a return to their continued advancement.
That system is awesome, need to find more good talks about it. The presenter is struggling a bit, but I'm still picking up new interesting things on the way.
Awesome, this is a freaking crash course, really nice talk !
Thank you! We tried... :)
@@ericjacopin2966 You guys a good job explaining this system, I'm currently working on implementing it into my game and this helps a lot
Well, what Peter was talking about sounded way more logical and easy to maintain, while Chris' version sounded like an enormous all-in-one blob. I wonder about Chris' general system design of his thing - i hardly believe that it's a blob.
Anyway, very informative talk!
It feels cathartic to see someone struggle when trying to explain an abstract complicated system to an audience of random people. I know that agony all too well.
Well, we tried. :-)
absolute mad man
Give this man a 1 year full paid vacation. He look so tired of all this shit.
What a great talk!
Thank you! :-)
wow, I could use some of this to make something genuinely interesting. too bad I only have enough initiative and patience to make what are effectively digital dice.
Why is there 2 GDC logos in lower right?
One is from the video, the other one is youtube slapping the channel logo there
Editor had a hang over
the small one is to watermark the big one
and the big one is to watermark the one that we live on, carried by the elephants standing on the giant turtle
Ozil knows something about ai too
11:56 Is that real-time... weapon change!?
I'm confused. The A.I in Rise of the tomb raider was panned for being very unresponsive. Was GOAP really the right model to go for instead of Behavior trees?
As far as I know, there shouldn't be much practical difference in terms of responsiveness based on that choice alone. Both systems should be able to execute for multiple entities each frame if necessary. As for that particular game, any system can be overloaded or poorly optimized, though if I had to take a guess, it probably is just a case of feeling less responsive than it really is and reviewers and players picking up on that feeling, almost like saying the framerate is low in an FPS when really, the reload animation is just slow.
As any other software, a game faces many software engineering problems; planners helps you avoid to put too much effort in programming the behaviors and then maintaining the code for these behaviors: the planner "finds" the BT and builds it online, and sometime finds another BT for a slightly different problem, etc. Whether NPCs were responsive or not may have to do with game design and not only with planning.
@@davidboeger6766 I would have to disagree a bit on this after playing it. The intelligent GOAP did not come across in gameplay. Enemies ran out of cover, would easily give up on finding me in stealth and did not use any clever group tactics to route me out because they were all dead within the first 5 mins of engagement. I do not criticize the work that these developers put into their AI design, but I feel this game specifically might have been rushed out the door before it was ready.
why not a HTN & GOAP Hybrid ?
What would you want to achieve with such a hybrid? What kind of specific problem would it solve?
I don't understand why the goals don't just have an associated action, and you explicitly list the other goals required to reach that goal. The extra step of actions to reach the goal and reconstructing the goals seems like it can be eliminated, no?
I would say that any planner today (2023) does associate an action (or even many actions, sorted with the help of numeric preferences) with a goal; and actually it was already the case in F.E.A.R. (you can check this by studying the AI Code of the FEAR SDK). However, linking an action to a goal means your planner goes backward from the goal state to the initial state and time has shown that such backward planners are less easy to debug than forward planners (going from the initial state to the final state).
No. What you are describing goes more in the direction of Behaviour Trees. Fixed, pre-defined actions, to reach a specific goal.
Why you use the "extra step" of creating several independent actions is, so that the GOAP planner can/may chose a different plan to reach this goal, each time - depending on costs (= environmental variables). This way, you reach the desired feel of unpredictable, "self-thinking" AI, which you cannot reach with Behaviour Trees.
what is tarantino doing here?
Show me the code
The third talk about GOAP metrics is completely inscrutable. The graphs make no sense lmao. I wish he would explain what they mean instead of just kind of, saying stuff. "These are actions timings per NPC average and max..." like okay WHAT DOES IT MEAN THOUGH hahahahaha
Don't hesitate to send me an email (on my title slide); I'll do my best answering your questions.
@@ericjacopin2966 Does your powerpoint have notes in it? I think that would be the best way for people to understand what your analytics were: sharing a link to your slides with your remarks on each slide.
Like si estás aquí por la clase del profe Abner :v
This is the saddest talk ever... All this work and it doesn't even show in these modern games.
It's really too bad that most of the AI in SOM are handicapped by a lack of reachable vertical locations and the abuse of basic unlockable gameplay mechanics making these AI states look insignificant. In TR 2013, gunfights are designed so that you HAVE to kill everyone, ideally at a range and there is no place for any other activity (hide, flee, flank, flush) making the AI look basic as if in a shooting gallery. Quite disappointing when you see all the work put into it.
I think the game designers and level designers should trust the AI a bit more and give them room to shine. I don't want to have to reference F.E.A.R all the time as the game that trusted it's AI to provide interesting and unpredictable responses.
One flustered reviewer / youtuber doesn't understand the depth of the AI and believes it's bad game design
--> 500,000 sales lost
Fappy LP that's either a troll or a misunderstanding of my post. Read again.
I praise the work but merely state that it doesn't show because of bad design in other disciplines. Thank you.
Deliberate misunderstanding. Absolutely agree with the points in your comment and was simply venting my frustration over the issue ;)
Obviously 500,000 is serious hyperbole. I don't believe that AAA titles are greatly affected by youtubers opinions compared to reviews on larger media outlets and average review scores, but for smaller projects, namely independant in nature, a single video by a medium to large influencer can decide whether it reaches a significant audience or simply goes unnoticed. This is why quite a few smaller games go down the "whacky elevator-pitch premise" route (Like _FF_ , but with _cats_ ; Like _soccer_ , but with _cars_ ; Like _gmod_ , but with _goats_ ; Like _2d Platformer_ , but with _30s cartoons_ etc.) You can probably boil down half the indy titles in Steam's "New Releases" section to this structure. It's the only thing that will catch an influencer's eye in times of hundreds of daily releases.
Sure, most people do, but if even half a percent of the viewers _consider_ looking at the steam page, that will almost certainly translate to several thousand dollars in revenue. More importantly, that surge of maybe only a couple hundred initial purchasers, will probably bump you into the all-important "New Releases" list, where millions of people will at least _see_ your game for half a day. If you don't make it to that point, you'd be lucky to barely recover the $100 submission fee. I also tend to not trust TB on these issues, as a whole cottage industry has formed around getting people like him to showcase games, often for payment offers in the tens of thousands. Heck "Airscape" (subject of the video you linked) now sits at over 300,000 copies according to steamspy. At $5 and Steam's 30% cut, that equates to over a million dollars. All due to that controversy ;)
An idea: What if your task-cost is now dynamic? what if your AI now respond to context? Have you consider using Neural Network to dynamically alter the GOAP's task-cost in real-time? For example, consider an AI bot with multiple guns; you know the "rock,paper,scissor" of games right?; so assume sub-machinegun is good versus 10 small enemy, and rocket is good versus 1 boss, but what if there's a combination of both enemy? there's a lot of combination to deal with and you don't want to hard-code 100s "if-else", but worry not, you can use Neural Network to learn all response and output appropriate response for each of them with just 1 brain!
Studios rarely use NN. It's non-adjustable, uncontrollable and so on.
Mmm.... Well, actually, dynamic costs are now the way to go. Somehow, the context modifies the costs (e.g. distance-based cost, but it's easy to think of many others) and consequently which actions are inserted. Your sub-machinegun example is close to what happens in current GOAP-based games.
@Nicholas Millington Predicting world states? NN is not good at pathfinding, at least multiple papers say so.
I like how GOAP can be simple, but a turd can't be that fast, but hey, they could run 400 NPCs (with a crapton of work), and that's enough in most games. I think they did well. But my little experience tells me that GOAP/BTs/branchy algorithms aren't appropiate for big scale scenarios.
Very good , this one
BORING
The lighting and his anxious jittering is not favourable in apperance... GOAP - Not even once.
Are we really judging the technical merit of a talk based on the lighting?