0.1 - Release and Debrief


I've fallen off the trend of writing these as soon as I publish each week. In case this is the first dev log you stumble upon, this game was made as part of my self-imposed game-a-week challenge. This week in particular was pretty tight time-wise so I set myself a reasonably simple task: a time trial racing game with procedurally generated tracks.

This turned out to be more complicated than you might expect. Making a car that felt good to drive turned out to be a more time-consuming (but also more satisfying) task than I initially expected. I built a version using Unity's wheel colliders, but then didn't like the feel of it so ended up shifting to my current hover car system. The car is actually a box collider levitating on a set of raycast spring forces, which gives me a lot of leeway to do my own physics calculations to get the handling just so. I'm also particularly satisfied with using an animation curve to model the car's engine as a relationship between percentage of max speed and output force. This lets me sample the curve both for acceleration and to modulate the engine audio in a really persuasive way.

The generator is... pretty bad, but also totally passable for a  first stab at the problem. It basically just works by randomly distributing some waypoints, then trying to select the segment of road that gets closest to the next waypoint. If it can't get any closer it drops a gate, then moves onto the next. The course tries to avoid overlapping itself (since I didn't include any logic for split tracks), but I had trouble getting a few different approaches to work. The current model uses boxcasts, but there are some event timing issues that make this prone to failure, so we generate a lot of failed tracks until we get a decent one. I opted to turn that into a visual spectacle for the player, rather than hide it.

A lot got left on the cutting room floor this week. The original prompt included generation parameters that are exposed to the player and racing a course from a string seed. I went into this morning planning to implement both those features, but found myself tangled in trying to make the generation a little bit less guess-and-check. In the process I broke it completely and ended up having to rollback to a previous state and just move on to the polish I needed to get the project out the door. The big takeaway here is to lock down final features earlier, leaving the final day (or final push in a longer timescale project) for smaller tweaks and cosmetic changes.

Overall though, I learned a ton doing this and I'm happy with the result. I just wish it were a little more fully featured.

Get ProcRacer

Leave a comment

Log in with itch.io to leave a comment.