Thursday, September 6, 2012

Rock n' Roll Racing Clone Prototype (2005)

As many friends know, I'm a huge fan of the game Rock n' Roll Racing, by the company now known as Blizzard.  I like it so much I spent a Christmas break reverse-engineering the password system.  I guess it was more or less inevitable that I would eventually try my hand at writing a modern equivalent, which I did starting in 2005.

The goal for this project was to faithfully emulate the original and keep the mechanics and feel, including the isometric camera.  Though this is not pictured in the below video, I went so far as to run the game in an emulator side-by-side with my own version, with the input from a single joystick input being fed to both games, in order to make sure the vehicle simulations matched (acceleration rates, yaw rates, maximum speeds, etc.).  This "clone" even emulates the 24-step vehicle rotation of the original game, which really gives an authentic feel on tracks of the same scale as the original game.  (In the video, test tracks are seen, which are a little narrower and shorter than the tracks in the original game.)

The part that tickles my fancy as a programmer is the way I chose to represent the track and perform the vehicle physics: the track is represented as a parametric 3D surface.  For each track segment, a set of 2D parameters is transformed by a set of parametric equations into a 3D surface representing the ground of the track.  The myriad little gizmos you see on the track ground in the video is rendered by sampling each track segment in a grid pattern.  This surface is not tesselated; all 2D and 3D queries are performed directly against the parametric representation.  This makes the base AI navigation very simple because it essentially simply has to steer in such a fashion as to follow a "lane" of y-coordinates in local track space, where increasing y-coordinates denote "down the track" and x-coordinates denote space "across the track".  The parametric representation also affords other for interesting capabilities, like a potential for producing computer-generated tracks simply.

The vehicle model was provided by a friend of mine, Julien.  The 3D follow-cam shown in the video is used for debugging; it gives some insight into how the vehicle motion is programmed.



4 comments:

  1. can u give me the 3d model car?
    snesfanremix@gmail.com
    thanks

    ReplyDelete
    Replies
    1. Just got permission from the artist. Done!

      Delete
  2. very nice project, are you thinking about selling it with non blizzard assets or you just want to have fun in sparetime? In this case would you share sources in some git repositories?

    ReplyDelete
    Replies
    1. I don't think I will ever finish this project. I suppose I could throw it up on GitHub or something. I will put that on my list of things to do and reply here when I get around to it! :)

      Delete