This is pretty cool, idea for a resource management.
This could easily be a full game with a few more tweaks and polish.
Awesome Job!!
This is pretty cool, idea for a resource management.
This could easily be a full game with a few more tweaks and polish.
Awesome Job!!
I really liked this game! Very fun! Congratulations!
PS: Can you share your code? I'm very curious to know how you created this NPC AI.
Thank you!
So the customer AI is actually a chain of goal-oriented behaviors. The goals themselves are just transform references, and the behaviors started with an abstract class to define checking if a transform is the goal, what to do when the goal is reached, and what the next behavior is once the behavior is complete. The goal transforms are just sphere triggers that check if the collision is a customer. Every shelf in the store has one of these nodes, as well as the shop entrance, the queue positions, the start of the checkout, the end of the checkout, etc.
Also to note, the behaviors are all components that attach to the customer directly, and replace each other every time the next behavior is to start.
The simplest behaviors are the enter store and leave store behaviors. They simple get the store entrance transform, set the pathfinding target to its position and let it head there.
The actual shopping behavior is more of a loop. The customer gets a random amount of items to purchase and the behavior finds a random shelf node to go to. Once there, it "adds" the item to the cart, and if it hit the desired/possible number of items the behavior gets replaced with the queue behavior. If not, it keeps finding shelves to go to until it hits the desired/possible number of items (you might run out of items in the store and they have to end their shopping early)
Does that makes sense?
The pathfinding is just the A* algorithm with a grid.
And then I wrote a similar behavior system for the zombies, but more customizable as the zombies actually need to do something to be able to enter the store
Really creative take! I love the player agency in the game, so many horror games take it away for that feeling of helplessness. I did get the stuck customers bug before reading this. The shotgun is firing 3 rounds at once, so 15 shots is gone in 5. Also a way to check out customers yourself would have helped, as you can lock yourself out of the rest of the game if you aren't careful.
Leave a comment
Log in with itch.io to leave a comment.