Should I bother to learn GOAP scripts myself, or just go straight to using CrashKonijn's asset store item?

(I tried putting this in Getting Started, but I kept getting an error message about tags)

Hello pros! I need a bit of advice on what I’m focusing on right now. I’ve finished the three basic pathways and made some Dumb Learning Games, having a blast even when I’ve been frustrated by learning something new. I’m working on a DLG for AI now where there is a small “village” of people who I want to use GOAP to do things while enemies use behavior trees to thwart them. The problem is that while I did manage to figure out behavior trees (three sequencers and two stand-alone leaves!) and made my enemies work smoothly with them, I’m now struggling with the GOAP aka Goal Driven Behavior project.

Penny de Byl is great, and I feel like I’ve been picking up more and more over the three times I’ve watched and typed through the project, but when I get lost and switch gears for a different perspective and take a look at something like Llama Academy’s GOAP video where he uses CrashKonkin’s system, I feel like it is a different thing all together. I don’t know if the way he codes is just really advanced and way over my head, or if I’m missing a fundamental that’s keeping GOAP opaque to me.

What do most of you do? Do you go with something pre-built and not worry about understanding what’s under the hood? Or do you plow through and figure out how something works before you start to use a package? I don’t have a ton of study time, so I want to make the most of what I do have.

Thank you!

Hi there!

If time is limited, I would not recommend building your own system. At least nog for something as complex as GOAP, if your goal is to actually build a game with it.

For any AI algorithm that you use to build a game one of the most import parts is to get insights into why an AI is doing something. The more complex the algorithm, the more complex it is to understand and the more tools you need to get a grasp on why your AI is doing what.

To give an idea, GOAP essentially consists of 2 steps/algorithms:

  • Building the graph (based on their conditions and effects)
  • Resolving the graph (finding the best action towards a goal)

These algorithms on their own are not that complex at all, in fact GOAP v2 does this in under 300 lines of code in the GraphBuilder and GraphResolverJob.

All the other tens of thousands lines of code are all to support these two algorithms. To help you setup the configuration, get insight into why an AI is doing what and to actually run your actions as well.

Compared to the tutorial; both implementations use the same core idea’s for the GOAP algorithm, but do have very different implementations. Things are a lot more abstract in my implementation but they also allow a user to build their own implementations to replace any part of my system. This allows for greater flexibility for a user, but also comes with greater system complexity.

As for using any AI algorithm in general, but especially true for GOAP, it’s very important that you have a good understanding of the theory behind the algorithm and it’s concepts in order to use any algorithm. In that regard I would totally recommend for anyone to at least build a basic implementation of any algorithm, so you truly understand it.

In any case, since it’s not your job and you’re learning how to make game; just do what you think is most fun to do! Personally I was building a game for which I started building GOAP v2, and I never actually got back to working on that game.

If you’d like to learn more about GOAP, I made a collection of YouTube video’s about GOAP that I found very helpful.

It’s worth learning so can you scale without any extra brain effort later. I loved every minute of this 8h course by Penny de Byl - a great Instructor and just fun.

Apologies for resurrecting an ancient thread, but work and real life ate up almost a year of time. I wanted to say that I appreciate the answer and the advice. I’m finally back to a place where I can have hobbies again, so I will be putting your words into action! Thanks to the tutorials, I feel like I do understand how graphs are made and the process of node selection and the creation of paths from start to goal, so I think I will move over to something that is already made and ready to go.

Thanks again. :grinning_face: