Junkyard Bash

Role: Technical Game Designer

Development Time: 2 Weeks (2018)

Tools: Unreal Engine 4

Team: 9
 

Contributions:

  • Game Play Programming

  • Multiplayer Back-End Systems

  • Game Design

Music and SFX by Joakim Johansson

Trailer

About

Junkyard Bash is a physics based racing game for 1-4 people where players race through a scrappy junkyard full of traps and junk. 

This was the first project we did at Futuregames in two weeks where our theme was Physics and Goofiness. So we made a racing game with goofy characters and where the vehicles were all driven by physics. 

 

Game Play Programming

I made all the Game Play Programming such as Input Handling, the Camera and the different Physics-Based Vehicles that are made completely from Scratch. 

Junkyard Bash Play through

Physics Based Vehicles

Getting Custom Forward of Spinning Vehicle

(Hover Over for More)

Custom Forward Vector

What was challenging was getting the Vehicles Forward Vector ...


when a vehicle like the sphere was constantly rolling. It was was necessary for basic movement and for the camera etc.

  • So I had to make an own Custom Forward Vector which was calculated by getting the Physics Linear Velocity, Normalizing it times 200 so I got a point in space 2 meters ahead of where the vehicle was heading. Then GetUnitDirectionVector toward that location. The same was done for the Side and Up Vector.
  • Since the sphere is always spinning, the Cockpit gets its Rotation set toward the vector point in front of the character every frame so the character itself doesn't spin around.





Acceleration & Engine Braking

Get the surface Material by ...


line tracing under the vehicle everyframe and sets the amount of friction depending on the material.

  • Adds Force Down on the Vehicle depending on the surface.
  • This could also determine what particles is spawned under it, for example if the right side of the wheel drove into a puddle ut could spawn water particles.





Acceleration & Engine Brake

(Hover Over for More)

Slope Tilting & Pitching

Slope Tilt & Pitch

What was challenging was getting the Vehicles Forward Vector ...


when a vehicle like the sphere was constantly rolling. It was was necessary for basic movement and for the camera etc.

  • So I had to make an own Custom Forward Vector which was calculated by getting the Physics Linear Velocity, Normalizing it times 200 so I got a point in space 2 meters ahead of where the vehicle was heading. Then GetUnitDirectionVector toward that location. The same was done for the Side and Up Vector.
  • Since the sphere is always spinning, the Cockpit gets its Rotation set toward the vector point in front of the character every frame so the character itself doesn't spin around.





(Hover Over for More)

Ground Friction

(Hover Over for More)

Boost, Jump, Bash and Drift

(Hover Over for More)

Surface Friction

Get the surface Material by ...


line tracing under the vehicle everyframe and sets the amount of friction depending on the material.

  • Adds Force Down on the Vehicle depending on the surface.
  • This could also determine what particles is spawned under it, for example if the right side of the wheel drove into a puddle ut could spawn water particles.





Abilities

The Vehicles have some abilities such as Jumping to ...


get over gaps,

  • Drifting to increase their turning speed.
  • Bash to Hit nearby players or physics object so they fly into the opposite direction.
  • Boost Pads that give a temporary increase in the max speed.





Camera

Overview


  • The camera focuses on the direction the player is headed to so it's easier to see where you are about to go.
  • Blends Speed lines FX and slightly changes the field of view depending on how much forward velocity, to give a better sense of speed.




Camera Tilt & Pitch


  • The Camera Tilts, Pitches and slightly rolls when on slopes to make it easier for the player to see where they are heading towards.




Camera Height Adjustment


  • The camera can adjust it height as well and smoothly lerps down and up again if going under something.





Camera Tilt and Height Adjustment

(Hover Over for More)

 

Back-End Programming

PlayerController, GameMode & GameInstance

I made all the Back-End Programming such as Character Select Screen, Checkpoints, State Machine and the different Multiplayer Setup with Spawning, setting the cameras, clearing up Player Controllers etc. 

You can play the game with 1-4 players but I made it comfortable to pickup and play so for example controller 1 and controller 4 could join a game and it would be a 2 player game with the split screen adjusted for the amount of players joined.

(Hover Over for More)

Character Select Screen

What was challenging was getting the Vehicles Forward Vector ...


when a vehicle like the sphere was constantly rolling. It was was necessary for basic movement and for the camera etc.

  • So I had to make an own Custom Forward Vector which was calculated by getting the Physics Linear Velocity, Normalizing it times 200 so I got a point in space 2 meters ahead of where the vehicle was heading. Then GetUnitDirectionVector toward that location. The same was done for the Side and Up Vector.
  • Since the sphere is always spinning, the Cockpit gets its Rotation set toward the vector point in front of the character every frame so the character itself doesn't spin around.





Character Selection
Character Selection

Spawning Players

Get the surface Material by ...


line tracing under the vehicle everyframe and sets the amount of friction depending on the material.

  • Adds Force Down on the Vehicle depending on the surface.
  • This could also determine what particles is spawned under it, for example if the right side of the wheel drove into a puddle ut could spawn water particles.





Spawning Players
Spawning Players

States
 

I make good use of States to determine where in the game the player is, for example At Menu, At Sub Menu or At Race, depending on which the Input could execute different things. There is so much more I could write about the Back-End but for readabilities sake I'm gonna present the most notable below. 

Input & Use of States

Level Streaming
 

The game's level is split up into several sub levels so each designer and artist could work on different one without conflicts. The Main menu uses the same level to make the transition from Character Selection Screen to Race quick. 

After the Levels have been loaded it checks what State the Game is in, for example if it was AtIntroLogos it means the game has been just Booted, If it was Debugging then it will call Debugging and spawn the characters that's been chosen to debug with right away. 

 

Level Streaming