Escape Suburbia

This project is something I made completely by myself with a bit of some help from some instructional videos provided by Udemy.

 

This took me roughly four days to create from start to finish, and it was a lot of fun to work on because I had never made an endless runner type game before! 

 

I went through and made the entire level myself with assets provided to me, I set up the UI for the game, and just about everything else you can think of!

 

Normally when I’ve worked with groups on projects, I’ve just been the game designer or level designer and as such my work would be pretty limited to just those fields; if we had a programmer they’d handle the coding, sound designers would handle the audio, etc. etc. 

 

For this though, everything was completely up to me to get done and I kinda liked that; it meant that I knew what kind of work I could expect from myself and I knew exactly when the work would get done.

 

What I’m really most proud of for this project is how I was able to set up all the code on my own using the Unreal Blueprint system! Coding has always been my weakest point for the game design process, since I’ve never been great with languages and coding is just that: a language. 

 

But with this project, I got to work deeply with coding and understand it just that much more and got very familiar with the Blueprint system.

Project Breakdown:

  • Genre: 3D Top-Down, Endless Runner
  • Engine: Unreal 5
  • Team Size: 1
  • Duration: 4 days
  • Platform: PC

Design Process

For this draft, it was definitely a lot simpler to design than my previous projects. Usually I had to plan a lot more ahead in advance with how the game would flow as the player progressed. However, because this was an endless runner and the environment would be randomly generated as time progressed I just had to make sure I kept things simple when planning out. 

This here is the finished result of putting the pieces together for the environment! The roads always stay the same, no matter what, but the buildings on the right and left constantly change when the player reaches the end of the prefab. When that happens a new instances is spawned in, the old one despawns, and the cycle repeats!

There was a bit of an issue that I ran into when making the environment, and it was because the road and building meshes weren’t even horizontally. The biggest fix to this was to measure out the difference the player was moving in regards to the tiles, and then throw in a simple plane with a collider in the middle to even things out! 

Gotta Go Fast:

Players start out slow at first, but after time things will start to get much, much faster! To avoid obstacles players must either dash to the left or right, jump over them completely, or even slide right under them. In the middle of a jump? You can still dash side to side in the air; great for making quick, timed decisions in the heat of the moment!

The player movement was definitely one of the things that I spent the most amount of time trying to perfect due to a complication that arose during constructing the environment, as mentioned above. Even if the player moved an even number of spaces left or right, they still wouldn’t be directly in the center of the lane. This made object placement as well rather tedious to work around.

 

Thankfully I found a solution by mathematically calculating an even distance between the left and right sides of the map in relation to how far the player would dash horizontally to the right or left! When I had that figured out, I took a simple plane and put it in the middle of the road and made it look as natural as possible. Due to how quick the player will be moving through the environment, it’s unlikely they’d even notice this unless they knew what to look for!

The player, when moving, always moves at 450 or -450 on the x-axis. When they reach either 0 or 1600 on the x-axis, they can no longer move past that point! 

Hot Pursuit:

Be careful of incoming obstacles! You’re never truly alone, as there’s always someone hot on your tail trying to catch up with you. Should a player hit an incoming obstacle in their way, they’ll have someone immediately behind them for a little bit. If a player avoids obstacles for long enough, they’ll gain more distance and get further ahead from the person pursuing them. Hit another obstacle while that person is behind them, and it’s game over!

For player damage, I wanted to make sure it was fair and balanced with an invulnerability window thrown in for good measure. Building this through Unreal’s Blueprint system was relatively simple, and allowed for me to tweak it to my liking until I found a solid threshold I liked!

 

The enemy chasing the player is always close, but just out of view of the camera. When damaged, the enemy gets pulled in closer to the player on the first hit. After a second, immediate hit when the invulnerability window drops is when the enemy collides with the player and the game over screen pops up.

Here is the code that I put together for the chasing enemy. 

Highscores a Plenty:

Always try to do even better than your previous runs! Try to gain more rings than before and get more distance than before to get an even greater highscore. Each time players load up the game, it remembers their previous highscores. No matter how long the intervals in between playing are, there’ll always be a new challenge waiting for players when they return!

Funnily enough, the high score mechanic was one of the hardest things to continuedly test for considering that every time I would beat the high score it would then be saved for the next test. On the plus side, it worked! Downside, worked a bit “too” well when play testing the game at higher speeds every time to make sure that the final product was perfect.

 

Overall, it was a relatively simple thing to set up. One calculates the player’s target speed, in blue, while the other just keeps a count of the player’s current high score. Eventually when a player beats their high score mid-game the numbers will be counting up in sync with each other!

Above is the code for how the distance is counted (not showcasing the one for the high score count since they basically use the same code structure).

This is the animation setup for the UI.

Want to play this game for yourself?