Culinary Crunch

Introduction

Culinary Crunch was initially intended as a submission for a small game jam with the theme „Under Pressure“.

Early on, I decided to take my time and explore systems new to me, like AI, using behavior trees instead of adhering to the game jam time frame.
Even though I never turned this project into a complete game, there are still a few aspects of it I would like to highlight.

Game Concept

My idea for this game was to create a stressful cooking simulator inspired by games like Overcooked, in which you manage a whole restaurant by yourself.

Customers constantly enter the restaurant and take their place in a queue. You must take their orders, serve them food, and wait for them to eat so they can pay and leave the restaurant.

If orders get messed up or take too long, the customer will grow discontent, decreasing their amount paid and eventually forcing you to reimburse them.

I went for an isometric perspective and resorted to a diner asset pack from the marketplace to build my environment.

Inventory System

The first thing I implemented was the inventory system. It manages items between various kitchen appliances, the player, and the customers.

Each item is represented by the structure S_Item, which comprises all attributes that define an item, such as its name, ID, icon, class reference, etc.

I made a data table with one entry of the type S_Item for each item and laid out all relevant information so I could later access it in my inventory logic. The hot bar, for example, is just an array with five S_Item entries. It starts out empty, and whenever the player attains or loses an item, the corresponding array entry is overridden with the new item data from the data table.

I chose to limit the hot bar to five items so the player has to consider their inventory management and pathing more carefully, which adds to the intended stressful theme.

Customer Behavior

Next, I began researching AI and behavior trees in Unreal Engine. There was much to learn, and it is obviously a topic of immense depth, but it was surprisingly intuitive to grasp.

The customer character's behavior tree consists of multiple branches corresponding to a behavior, like „Enter Restaurant“ or „Queue Up“, which consist of even more branches themselves.

These subbranches determine the actual steps that a behavior consists of and can either call another behavior once it is completed or wait for an outside event. A good example of this is the „Queue Up“ behavior. It consists of checking if another customer is in line, which is tracked using an array.
Once the customer's number in line is determined, it gets multiplied with an offset from the front of the line to calculate the target location they should go to.

The player can now interact with the customer at the front of the line, which makes their order pop up and then initiates their next behavior, „Find seat“.

All the other customers who were not at the front of the line are still in the „Queue Up“-behavior and now detect an empty space, making them move up in line.

Wall Opacity Blending

The last aspect I would like to discuss is an issue I faced; if the player went behind a wall, their character became obscured, and they could not see what was happening anymore.

The fix was simple. I made an actor made up of a collision box and an array of meshes to hide. This actor was placed in every spot where this issue would occur, and the respective problematic wall meshes were put into the array.

Whenever a player entered the collision box, the opacity of all meshes in the array would get lowered, allowing the player to see again.

This hand-placed approach saved time over developing an automatic solution since this environment is very small.
It also allowed me to retain precise creative control over what got hidden by keeping certain meshes at full opacity, like the clock or the menu on the wall.

Conclusion

As mentioned before, I never turned this project into a full game, but I am still very content with the insights I gained into various topics I had yet to explore.

I am sure that I will work on more games using AI and behavior trees, as this is a very interesting topic with many applications, such as enemy and companion design.