Outrun Prototype

godot-game-engine-icon

Outrun Prototype was a project going by the name “Projekt Outrun”. It was a game inspired by the xbox live game “Race the Sun”. The idea was to bring the idea of a racing game and an endless runner together.

Outrun Prototype or “Projekt Outrun” was a game developed as part of my internship with Bitten Toast Games. It was made in collaboration with another intern, Aidan Kinnaird, which was the artist for the game. I took on game design tasks, programming, and sound design (though in its current state sound for the project does not work due to issues with the unofficial fmod plugin for Godot). Below I’ve detailed some of the aspects I was proud of.

Tile Management

To help have a higher variety of terrain, the terrain is randomly generated. To do this, the terrain spawns preset terrain tile prefabs to create the level the player plays on. These tiles are spawned whenever the player gets close, and are de-spawned whenever a player gets too far or passes them. The illustration to the side shows this.

Additionally, instead of the player moving through the scene, it’s the tiles that move towards the player. This is done to help floating point precision errors that would come from an endless runner running for too long.

*note: This code is in GDscript and not Python

Pyton
				#function that manages spawning and despawning of tiles
func ProcessTiles() -> void:
	
	for tile in generatedTiles:
		var tilePosition: Vector3
		tilePosition = tile.position
		
		#right border check
		if(tilePosition.x > xBoundry):
			#print("right border call, (%.2f > %.2f == %s) %s id %d" % [tilePosition.x, xBoundry, tilePosition.x > xBoundry, tile.position,tile.get_instance_id()])
			SpawnTile(Vector3((tilePosition.x - (gridSize.x -1) * (tileSize)), tilePosition.y, tilePosition.z))
			RemoveTile(tile)
		
		#left border check
		elif(tilePosition.x < -xBoundry):
			#print("left border call, (%.2f < %.2f == %s) %s %d" % [tilePosition.x, -xBoundry, tilePosition.x < -xBoundry, tile.position, tile.position,tile.get_instance_id()])
			SpawnTile(Vector3((tilePosition.x + (gridSize.x -1) * (tileSize)), tilePosition.y, tilePosition.z))
			RemoveTile(tile)
		
		#back border check
		elif(tilePosition.z < zBoundry):
			#print("back border call, " + str(tile.position))
			SpawnTile(Vector3(tilePosition.x, tilePosition.y, (tilePosition.z + gridSize.y*tileSize)))
			RemoveTile(tile)
			

Gear System

The player movement uses a gear system I developed for this game. I made this system to help give the car a sense of accelerating in a manor closer to how gear shifting works with cars rather than linear acceleration. 

Pyton
				func HandleForwardMovement(delta: float) -> void:
	
	shiftGear()
	
	if(fuel > 0):
		trackedVelocity.z += gears[activeGear].IncreaseSpeed(trackedVelocity.z, delta)
	elif(trackedVelocity.z > 0):
		var airResistance: float = ((0.5 * airDensity * pow(trackedVelocity.z, 2) * dragCoe * crossSection) / carMass) * delta
		trackedVelocity.z -= (airResistance + decelerationMin*delta)
	else:
		trackedVelocity.z = 0
	
	if (fuel <= 0 && trackedVelocity.z <=0):
		GameManager.EndGame()
			
Scroll to Top