Sponsored By

Dig in! Exploring Cooking Mechanics in Games
Every day this week, Game Developer is serving up a feast of interviews, deep dives, and more digging into the evolution of Cooking in video games.
Browse Latest ArticlesSubmit your Blog

Deep Dive: Cooking up a palatable food prep experience in Fruitbus

'It is the feeling of cooking that is important, not the preciseness of the simulation.'

Dennis Foose

June 4, 2024

10 Min Read
Key art for Fruitbus, showing animal characters in line for a colorful food truck
Images via Krillbite Studio.

Game Developer Deep Dives are an ongoing series with the goal of shedding light on specific design, art, or technical features within a video game in order to show how seemingly simple, fundamental design decisions aren’t really that simple at all.

Earlier installments cover topics such as creating asynchronous multiplayer in Solium Infernum, expanding accessibility for the PlayStation port of As Dusk Falls, and conquering hardware hurdles to port Kingdom Come: Deliverance to Switch.

In this edition, Krillbite Studio developer Dennis Foose tells us how they designed the cooking experience in Fruitbus and why the feeling of cooking was more important than perfectly simulating it.

Fruitbus is a cute culinary adventure set in an open world where taste is everything. Upgrade your trusty truck and visit a whole world of new destinations together. Discover fresh fruits and vegetables on each island of the Gustum archipelago, learn their customs, and cook meals that will make someone’s day.

But how does one actually capture an engaging snapshot of what cooking is, and what kinds of challenges and unforeseen complications show up in this neck of the woods? Come along on our journey of designing the cooking system for Fruitbus.

It sounds straightforward enough: Forage an apple, cut it into bite-sized chunks, and compose with some kind of intent in a bowl. If you are feeling adventurous, you might even add a sliced banana to the mix. Sprinkle a moving truck on top, and it’s bound to be a memorable experience.

First of all, who makes a salad with fruit? That’s as obscene as interchanging burger and sandwich.

Second of all, isn’t it a little early to foreshadow in the introduction?

On the menu for tonight are wildcards like:

Quantum Entanglement! Compositions! Processes! … and Apple Crouton Soup?

Fruit_Bus_Soria_Moria.png

Early Prototypes

In general, our philosophy was to try to rely as much on physics as we could to provide a solid layer of interactivity with the mechanics.

Cutting

Cutting

Frying

Frying

In the earlier stages of the game, we used the Dynamic Mesh Cutter plugin, which lets you dynamically cut up objects in runtime. We spliced that together with some basic knife skills and a bit of hand-holding.

Then, you fry the bits and chunks in the frying pan until their “cookedness” is above a certain threshold; push your luck, and it might get burnt.

“You want an apple and ginger smoothie?” Let me scrap together enough chunks and bits of apple and ginger to make sure I meet the demands imposed upon me by the recipe.

Smoothie

Stick your pile of chunks into a blender, and voila. You’ve filled a cup one-third of the way with some weird combination of liquids.

Individually any of these prototypes could pass as fun interactions or mechanics. Combine them and, fast-forward, the result is a messy kitchen with the floor full of various bits and chunks of fruit, mysterious liquids, and dubious amounts of state.

How would you represent the taste of a piece of Banana in code? What if the Banana had been fried, boiled and then blended into a liquid, then combined with an apple and ginger smoothie? How many pieces of Banana do you need to contribute to the taste of the dish? How much taste is added by being fried or being burnt? It gets messy and overwhelming quite fast, and it’s so arbitrarily granular.

The old me would have been confused, eagerly plotting out the course for some thin and long pasta shapes. For the new me, it’s simply a fried banana, apple, and ginger smoothie.

One of the great things that derived from the ideation and prototyping phase we had on Fruitbus was finding the correct level of zoom or the correct scope for the cooking simulation.

It is the feeling of cooking that is important, not the preciseness of the simulation. Thomas, our game director, called it “Hollywood Cooking.” Whenever I think of that phrase, my mouth curls into a grin.

Chili and Garlic Stirfry

Food Processing

A pivotal change in approach occurred in late 2022.

One day, Jonas and I conspired to the whiteboard, and some elements started appearing. The general process was mostly talking through the different steps food would have to take to end up in a dish that could be served and evaluated.

We thought up a dish that would touch upon as many of the previous systems as possible—a sort of minimum viable dish.

But before we get into that, it’s about time we go down a level.

a chart showing the precise steps of various foods and tools

Processes. Verbs that represent the transformations the Food go through. Like Blending or Liquefying.
Appliances are the objects that can perform the processes, like a Blender. It requires input to be enabled (Externally, through a button, for example), but after that it can be left to its own devices.
Tools are processes that can be triggered through Player interaction, like the Knife. It requires repeated input from the Player to perform any action. It also fetches the input directly instead of relying on external systems like an Appliance.
FoodObject is our representation of an edible object. A food object usually consists of Archetype, or the template: the gold standard banana, the pink-lady standard apple.
State is the representation of the Food Object (the apple is sliced and fried).
Visuals, the visual representation of the FoodObject in its current state.

Lettuce Fruitbus

Now, lettuce take a little detour into the anatomy of an Apple.

This is the data structure that represents food in Fruitbus, which defines the archetypical version of that fruit.

Using the apple as an example. It’s quite obvious that it Can Be Desired.

It also has a distinct taste, which makes it persist through a multitude of processes, deeming it as Absorbable.

And an apple is also Cuttable. Which means that when it is put to the knife, it can transform into a Sliced Apple, or a Fried Apple.

Cuttable

Cuttable

Code for defining what stages a Cuttable object can go through.

Fruitbus Apples

Let’s get back to the minimum viable dish. Here is the recipe to follow.

Apple Crouton Soup. Dice an apple and liquefy it. Bake bread. Cut off a slice. Dice that slice. Bake croutons. Boil the apple, and add the croutons.

Apple Crouton Soup Readable

gm05.gif

The example above touches upon something that I find kind of exciting! Equipped with a handful of processes, we can now create a wide variety of dishes. And most importantly, we can talk about new dishes without having to get bogged down with too much technical jargon. We even had the opportunity to talk through a dish in front of a bouquet of Norwegian developers at Spillkonvent 2023, and it seemed that they could follow along with our excessive blabbering about processes.

The work ahead of us now is polishing our selection of dishes, juicing it up, and gradually increasing the possibility space. It’s a matter of adding new processes and making the existing processes and dishes look and feel good.

Blender.gif

That’s a wrap! Or maybe just a tortilla. But in reality, we’re not off the hook just yet.

Interactions and Complications

Cooking in Fruitbus touches upon almost any other gameplay mechanic in the game; funnily enough, even driving the truck has implications for cooking.

Physicality is another tenet in the realm of Fruitbus. Everyone knows that moving vehicles combined with dynamic objects are bound to produce some funny bugs. We found out quite early on that we needed a way to simulate the interior of the Truck in a sterile environment.

Enter Quantum Entanglement*, an idea where we separate the simulation and the visuals. All objects that enter the Truck are entangled, which actually means that we have a physical clone of the object on a flat plane somewhere, where we can do all our physics without worrying about the Truck being flipped upside down or barrelling down the side of a volcano with malicious intent.

*Has nothing to do with actual quantum physics, we just crudely borrowed the concept and it sounds cool.

Chop Chop

Similar to the Quantum Entanglement, we run the composition simulations elsewhere and then apply them to the Object when things are stable. This approach is actually really cool because we just capture a specific snapshot of the simulation when things are stable and valid.

The Apples have, in fact, been composed neatly in the bowl in a place faraway place, where there are no external factors that can mess up the Physics interaction, and the result is then projected and applied onto the bowl in your Truck.

Honorable mentions that we don’t have the time to talk about in this round:
Interactions with the Characters, like holding the object in their hands.
Nesting Quantum Entanglement spaces.
Physical money in blenders.
A deeper dive into the Composition system

gm08.gif

gm06.gif

Conclusion

Something that I rediscovered while writing this article was that the current version of Food Processing would never have existed if we didn’t make the original scuffed prototypes to begin with. And I’m so thankful that we did.

One of the major reasons Food Processing ended up being a success for us was that we spent almost the same amount of time on pre-production and planning the rework as the time spent on the minimum viable product.

Something else that really worked out in our favor was the trust we got from the lead team. We had time to plan and make our ideas come to fruition. We also got challenged on our ideas, which forced us to solve more unknowns up front, which, in the end, produced a better result.

For Coders: If you have a feeling in the back of your mind that a certain mechanic or system is not performing as intended, have the confidence to challenge the status quo, make a plan, and pitch it to your decision-makers.

For Leads: The next time two (or any amount for that matter)of your coders cook up an idea to refurbish one of the core mechanics of the game, as long as it’s somewhat coherent it might be worth it to give them the time to prove their ideas. Poke some holes and challenge some of the concepts that seem loose, and you might end up with a version of that mechanic that could end up being a better fit for your game.

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like