top of page
Polka dots fade.png
Start.png

TOFU TURRETS

School project

Overview

This was a project done by myself and another designer during my 1st year as an undergraduate in Digipen Institute of Technology. Since this project was primarily focused on system design, I helped design the upgrade and event systems, in addition to the enemy spawn system and turret modifiers. This is a case study of how these systems were designed, with an emphasis on being highly scalable and easily changeable to accommodate for different scenarios.

In Tofu Turrets, you play as 1 of 3 tofus and try to survive the hordes of cooked tofu coming your way! Dash around haphazardly-placed food on the dinner table and avoid the incoming cooked tofu, then take the chance to blast as many of them with your trusty turrets. Each defeated enemy is a step towards getting a new turret! Survive every wave and you will face off with the head honcho of all tofu, defeat him to win the game!

Design process

There were a few different systems that needed to be designed, namely:

  • Upgrade System

  • Turret Mods

  • Enemy Spawns

  • Non-Playable Characters (NPCs)

upgrade system

In Tofu Turrets, the main way the player progresses in the game is by collecting soy that drop from defeated enemies, and using that as currency to upgrade their turrets.

The player can pick up these turrets, but while holding any turret, the player will be unable to dash. The player can also throw turrets in the direction of their mouse cursor when they do not want to hold on to it any longer. 
 

A new turret is given every time a certain threshold of total soy collected has been reached, for a total of up to 6 turrets. The Chef NPC then, is where the bulk of the upgrade system lies.

Near Chef.png

Here, the player will be able to choose whether they want to buy an upgrade for their turret, or restore 1 heart using soy.

The player can only choose to upgrade their turret if they are already holding a turret that has not reached its max capacity of modifiers. 

Invalid Chef.png
Upgrade.png

If the player chooses to upgrade their turret, they can choose 1 of 3 randomly chosen modifiers to equip onto the turret they are currently carrying.

Upon choosing a modifier, it is immediately equipped onto the turret permanently, and the Chef NPC will disappear. There can be more than one Chef NPC at any given time, so the player can just decide to bring their turret to the closest Chef NPC if they want to.

NPC Arrow.png

If the player chooses to restore their health instead of upgrade their held turret, they will regain health immediately and the Chef NPC will disappear.

TURRET MODS

In Tofu Turrets, the main way the player progresses in the game is by collecting soy that drop from defeated enemies, and using that as currency to upgrade their turrets. The player can pick up these turrets, but while holding any turret, the player will be unable to dash. The player can also throw turrets in the direction of their mouse cursor and upon landing, turrets will start shooting at the closest enemy within their range.


A new turret is given every time a certain threshold of total soy collected has been reached, for a total of up to 6 turrets.

Multiple Turrets.png

Each turret starts off with the same base stats, but the player can pick them up and bring them to the Chef NPC to equip them with up to 3 modifiers each. These modifiers are carefully designed such that they are scalable and can handle different types of parameters.

The general format they follow is as such:
EFFECT1TYPE#NUMBER@EFFECT2TYPE#NUMBER... 

where each modifier starts with 1 singular effect type, followed by a number, and more effect types can be
added to the back of the chain.

The different effect types are as listed:

  • Damage

  • Fire Rate

  • Magazine

  • Reload

  • Longshot

  • Knockback

  • Spread

  • Piercing Shot (Rare)

  • Multishot (Rare)

  • Burn (Rare)

  • Explosive (Rare)

image.png

This system allows for an exceedingly easy way for designers to manipulate the values as needed, and also facilitates a non-intrusive way of introducing different parameters, as long as they follow the same format of existing ones.
When designing the possible mod effects, it was imperative to take into account the weightage each effect has in comparison to the other modifiers, as there are some effects that will benefit the player greatly. Generally, effects that added abilities to the player’s base turrets were given a higher weightage as compared to effects that enhanced the base turrets’ abilities. 


For example, a modifier effect that increases the turret’s bullet damage will be more commonly found in modifiers, while an effect that allows for bullets to apply burn damage will be more scarce.

With this system, a non-exhaustive list of different modifiers can be made, using different combinations of effect types where needed, or introducing new effect types as necessary.

image.png

Lastly, when making modifiers, the effects had to be balanced such that the benefits do not come freely without some disadvantages. To convey this accurately and succinctly to the player, we also colour-coded the text to be green for positive effects and red for negative. We followed the rule of “higher number = green” and “lower number = red” for the most part. However, there is an edge case where some effects are actually positive if they are of a lower number.

 

For example, the higher the spread of the bullet, the less accurate it is, so as the number goes higher, it should turn red.
To account for such cases, we added an ‘isFlipped’ check which will allow designers to indicate if the colours shown should be the opposite of the general logic used.

ENEMY SPAWNS

What good are weapons without enemies to fight against? In order to make Tofu Turrets feel satisfying and fun, we had to design an enemy wave system.


Essentially, this system consists of different wave IDs, of which one enemy type will spawn. The parameters that this system takes in are as follows:

image.png

With these parameters, designers have a huge amount of creative control over what sort of enemy wave they would like to design, how many enemies to spawn each interval, and how often enemies spawn in a single wave.
 

Lastly, spawn caps were also implemented, which would stop enemies in a particular wave from spawning anymore once a certain number was reached. For example, wave A spawns an enemy every 5 seconds, but caps out at 10 enemies. This means that after 50 seconds, if the player has not cleared all 10 enemies that have spawned during the duration of the wave, then no more enemies from the same wave can be spawned.

Using this data, we also balanced the waves such that the increase in soy is an exponential curve, and the damage per second (DPS) needed for each turret is gradually increasing. Generally, we balanced the wave difficulty based on the number of ideal turrets the player should have gotten at the end of the wave, so that we can accurately judge the minimum firepower the player must have had by the time they get to the wave.

 

We then based our decisions for how many enemies to spawn based off of this minimum gauge, making sure that weaker players will not find it too challenging, while rewarding players who actively spend their soy on upgrades.

image.png

This makes it a lot easier for our player to manage the enemy numbers, while also ensuring that the player does not get overwhelmed by unfair enemy numbers when they are already struggling to keep up.

NON-PLAYABLE CHARACTERS (NPCS)

There are 2 different types of NPCs the player can encounter – the Chef, and the Bartender.
These NPCs follow the same spawn system, where they spawn in set intervals until a maximum spawn capacity is reached. Once the maximum is reached, they stop spawning until the player brings the count down by interacting with them.


The Chef is an NPC that the player can go to for upgrading their currently held turret or restoring some health using soy, while the Bartender functions as a mystery box and triggers a different event each time the player speaks to it.


Both the Bartender and the Chef use the same underlying systems, they are just skinned differently and serve slightly different purposes.

bartender

There are no prerequisites needed to speak to the Bartender, the player can approach it at any time whenever it appears. No soy is needed, and no turrets need to be held.


Speaking to the Bartender will prompt an event to trigger, in which the player would have to choose 1 of multiple options. These events are filled with options that could either strengthen the player, weaken the player, or more commonly, offer some sort of trade-off in exchange for a benefit.


Since it is possible for the player to encounter multiple events in a single playthrough, the events had to be designed in a manner that allowed for many different variations of events to be made.

This was done by using many parameters, which allowed for a high level of customizability.

image.png
image.png
image.png

Each event has its own contents, but the recipe remains the same for the most part. An event always begins with a simple dialogue from the Bartender. After which, multiple options belonging to that specific event are displayed to the player.


Once the player has made their choice, the effects are immediate and the Bartender will disappear. This event is then removed from the pool of random events that could be triggered next time, so as to ensure that no events repeat. 

Bartender.png

That is, with the exception of one – the fallback event. It is highly possible that the player could encounter all the different events during one playthrough, due to the fact that this was a short game and did not really require hundreds of different events. To account for this possibility, a fallback event was created.

 

This event will only be played as the last resort when all other possible events have been exhausted. It is the only event that will repeat and only exists so that the player still has a reason to go the Bartender even after encountering all the different events. It also helps to avoid any edge cases where the player talks to the Bartender and there is no event available, so the player can’t do anything.

THE CHEF

The chef functions a lot like the Bartender, whereby the player can either choose to restore their health, or upgrade their currently-held turret with 1 of 3 modifiers available.

The main difference is that the Chef will always offer the heal option, and the player can only upgrade their turret if they are holding a turret when speaking to the Chef. It also costs soy (the currency) to heal or upgrade, so the player is encouraged to only speak to the Chef when they have enough soy to afford something, as even if the player does not decide to heal or upgrade, the Chef will disappear after being interacted with.


If the player chooses to upgrade their turret, they get to choose from 3 random modifiers and select 1 modifier to immediately equip onto their turret. This system is similar to how the Strange Tofu’s events work, where the modifiers generated are random. However, the Chef is much more forgiving and getting repeat modifiers are intended and possible, so the player can have a single turret with 3 modifiers of the exact same type if they wanted.

Chef.png

Once the player has made their choice, they will either restore health immediately, or immediately get their turret upgraded with the modifier they selected.

research

As Tofu Turrets is very reliant on the customization options for the turrets, the random events, as well as a good enemy wave design, I referenced a few games to help me out.

turret mods

It wasn’t very easy coming up with modifiers for the turrets, as they had to be fairly detailed and offer quite a variety of customization options. To achieve this, we researched the way Rounds did their modifiers, as we think they balanced out their benefits and disadvantages quite well, in a way that the player would have to think before choosing a modifier to use.

image.png

From here, we just tweaked some of the effects to suit the gameplay of Tofu Turrets better, as well as themed the modifiers after food to fit the theme of the game better.

enemy waves

When designing the enemy waves, we referenced 20 Minutes Till Dawn for its clever enemy wave patterns. The final system that we came up with was an improved variation of this existing system.


They had different waves, but each one only consisted of 1 enemy type, and the actual waves that would spawn and attack the player, were a group of multiple waves. This system was wonderful as it allowed for endless customization and possibilities when it comes to designing waves that feel different and unique enough, without having to completely rewrite the system.

image.png

Another alternative we considered was to design the enemy waves in a more deterministic manner, where each wave consists of a few different enemies. However, it is without a doubt that the way 20 Minutes Till Dawn did their enemy wave system was a lot more scalable and modular.

events

To assist with designing the different types of events and options, we looked to Slay the Spire for their Random Encounter mechanic. This is a node on the map that the player can visit, and will play a random event each time depending on the current Act the player is in. The choices offered in these events are very interesting, so I used them as reference when creating the event system. 

Since this was quite a daunting task, the first thing we did was to make a quick note of what the different types of events in Slay the Spire are, and then try to make a system that would allow me to create such events.

image.png

This proved to work well as we were then able to use this system to create suitable events for Tofu Turrets, and added on more parameters as needed. 

challenges

This was definitely a challenging project, as there are many systems at play and we had to ensure all of them were designed in a way that would support the core gameplay well.


Not only did we have to design these systems mostly from scratch, we also had to ensure that these systems would be scalable and can easily be added to in the future without having to modify the existing framework. Many revisions were needed and each time, more parameters were added so as to improve the customizability of the system.


A lot of data needed to be processed and conveyed to the player, so at some points, I was also conflicted about what exactly to display to the player, and what I don’t need to show the player. It turned out that this was something that could only be figured out gradually as the prototype came together, and after many playtest sessions. Getting to know what the players think about the information being shown to them helped me greatly in this regard.

RELICS

Tofu Turrets is intended to be played in multiple runs and not just a singular one, we had to make sure that it had some replayability that would keep the players going even after their first few runs.

We studied some roguelite/roguelike games, and decided on making a relic system, as well as a character unlock system as the player progresses.


The player can equip a single relic at the start of every run, and relics unlocked persist throughout runs.
However, relics weren’t just given for free, they had to be unlocked in very specific ways. 

Relic Unlocks.png

Now, the player had a goal to aim for whenever they did a run, and it wasn’t just a slog to get to the end of all the waves.

characters

In addition to relics, we also added a character unlock system. It functions the same as relics, whereby characters are only unlocked after reaching certain requirements.

 

Unlike relics however, different characters had different stats, and some of the relics can only be unlocked using these characters.

Tofu Loadout.png

There are many different stats that make up a character, such as their pickup range, interaction range, health, dash speed etc.
We did not want to overload the player with all these information, so we also added a way for the designer to choose exactly what stat they want to show to the player. We chose to show only the health, strength, and speed of each character, as these are more likely factors for the player to choose between different players.

TURRET MOD COSTS

Lastly, since this is a roguelite game where the player can customize their turrets, we had to make sure that customizing a turret at the beginning of the game isn’t going to cost the same as customizing a turret during mid-game or endgame.

image.png

To solve this, we went with the approach of increasing the price to upgrade any turret with modifiers based on the total number of modifiers the player has already bought, regardless of which turret they are on.

 

The costs scale logarithmically, rounded to the nearest multiple of 5.

conclusion

When all is said and done, this was a pretty challenging project to embark on, as there were so many different systems that had to work well with one another. That is the core essence of system design though, and I think that I managed to learn a lot more about making proper systems through this project. The skills that I have learnt will definitely come in handy in the future.

Here are a few screenshots from the game!

If you would like to try Tofu Turrets out for yourself, do visit the Itch.io page, it’s free! 

© 2024 Leong Aixian. Proudly created with Wix.com

bottom of page