Junkyard Bash

jacob-stenberg-junkyard-bash-poster.jpg

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. 

JunkyardBash_pitch2
JunkyardBash_pitch2

JunkyardBash_pitch4
JunkyardBash_pitch4

JunkyardBash_pitch3
JunkyardBash_pitch3

JunkyardBash_pitch2
JunkyardBash_pitch2

1/3
 

Game Play Scripting

I made all the Game Play Scripting 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
Junkyard Bash - CustomForwardVector
Junkyard Bash - CustomForwardVector

Junkyard Bash - SetCockpitRotation
Junkyard Bash - SetCockpitRotation

Junkyard Bash - CustomForwardVector
Junkyard Bash - CustomForwardVector

1/2

(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

Using the Custom Forward vector I could Apply Force forward to the Vehicle by ...


using a curve that the set max speed.

  • So more force was applied when the Vehicle was standing still and much less when it has reached top speed, so you could have high acceleration but not have it continually add as much force when at top speed.
  • The player can also brake, if they don't accelerate or brake, the Vehicle will Engine Brake by itself and graully go slower.





Acceleration & Engine Brake
Junkyard Bash - Accelerate and Engine Br
Junkyard Bash - Accelerate and Engine Br

Junkyard Bash - Accceleration
Junkyard Bash - Accceleration

Junkyard Bash - Engine Braking
Junkyard Bash - Engine Braking

Junkyard Bash - Accelerate and Engine Br
Junkyard Bash - Accelerate and Engine Br

1/3

(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.





Junkyard Bash - Camera Tilt
Junkyard Bash - Camera Tilt

Junkyard Bash - Tilt Code
Junkyard Bash - Tilt Code

Junkyard Bash - Tilt Calculation
Junkyard Bash - Tilt Calculation

Junkyard Bash - Camera Tilt
Junkyard Bash - Camera Tilt

1/4

(Hover Over for More)

Ground Friction
Junkyard Bash - Friction
Junkyard Bash - Friction

The Black Material represents Tar with alot of friction which gives the vehicle lesser acceleration

Junkyard Bash - GroundFrictionTrace
Junkyard Bash - GroundFrictionTrace

Junkyard Bash - Ground Friction Resistan
Junkyard Bash - Ground Friction Resistan

Junkyard Bash - Friction
Junkyard Bash - Friction

The Black Material represents Tar with alot of friction which gives the vehicle lesser acceleration

1/3

(Hover Over for More)

Boost, Jump, Bash and Drift
Junkyard Bash - Abilities
Junkyard Bash - Abilities

Junkyard Bash - Jump
Junkyard Bash - Jump

Junkyard Bash - BashAbility
Junkyard Bash - BashAbility

Junkyard Bash - Abilities
Junkyard Bash - Abilities

1/4

(Hover Over for More)

Surface Friction

When Spawning the players for the actual race it checks ...


how many players are locked in.

  • Sets SplitScreen if its more than 1.
  • Loops through the 4 PlayerControllers (that was created at begin play so all players could give input when selecting characters), and RemovesPlayer if a playercontrollers State is not LockedIn.
  • Spawns the player, camera, HUD and assigns them all.





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

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 Tilt and Height Adjustment
Junkyard Bash - Camera Tilt
Junkyard Bash - Camera Tilt

Junkyard Bash - CameraLowAltitudeAndRoll
Junkyard Bash - CameraLowAltitudeAndRoll

Junkyard Bash - LerpingTheCameraAndFXs
Junkyard Bash - LerpingTheCameraAndFXs

Junkyard Bash - Camera Tilt
Junkyard Bash - Camera Tilt

1/5

(Hover Over for More)

 

Back-End Scripting

PlayerController, GameMode & GameInstance

I made all the Back-End Scripting 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.

Junkyard Bash - PlayerController
Junkyard Bash - PlayerController

Junkyard Bash - GameMode
Junkyard Bash - GameMode

Junkyard Bash - GameInstance
Junkyard Bash - GameInstance

Junkyard Bash - PlayerController
Junkyard Bash - PlayerController

1/3

(Hover Over for More)

Character Select Screen

Players can choose whichever character they want ...


from the character select screen.

  • When a player Joins in the CharacterSelectScreen State, the Vehicle Mesh will be spawned.
  • Pressing left or right while in the SelectingCharacter State will switch to the next character.





Junkyard Bash - Character Selection Scre
Junkyard Bash - Character Selection Scre

Junkyard Bash - Character Selection Scre
Junkyard Bash - Character Selection Scre

1/1
Character Selection
Character Selection

Spawning Players

When Spawning the players for the actual race it checks ...


how many players are locked in.

  • Sets SplitScreen if its more than 1.
  • Loops through the 4 PlayerControllers (that was created at begin play so all players could give input when selecting characters), and RemovesPlayer if a playercontrollers State is not LockedIn.
  • Spawns the player, camera, HUD and assigns them all.





Junkyard Bash - Spawning Players
Junkyard Bash - Spawning Players

Junkyard Bash - Spawning Players
Junkyard Bash - Spawning Players

1/1
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