Some GOAP for the actors

I have once again tired of my old projects. I am more experienced and have found new toys that I wanted to play with. This time I'm going for a smaller scope. I have ended up improving performance in my engine, a task that will never end and is easy to really take a deep dive into. Multithreading, AI, physics, etc.

So, what's the new toy? It's GOAP. Goal oriented action planning. It's a way of determining the actions of your NPC:s, what do to next and how to achieve that. If the NPC is hungry = 1, the action which resolves this is "Eat", because the effect it has is hungry = 0. But "Eat", has a prerequisite which is HasFood = 1, so you will need to aquire some food first. You don't have any money and you're not close to a store which sells food.

By looking up all this data and compiling a state you can detemine what actions are needed and in what order they need to be completed to reach the goal hungry = 0. This lookup is done with A*. And you'll get a chain like this. Go to job -> Work -> Go to store -> Buy food -> Eat.

I plan on making all levels procedurally generated. I love taking on the same challange in a different form, but with all accumulated experience to guide me in my next playthough. To slowly get better and learn all the tricks to gain the upper hand.