Friday, June 29, 2018

Dream Coaster Rider


Lift hill on "Corky", a standard corkscrew coaster

Dream Coaster Rider was originally to be part of a project called Theme Park Builder 3D, which later got renamed to OpenParkDeveloper.  That project didn't pan out, but I still have a working roller coaster simulator to show for it.
Tracks were defined using XML data files.  How tracks worked was that elements were defined in their own tags, and later referenced later on in the track element sequence. Blocks could be defined in parallel to individual elements in the track file.  This separated element geometry from actual block lengths and their logic.

Blocks on a wooden coaster "Tornado"


Rides had different operation modes, including full-circuit, shuttle loop, and reverse incline shuttle.  In spirit, many of these modes followed conventions of RollerCoaster Tycoon. 


The program would load most arguments from the command line, including track file, and various switches pertaining to the ride.  One could bypass this using an I/O redirection file.

The simulator was programmed in C++ and was heavily object-oriented making use of singleton and factory design patterns.   For example, each style of track had it's own procedural factory which defined a span of track in IJK coordinates.  This was then extruded using the interpolation of the track's spline to generate track polygons.

I learned quite a few things on this project, including spline re-parameterization and the application of forward right and up vectors, treating them much like I would the standard Cartesian axes.  G-Forces were calculated by taking the instantaneous acceleration and projecting it on to i, j, and k unit vectors.

Heading into a barrel roll with g-forces and other ride stats displayed in the top-left.

More about the project and the source code can be found here:
https://github.com/RollerSimmer/DreamCoasterRider
https://github.com/RollerSimmer/DreamCoasterRider/releases

No comments:

Post a Comment