Treasure Temptation

Introduction

This game was made within 48 hours as part of the 2023 GMTK game jam, which had the theme „Roles Reversed“ and is playable here.

The theme was exciting, and I saw many great entries that flipped the usual game conventions on their head.

My idea was to make an endless runner in the vein of Temple Run or Subway Surfer. The twist is that you do not collect coins but dodge them, as they are cursed.

Project Setup

The goal for this project was to finally finish a game and have people play it. Up to this point, I had only made prototypes and never published anything.

Only having 48 hours helped me pick a manageable project and develop it effectively.

Since I was working alone with a very limited amount of time, I decided to use art assets from the Unreal Engine marketplace.

The first thing I did was modify the Unreal Engine third-person template. I made the character automatically move forward and gave the player the ability to walk sideward, jump, sprint, and dodge roll.

Basic Level Generation

The next task was generating the level, as you need procedural generation for an ENDLESS runner.

The level consists of multiple tiles of a predetermined length, forming a corridor. At the start of the game, I spawn the player and a certain number of tiles.

When the player crosses from one tile to the next, an additional one is spawned at the end, and one tile behind them is removed off-screen. This way, the level is infinite, and there are never too many tiles loaded simultaneously.

Once the fundamental level generation was working, I created various tiles. Most of them can spawn an obstacle at a random point horizontally, which adds more variety.

At first, the next tile to be spawned was determined randomly. This was technically working, but it felt bad to dodge underneath a lowered wall only to fall into a lava pit that you could not see before - some rules needed to be set in place.

Advanced Level Generation

The solution I came up with involved making a data table that regulates how long it takes for a certain tile to become spawnable again after another specific tile is spawned.

In the data table, each row and column represents one type of tile. This way, I could determine that, for example, after a lowered wall, there had to be at least two other tiles before a lava pit could spawn again. The second part of this solution was maintaining a tile history that kept track of all current tiles.

The game determines which tiles are no longer spawnable based on the previously spawned tiles and the rule set from the data table. Once the whole history is checked, one of the remaining spawnable tiles is randomly selected.

I am really happy with how this system turned out, and it works great in practice - the game feels fairer, but there is still enough randomness so that no two runs are identical.

Additional Features

Next, I made the cursed coins follow players who got close and gave them a threatening green glow.
A health system was needed so that running into a coin or another obstacle would deal damage. I also put in health pickups that could spawn instead of a coin.

A pity timer regulates health pickup spawning; the probability that a coin is turned into a health pickup rises with each coin until it is guaranteed at the 50th coin.
This way, there are seldom multiple health pickups back-to-back, but you never go too long without the chance to gain health.

The last things I added were some extra systems, like high scores that are saved between sessions and the main and pause menu. I also added more polish, like sound effects and VFX, and finally submitted my project.

Feedback

Many people played my game and gave me feedback, which was great, as this was the first game I finished and published. Three points of feedback came up multiple times:

The first one was the difficulty. As I played the game repeatedly, I lost touch with how hard it felt to a beginner.
To adjust this, you could spawn in fewer coins, add more health pickups, or even slow down the player to increase reaction time.
For future projects, I let my friends and family test my games during development to get a fresh pair of eyes.

The second issue with my game was its performance. I have a strong computer, and the game ran fine for me, but having many moving lights at once affected weaker machines.

Lastly, the implementation of the theme “Roles Reversed” was brought up. While avoiding coins instead of collecting them fit the theme, there was an imbalance: I inverted something positive but not something negative. I could have added obstacles or enemies, which help you in some way so that the roles were truly reversed.

Conclusion

Nevertheless, I am thrilled with how this project turned out. My goal of finally finishing and publishing a game was achieved; I learned a lot during development and got feedback to avoid repeating the same mistakes.

If you want to try the game, you can do so here.