image.png

Overview

Space highways are travel points in the space sectors that allow players to travel extra fast to a given destination. The use of these highways isn’t particularly complex, but very helpful for level designers to help railroad players towards important locations in an otherwise large and vast level that may not have content at every corner.

To use a space highway, the player must simply enter the highway at any position in the path, point the ship in the direction they want to go, and then stop their engines so that the ship can charge up and blast down the rails. The player can exit the space highway at any time by pressing ‘W’.

Implementation

The implementation of space highways is rather simple: Add the Space Highway prefab into a scene, duplicate and position the general waypoints as needed, and then add them in order in the waypoints array in the inspector. Once this is done, the rest of the setup will be automatically created upon the level’s initialization. A chain of rings will be generated, linked together by a blue, glowing rail.

Behind the scenes, the space highways implement a system of splines, which also utilize Bezier curves. Upon the level’s initialization, the space highway will generate splines that determine its shape more accurate, and uses these splines to create a path for its rings and rails, as well as a newer set of more precise waypoints, each with their own trigger collider.