For anyone wanting to build better AI systems in their projects, this video is for you! I hope this video will give you the insights you need to implement GOAP in your project! 😁
My God, man... Always so advanced, sometimes very complex and yet easy to understand. I'm constantly in awe watching your videos. Where have you been all theese years, man? I missed you and didn't even know it... This channel is a gold mine for Unity devs. Please, never stop!
Actually my first comment for the decades of watching different Unity/dev/code videos. I’m a game designer in the core but learnt Unity up to middle+ level for eventual making pet projects. Your work and videos are for sure invaluable and grant a lot of specific details to maintain well-architected projects. Thanks ;)
I knew this was going to be an awesome implementation of GOAP, but it's awesome how you incorporated Factory, Strategy and Injection patterns into this... I'm currently doing some dialogue editor tools and would love to see you create some editor tools for this. Everything you do is impressive!
I can't believe that you actually took the time to go through GOAP! With your teaching style, it makes so much more sense and it's made it so easy! You've actually given me some ideas on the implementation, I'll have to experiment with more. Thank you again
@@git-amend I'm working on a game with enemies that require the complexity of the intelligence behind GOAP but once I have something to show off, I'll make a video to show you what I've made.
This is a great tutorial. Thanks for making it! I'm definitely not at the level where I understand fully how everything that you implemented worked together to create this kind of a system, but it's good to know of this method of programming AI. I'll definitely be re-watching when I've improved my knowledge and skills some more to really get a good understanding! Thanks again! 😄
Thank you for the kind words! It's truly an honor to receive feedback from the creator of such an amazing project. Your project is fantastic, and I'm glad to share it with others. Looking forward to seeing how you continue to develop it!
Been aware of GOAP for a while now but never looked into it very much. This seems like such a useful method for creating intelligent and modular AI. Will definintely have to give it a try. Keep up the good work.
Bro for someone not good at coding and thinking of building complex things, your videos are the perfect thing. I not only learn game development but also C#. Thank you so much for the time and efforts you put in the making of these tutorials l.
I am 25 min in. Just started the DFS part. Lot of new concepts. As a self taught programming newb, it is a lot to take in at the same time as learning about goap. Patterns, lamba expressions, delegates, node search algorithms. My head is hurting but I like it! I appreciate you covering these more advanced topics compared to most other channels. Thanks
You're killin it man. Great stuff. This video was fascinating. Loved the suggestions at the end. Would be interesting to see how you turn this into something more editable for the designers to use and so new beliefs/goals/etc wouldn't be created in code but rather in the editor. Keep up the great work, you're doing so well.
Programming question (around 4:20) Why use Func condition instead of just bool condition? I can't seem to find an answer online anywhere. It seems to me like they essentially do the same thing...? Lambda notation in general is crazy to me 😅
Using Func instead of a bool allows for dynamic, lazy evaluation of conditions, enabling them to be checked in real-time as game state changes, rather than at a single point in time. This approach is particularly useful in scenarios like state machines or conditional updates, where the condition depends on current game state or player actions. By using Func, you can pass a lambda or delegate that is evaluated at the time it is needed.
Thanks for the great tutorial. Is there any chance of this being expanded to show us more low-medium level devs how to use scriptable objects and / or Node Canvas?
I might do some videos on those topics in the future. Node Canvas might be a tough one because it's expensive and not everyone has access to it, but maybe we could build something similar from scratch. Regarding the gFactory, I can't recall exactly what I did in the video. You can put a GOAP Factory component on a GameObject and provide a reference through a public field if you don't want to use Injection or another method of inversion of control.
Thanks again, I would really like to see an advanced interaction system which there is no tutorial about that. For example dual-interactions that both effect player and the object, Interaction that need require different parameters, like one is inventory, and other is simple transform. Like a portal and chest. making them de-coupled with interfaces but with different params
Thank you for the great video. I am actually working on my own AI system right now for a platformer game. I am unsure if it makes sense for my needs to add this type of logic, but it is cool regardless.
Hey, great work, I m happy to see an work like this. I would propose that, if you have time, you could try using Utility-Based Planning. Then community can compare both approaches, maybe even try a hybrid algorithm 😁
Nice tutorial, thanks a lot! How about you make a video about parkour system (climbing, overcoming obstacles and so on) or procedural 3D level generation?
@@git-amend Please Do, Garry Newman is my God. his Transport is For everyone! as well i can only find a couple videos on how to implement it, so there is a spot there for you. (Edit: Steam actually tells you to use the Facepunch transport if you are using unity)
You mention updating this to use scriptable objects. Can you give an overview of what that would look like. I've been trying to do that myself and want to compare notes. Full disclosure, I've been failing to think of what would break off into SOs.
Well, it's a bit much to describe in a YT comment, but essentially the Scriptable Objects would be flyweights that have their own factory method which creates actual Actions, Beliefs and Goals you can use when starting the system. This way you can setup a nice editor tool that will allow you to configure all the setup in Unity using SOs and when the game starts you run some logic that puts it all together into something useable in the system by calling all the factory methods you need to get C# representations for the live system.
I like that idea. Along those lines, I've been also thinking about a 'credibility' score... so the longer it's been since an agent verified something was true, the less true it might become.
Thank you for the advanced tutorial. I'm working on a psychological horror game set in a castle where players solve puzzles and hide from enemies. I'm unsure about which type of enemy AI would be best suited for this game. The enemy should be able to search for the player within the castle. Additionally, I'm undecided whether to use a navmesh or A* pathfinding. Any advice on this would be greatly appreciated❤❤ .
If you don't need the full power of GOAP, you might want to consider behavior trees. They offer a balance between the adaptability of GOAP and the clarity of state machines, allowing for complex behaviors like searching and patrolling to be broken down into manageable tasks. This modular approach can make your AI's decision-making processes more nuanced and unpredictable, enhancing the suspense and horror elements. Regarding pathfinding, I would first try the nav mesh approach since it's already integrated with Unity, especially if you need a nav mesh already for the player. If you need more customization, then look into A*. The tool I mentioned in the video is excellent.
This is actually really interesting setup, I do have a question and havent really looked to much into GOAP. How would this handle dynamic goals, for example: Heal Friendly Target. But to heal this target we need to have a specific item. Do we just go and create all the actions for all the items? Do we do a Dynamic Action of sort that is UseItem , and create it on the fly on the plan? That means that now we have a ton of other actions to create - assuming a action factory exists for them for the character - , for example (findItemA, PickItemA) etc, that are derived from the state, is this the approach on this sort of systems?
You're on the right track. Generally speaking you try to build goals in such a way that they are as loose as possible. Without diving into a ton of detail, instead of an Action that is Use Health potion, you have an Action that is either Use Item that implements IHeal interface or Use Item that has an IHealStrategy, and then you aren't programming for every eventuality, and the Agent has options.
Great guide as always. Do you also use Unreal Engine or you are planning to continue your journey in Unity? What are your thought about UE? I have been using Unity +6 years and even though i feel i am a good developer myself but i still cant tell myself a game developer since all the games i have played from childhood was developed in c++. I feel like real game devs are on c++ side bu its a corrupted thought i know. :D Still, i want to continue my journey in UE side to develop high-end games or with c++. Even though i work as a full time game developer in unity side, i would love to develop in UE too.
It might be tempting to attach skill level to a particular language, but the reality is that you will reach a point in your game dev (or engineering) career where you become language agnostic. For example, at work this week I wrote code in 4 different programming languages. The syntax and some particularities of each language are different, but the best practices, patterns and principles of engineering remain the same. I have used Unreal, but I enjoy using Unity more, and the channel will for the most part remain a C#/Unity channel for the future as far as I can tell. I think if you have been using C# for 6 years, you will not have a difficult time using C++ or Unreal.
@@git-amend Nothing in particular, GMTK did a good overview on The Sims (ruclips.net/video/9gf2MT-IOsg/видео.html) and I'd love to see your unity take on the system.
Would it make more sense to have the belief's location be a nullable Vector3 since Vector3.zero could be a potentially valid location for something to occur?
Using a nullable Vector3 for indicating an uninitialized position is a valid solution if that was a concern you had. Another approach might be to use the Null Object pattern and define a distinct 'NullLocation' object to be a clear, type-safe alternative to signify the absence of a position without resorting to nulls. Then all locations could be represented by a specific type, and potentially include even more information.
I would favor GOAP for complex, dynamic environments where adaptive AI behavior is required, and choose state machines for simpler contexts with predictable, easily manageable states for clearer behavior logic.
Would such a system be appropriate for a game director (think L4D's game director) i.e. an AI overlord that tries to shape the experience of the player(s), or would you use something different? If something different, could you recommend a topic? Even if you haven't covered it, for my own research. Thank you.
For a complex and dynamic system like L4D's Game Director, GOAP can be a good choice due to its flexibility and ability to handle complex decision-making processes. However, Utility AI might be a more practical choice if you are looking for a balance between complexity and performance. Utility systems can provide a dynamic and responsive AI without the overhead of GOAP. This will be the topic of a future video.
Hi! Hope you are doing good, i have little bit issue with my self i really love your content but things always goes up from head i really want to get all of this how i can do that? i know the OOp data structures but in real life i really don't follow as much because of small dead lines we create games just for 1 or 2 weeks............ i really want to start can you guide me pls..................your content is love.....
With GOAP, how would you implement an AI taking damage and triggering a damaged animation? During this damage state, they should not be able to perform any actions. Do you complement GOAP with a state machine and have the two systems communicate? If so, what's a clean way for GOAP to determine which actions are available per state? Honestly that sounds messy. Or would you use only GOAP, with a belief such as 'isDamaged,' where the corresponding action would trigger the damaged animation? Or would you approach it completely different? Thanks!
I think you have the right idea. I would probably build a system outside of GOAP that registers hits and plays animations but can set GOAP parameters. Then I would add a "IsAbleToMove" belief that is a precondition to all actions wanting to move the character. While the taking damage animation is playing, set that belief to false and reevaluate the plan at the beginning and end of the animation. This would still allow the character to call for help for example. Which could then trigger other enemies to swarm the position.
A very minor thing, 6:03 but you don't want to be using distance for in range comparisons like this where you don't need to know the exact distance, just it is within the range, since it is needlessly costly calculation that includes an expensive squareroot operation that isn't needed. You can use the much faster square magnitude for the in range comparison
@@git-amend in general, I would say. There is no “horizontal” understanding of architecture, namely the beginning of the project. I studied a lot of theory and text and videos, saw examples of use (leoess, etc.). but at the beginning of planning my own architecture for a large and small project, there is simply no starting point in my head. It’s a bit of a strange feeling after I started to understand OOP well. :)
@@git-amend There's quite a lot of things that can be discussed that feel glossed over, or is outdated since most tutorial videos are based on version 0.51. Here are some ECS videos I'd like to see-- - How to understand ECS Physics collisions, and how to get the same behavior as OnCollision/OnTrigger Enter/Stay/Exit in an ECS context - How to use Animation Curves with ECS - When to use BlobAssets versus NativeArrays and NativeLists in ECS - How to use ScriptableObjects with ECS - How to communicate between ECS and GameObjects (Systembase, events, etc) - How to Bake a proper GameObject heirarchy to ECS, and how to interpret/visualize it in an ECS context I know some of these topics are intermingled with each other, but figured I'd state them anyways. I could go on, but ECS just feels half-baked and half-explained.
One step at a time, I suppose. You might want to join others on Discord (link in description) - people of all programming levels are there helping each other, and there is a recommended reading list pinned in the #programming section you might be interested in.
Evaluating the effects ensures that the planner dynamically adjusts the sequence of actions based on the current state and the satisfaction of required effects. By removing any effects that have already been satisfied, either directly or indirectly through performing an action, the planner avoids redundant actions and focuses only on unmet requirements. This optimization helps in efficiently progressing towards the goal.
@@git-amendYeah, but what you meant is happening in the planner and in the planning functions, and I asked about evaluate in the Action class, in the update function, at the button of the function, in the loop of the effect, In the section you comment with "Apply effects". What is the purpose of evaluating? if it only meant to return a bool and nothing else, it isn't changing any value, it only returning a bool.
@@songerk7102 The Evaluate method executes whatever callback effect methods belongs to that Action. It could be anything you want, even a complex method that changes state.
Hey man, thanks for this great post! I have a question regarding the "AgentAction" script, specificly the "Update" function. In the script you evaluate the effects on the action when it is complete. My question, WHY would this be needed? Is this to ensure that, if the evaluate function would store state somehow, it would update that state? (see example) Inside the GoapAgent: "factory.AddBelief(new Belief("CakeTasteGood", () => { CakeSlice pieceOfCake = fridge.cake.TakeAPiece(); return pieceOfCake.IsTasteGood; }" With: "class Cake { private Stack _slices = new (8); public CakeSlice TakeAPiece() => _slice.Pop(); }" Keep up the good work!
For anyone wanting to build better AI systems in their projects, this video is for you! I hope this video will give you the insights you need to implement GOAP in your project! 😁
Awesome! thanks
You're welcome!
afaik utility ai works a little bit differently, will you make a video to cover that topic?
@@Yaroslav-br6xn They did! ruclips.net/video/S4oyqrsU2WU/видео.html
Honey wake up, git-amend posted another programming video
Awesome
My God, man...
Always so advanced, sometimes very complex and yet easy to understand.
I'm constantly in awe watching your videos.
Where have you been all theese years, man? I missed you and didn't even know it...
This channel is a gold mine for Unity devs. Please, never stop!
Thanks a lot, I really appreciate the kind words! Lots more to come!
Unity should award you.. For making The best advance tutorials on advance programming.
Haha maybe one day! Thanks!
Actually my first comment for the decades of watching different Unity/dev/code videos. I’m a game designer in the core but learnt Unity up to middle+ level for eventual making pet projects.
Your work and videos are for sure invaluable and grant a lot of specific details to maintain well-architected projects. Thanks ;)
Thanks for sharing! Great to receive your first comment!
I knew this was going to be an awesome implementation of GOAP, but it's awesome how you incorporated Factory, Strategy and Injection patterns into this... I'm currently doing some dialogue editor tools and would love to see you create some editor tools for this. Everything you do is impressive!
Glad you liked it! And editor tool might make a great follow up, I'll give it a bit of thought!
I can't believe that you actually took the time to go through GOAP! With your teaching style, it makes so much more sense and it's made it so easy! You've actually given me some ideas on the implementation, I'll have to experiment with more. Thank you again
Glad to hear that! Always nice to hear someone is going to take what they see here and run with it!
@@git-amend I'm working on a game with enemies that require the complexity of the intelligence behind GOAP but once I have something to show off, I'll make a video to show you what I've made.
@@silchasruin4487 Excellent, can't wait!
This is a great tutorial. Thanks for making it!
I'm definitely not at the level where I understand fully how everything that you implemented worked together to create this kind of a system, but it's good to know of this method of programming AI. I'll definitely be re-watching when I've improved my knowledge and skills some more to really get a good understanding! Thanks again! 😄
Thanks for the comment, glad to hear that!
Great tutorial! Thanks for mentioning my project
Thank you for the kind words! It's truly an honor to receive feedback from the creator of such an amazing project. Your project is fantastic, and I'm glad to share it with others. Looking forward to seeing how you continue to develop it!
I remember when I first played FEAR. The AI surprised me with how dynamic they were.
Yeah, it's really something else. I want all my enemies to give that feeling!
Man, who are you? All your videos are so advanced and clean. Have you been working as a lead systems engineer at Rockstar or someting? 😅
Well that's a high compliment! I am an engineer, but not at Rockstar... will talk about it one day when I can! 😁
@@git-amend Thank you so much for your videos! They open up a whole new dimension in game programming for me.
@@martin.m.kloeckener You're welcome! I'm glad to hear it.
thank you so much!
A great deep dive into GOAP!
You're most welcome!
Been aware of GOAP for a while now but never looked into it very much. This seems like such a useful method for creating intelligent and modular AI. Will definintely have to give it a try. Keep up the good work.
Great to hear! Thanks for the comment!
Bro for someone not good at coding and thinking of building complex things, your videos are the perfect thing. I not only learn game development but also C#. Thank you so much for the time and efforts you put in the making of these tutorials l.
I appreciate that!
nooo this is imposible, too good to be true.
so complex and yet so well explained, thanks for every piece of effort you put in your videos.
Thanks so much for the kind words! Glad you liked it!
I am 25 min in. Just started the DFS part. Lot of new concepts. As a self taught programming newb, it is a lot to take in at the same time as learning about goap. Patterns, lamba expressions, delegates, node search algorithms. My head is hurting but I like it! I appreciate you covering these more advanced topics compared to most other channels. Thanks
Glad to hear it! This is definitely one of the longer more advanced vids on the channel!
Thank you for this great video!
fully implemented in my game.
Would love to see more long videos like this!
have a good one
Incredible video, one of the best on GOAP ive seen
Thanks a lot 😊
Thank you, really appreciate your work and the effort you put into these videos!
My pleasure! Thanks!
You're killin it man. Great stuff. This video was fascinating. Loved the suggestions at the end. Would be interesting to see how you turn this into something more editable for the designers to use and so new beliefs/goals/etc wouldn't be created in code but rather in the editor. Keep up the great work, you're doing so well.
Thanks! Not a bad idea, I wonder if I could fit that into a video…
My position is senior but i still love your videos. Can't wait to watch this later looks awesome!
Hope you enjoy it!
The goat is back with the goap
I like that one!
your videos are so good, am saving them to my GDC playlist.
Awesome, thank you!
A 45 min git-amend video! Oh boy I'm gonna need another cup of coffee and a notepad!
I’m on coffee #1 now too! Cheers!
Your tutorials are very good: clear, concise, well-reasoned. I would like to see the font size bigger especially for mobile. Appreciate your work :)
Thanks for the comment. Not sure I can go much bigger on the font size, but maybe in some areas. Cheers!
Thank you for making this! I’ll be needing something like this in the near future.
Awesome, I hope it helps you with your project(s)!
Programming question (around 4:20)
Why use Func condition instead of just bool condition? I can't seem to find an answer online anywhere. It seems to me like they essentially do the same thing...? Lambda notation in general is crazy to me 😅
Using Func instead of a bool allows for dynamic, lazy evaluation of conditions, enabling them to be checked in real-time as game state changes, rather than at a single point in time. This approach is particularly useful in scenarios like state machines or conditional updates, where the condition depends on current game state or player actions. By using Func, you can pass a lambda or delegate that is evaluated at the time it is needed.
Thanks for the great tutorial.
Is there any chance of this being expanded to show us more low-medium level devs how to use scriptable objects and / or Node Canvas?
I might do some videos on those topics in the future. Node Canvas might be a tough one because it's expensive and not everyone has access to it, but maybe we could build something similar from scratch.
Regarding the gFactory, I can't recall exactly what I did in the video. You can put a GOAP Factory component on a GameObject and provide a reference through a public field if you don't want to use Injection or another method of inversion of control.
It would be cool to see a video on creating a blackboard!
Yes, for sure. I’ll probably do that before we explore behaviour trees
Thanks again, I would really like to see an advanced interaction system which there is no tutorial about that. For example dual-interactions that both effect player and the object, Interaction that need require different parameters, like one is inventory, and other is simple transform. Like a portal and chest. making them de-coupled with interfaces but with different params
Good idea, I'll write that one down. Thanks!
Always a pleasure watching your videos. I learn something every single time.
Awesome, thank you! Love to hear that!
Always information dense! Loved all 45 minutes
Awesome, thank you!
Thank you for the great video. I am actually working on my own AI system right now for a platformer game. I am unsure if it makes sense for my needs to add this type of logic, but it is cool regardless.
Right on, maybe it will give you some ideas!
Really great tutorial 👍
Thank you! Cheers!
You should make a short video on the diagrams you make - they’re always so clear. I can’t seem to make anything nearly as neat lol
Good idea! I’ll try to squeeze that in!
Hey, great work, I m happy to see an work like this. I would propose that, if you have time, you could try using Utility-Based Planning. Then community can compare both approaches, maybe even try a hybrid algorithm 😁
Thanks! Yes, a few people have requested a video about Utility AI. I've added it to my TODO list!
Nice tutorial, thanks a lot! How about you make a video about parkour system (climbing, overcoming obstacles and so on) or procedural 3D level generation?
Thanks. I'll take note of those ideas!
@Git-amend So far I am really enjoying the video. Where is the CountdownTimer class coming from?
Thanks! There's a link to all the code, including utilities and extension methods in the description.
nice, can you do Facepunch transport for netcode for game objects, its steams API c# wrapper .
Hmm that’s an interesting idea! I’ll give that some thought!
@@git-amend Please Do, Garry Newman is my God. his Transport is For everyone! as well i can only find a couple videos on how to implement it, so there is a spot there for you. (Edit: Steam actually tells you to use the Facepunch transport if you are using unity)
@@damonfedorick Took a quick look at github.com/Facepunch/Facepunch.Steamworks very interesting stuff. I'll put this on my list.
@@git-amend Nice.
Incredible tutorial - very detailed, explained clearly, and set at a great pace.
What color theme are you using in your code editor? It's perfect.
Thank you! The theme is just Rider's default, I'm pretty sure!
another awesome video!
Glad you enjoyed it!
Great stuff, as always!
Do you intent to look into HTN in the future?
Comparing multiple AI planning algorithms could prove to be very interesting.
Thank you! I hadn't really considered a video on HTN until I read your comment. Maybe that's a good one for the future! Cheers!
You mention updating this to use scriptable objects. Can you give an overview of what that would look like. I've been trying to do that myself and want to compare notes. Full disclosure, I've been failing to think of what would break off into SOs.
Well, it's a bit much to describe in a YT comment, but essentially the Scriptable Objects would be flyweights that have their own factory method which creates actual Actions, Beliefs and Goals you can use when starting the system. This way you can setup a nice editor tool that will allow you to configure all the setup in Unity using SOs and when the game starts you run some logic that puts it all together into something useable in the system by calling all the factory methods you need to get C# representations for the live system.
Now this is what I subscribed for!
Right on, hope you like it!
Thank you!
You're welcome!
As far as I am concerned, AI in Dwarf Fortress is designed in such way, and the devs even add short/long term memory system to the agent.
I like that idea. Along those lines, I've been also thinking about a 'credibility' score... so the longer it's been since an agent verified something was true, the less true it might become.
what Unity packages did you use? would love to download the one where it puts reflections on the editor to display the current actions and stats!
Just a custom script, no Unity packages - github.com/adammyhre/Unity-GOAP/blob/master/Assets/_Project/Scripts/GOAP/Editor/GOAPAgentInspector.cs
Thank you for the advanced tutorial. I'm working on a psychological horror game set in a castle where players solve puzzles and hide from enemies. I'm unsure about which type of enemy AI would be best suited for this game. The enemy should be able to search for the player within the castle. Additionally, I'm undecided whether to use a navmesh or A* pathfinding. Any advice on this would be greatly appreciated❤❤ .
If you don't need the full power of GOAP, you might want to consider behavior trees. They offer a balance between the adaptability of GOAP and the clarity of state machines, allowing for complex behaviors like searching and patrolling to be broken down into manageable tasks. This modular approach can make your AI's decision-making processes more nuanced and unpredictable, enhancing the suspense and horror elements. Regarding pathfinding, I would first try the nav mesh approach since it's already integrated with Unity, especially if you need a nav mesh already for the player. If you need more customization, then look into A*. The tool I mentioned in the video is excellent.
@@git-amend Big Thx ❤️❤️❤️❤️❤️❤️
This is actually really interesting setup, I do have a question and havent really looked to much into GOAP. How would this handle dynamic goals, for example: Heal Friendly Target.
But to heal this target we need to have a specific item. Do we just go and create all the actions for all the items? Do we do a Dynamic Action of sort that is UseItem , and create it on the fly on the plan? That means that now we have a ton of other actions to create - assuming a action factory exists for them for the character - , for example (findItemA, PickItemA) etc, that are derived from the state, is this the approach on this sort of systems?
You're on the right track. Generally speaking you try to build goals in such a way that they are as loose as possible. Without diving into a ton of detail, instead of an Action that is Use Health potion, you have an Action that is either Use Item that implements IHeal interface or Use Item that has an IHealStrategy, and then you aren't programming for every eventuality, and the Agent has options.
Great guide as always. Do you also use Unreal Engine or you are planning to continue your journey in Unity? What are your thought about UE? I have been using Unity +6 years and even though i feel i am a good developer myself but i still cant tell myself a game developer since all the games i have played from childhood was developed in c++. I feel like real game devs are on c++ side bu its a corrupted thought i know. :D Still, i want to continue my journey in UE side to develop high-end games or with c++. Even though i work as a full time game developer in unity side, i would love to develop in UE too.
It might be tempting to attach skill level to a particular language, but the reality is that you will reach a point in your game dev (or engineering) career where you become language agnostic. For example, at work this week I wrote code in 4 different programming languages. The syntax and some particularities of each language are different, but the best practices, patterns and principles of engineering remain the same.
I have used Unreal, but I enjoy using Unity more, and the channel will for the most part remain a C#/Unity channel for the future as far as I can tell. I think if you have been using C# for 6 years, you will not have a difficult time using C++ or Unreal.
Incredible video
Thank you so much!
Do you have a video on your animation controller?
I don’t, but not a bad idea for a video. Thanks!
Great Video! Can we get a utility ai on your to do list too?
Sure, I’ll write that down. Anything in particular?
@@git-amend Nothing in particular, GMTK did a good overview on The Sims (ruclips.net/video/9gf2MT-IOsg/видео.html) and I'd love to see your unity take on the system.
@@NathanSL11 Nice, I'll watch that today and give it some thought!
Would it make more sense to have the belief's location be a nullable Vector3 since Vector3.zero could be a potentially valid location for something to occur?
Using a nullable Vector3 for indicating an uninitialized position is a valid solution if that was a concern you had. Another approach might be to use the Null Object pattern and define a distinct 'NullLocation' object to be a clear, type-safe alternative to signify the absence of a position without resorting to nulls. Then all locations could be represented by a specific type, and potentially include even more information.
Could you do a video on HTN which is similar to GOAP but apparently more superior these days.
Great suggestion, I'll write that one down. Thanks!
Legend!
Thanks for watching!
Thank you! But I think my brain overheated. I'll need some time to cram all of this into my head before I can play around with it.
You got this!
Hi, tell me pls how do you move the character? Where is the movement logic?
You can move the character any way you want to. This video just uses simple NavMeshAgents with a small script for point and click.
@@git-amend aaaaaaah, I see.
Thank you Adam, you're the best
When do you suggest to use goap or normal state machine system
I would favor GOAP for complex, dynamic environments where adaptive AI behavior is required, and choose state machines for simpler contexts with predictable, easily manageable states for clearer behavior logic.
Where is the walk animation being triggered in the code? Thanks
It's just a simple blend tree based on the unit's velocity.
github.com/adammyhre/Unity-GOAP/tree/master/Assets/_Project/Scripts/Animation
cool~~
Hope ya like it!
Would such a system be appropriate for a game director (think L4D's game director) i.e. an AI overlord that tries to shape the experience of the player(s), or would you use something different? If something different, could you recommend a topic? Even if you haven't covered it, for my own research.
Thank you.
For a complex and dynamic system like L4D's Game Director, GOAP can be a good choice due to its flexibility and ability to handle complex decision-making processes. However, Utility AI might be a more practical choice if you are looking for a balance between complexity and performance. Utility systems can provide a dynamic and responsive AI without the overhead of GOAP. This will be the topic of a future video.
Hi! Hope you are doing good, i have little bit issue with my self i really love your content but things always goes up from head i really want to get all of this how i can do that? i know the OOp data structures but in real life i really don't follow as much because of small dead lines we create games just for 1 or 2 weeks............ i really want to start can you guide me pls..................your content is love.....
Just keep watching, and try to learn something new every day! And make some small games!
With GOAP, how would you implement an AI taking damage and triggering a damaged animation? During this damage state, they should not be able to perform any actions. Do you complement GOAP with a state machine and have the two systems communicate? If so, what's a clean way for GOAP to determine which actions are available per state? Honestly that sounds messy. Or would you use only GOAP, with a belief such as 'isDamaged,' where the corresponding action would trigger the damaged animation? Or would you approach it completely different? Thanks!
I think you have the right idea. I would probably build a system outside of GOAP that registers hits and plays animations but can set GOAP parameters. Then I would add a "IsAbleToMove" belief that is a precondition to all actions wanting to move the character. While the taking damage animation is playing, set that belief to false and reevaluate the plan at the beginning and end of the animation. This would still allow the character to call for help for example. Which could then trigger other enemies to swarm the position.
How ur not serialized objects are serialized? Unity 2023?
That depends on which objects you mean, but I do use Odin Serializer.
A very minor thing, 6:03 but you don't want to be using distance for in range comparisons like this where you don't need to know the exact distance, just it is within the range, since it is needlessly costly calculation that includes an expensive squareroot operation that isn't needed. You can use the much faster square magnitude for the in range comparison
ECS tutorial pls!
Yes, one of these days. Do you have any ECS pain points, or just in general?
@@git-amend in general, I would say. There is no “horizontal” understanding of architecture, namely the beginning of the project. I studied a lot of theory and text and videos, saw examples of use (leoess, etc.). but at the beginning of planning my own architecture for a large and small project, there is simply no starting point in my head. It’s a bit of a strange feeling after I started to understand OOP well. :)
@@morphidevtalk I know what you mean. I'll keep that in mind for when I tackle that subject in the future, thanks for the comment.
@@git-amend There's quite a lot of things that can be discussed that feel glossed over, or is outdated since most tutorial videos are based on version 0.51.
Here are some ECS videos I'd like to see--
- How to understand ECS Physics collisions, and how to get the same behavior as OnCollision/OnTrigger Enter/Stay/Exit in an ECS context
- How to use Animation Curves with ECS
- When to use BlobAssets versus NativeArrays and NativeLists in ECS
- How to use ScriptableObjects with ECS
- How to communicate between ECS and GameObjects (Systembase, events, etc)
- How to Bake a proper GameObject heirarchy to ECS, and how to interpret/visualize it in an ECS context
I know some of these topics are intermingled with each other, but figured I'd state them anyways.
I could go on, but ECS just feels half-baked and half-explained.
one question boss, how the hell we understand whats happing please help, i want to be like you, programming wise.
One step at a time, I suppose. You might want to join others on Discord (link in description) - people of all programming levels are there helping each other, and there is a recommended reading list pinned in the #programming section you might be interested in.
@@git-amend ty so much for this response
Amazing video but is this guys voice AI generated?
It's my real voice.
Can someone explain to me please, why when the action is complete, it evaluate all effects? for what purpose?
Evaluating the effects ensures that the planner dynamically adjusts the sequence of actions based on the current state and the satisfaction of required effects. By removing any effects that have already been satisfied, either directly or indirectly through performing an action, the planner avoids redundant actions and focuses only on unmet requirements. This optimization helps in efficiently progressing towards the goal.
@@git-amendYeah, but what you meant is happening in the planner and in the planning functions, and I asked about evaluate in the Action class, in the update function, at the button of the function, in the loop of the effect, In the section you comment with "Apply effects".
What is the purpose of evaluating? if it only meant to return a bool and nothing else, it isn't changing any value, it only returning a bool.
@@songerk7102 The Evaluate method executes whatever callback effect methods belongs to that Action. It could be anything you want, even a complex method that changes state.
blurp
do you even GOAP BRO
👆
second)
Thanks for the algorithm bump! lol
first
Haha nice!
Where is the game dev road map video
In the queue with a lot of other good ideas. Unfortunately I only have time to make one video per week.
Hey man, thanks for this great post!
I have a question regarding the "AgentAction" script, specificly the "Update" function.
In the script you evaluate the effects on the action when it is complete.
My question, WHY would this be needed?
Is this to ensure that, if the evaluate function would store state somehow, it would update that state? (see example)
Inside the GoapAgent:
"factory.AddBelief(new Belief("CakeTasteGood", () => {
CakeSlice pieceOfCake = fridge.cake.TakeAPiece();
return pieceOfCake.IsTasteGood;
}"
With:
"class Cake {
private Stack _slices = new (8);
public CakeSlice TakeAPiece() => _slice.Pop();
}"
Keep up the good work!