Jeff Harris

Software engineer, hobbyist game developer

How track model data is organized in C1

I’ve worked out how the tracks are put together properly, so Im now only checking and drawing visible parts of the track. So rendering speed is great, even on my laptop. :)

The track actor file is organized into a kind of space partitioning tree, where each node in the tree has its own bounding box. So doing camera frustum checks doesn’t require many calculations as you can cull large portions (near the root of the tree) quickly without checking every single actor/model. Very nice :)

For example, the node at the first level is a single bounding box which contains the entire track model. Then, at the next level, there might be 4 bounding boxes, splitting the track model in 4 (upper-left, upper-right, lower-left, and lower-right). At each level you work out which bounding box(es) your camera is looking at, and keep recursively evaluating each level until you have a list of nodes to render.

Now thats done, I am integrating the JigLib physics engine. I’ve got a car that drives (and skids!) along a flat plane, next step is to feed it the track geometry. I feel a video coming on :)

Also got horizons and proper fog going (reading from the race.txt file).

Fun times!


Bright white curb fixed

The bright-white curb in the previous screenshot was called DRKCURB.MAT - and for some reason wasn’t listed in the track.txt resources section (where all other resources are specified)

Edit: And drkcurb.mat is a simple-material (single colour) which I hadn’t implemented yet, but have now!


Loading cars and tracks

I’ve got cars and tracks loading from their config files (so I can specify Data\Cars\blkeagle.txt, and Races\Citya1.txt) and all the associated textures, models and materials are loaded). Haven’t done any performance tuning yet, so its a bit slow but heres a shot of CityB. Note the dense fog - looks just like the original Carmageddon!

The kerb material isn’t being applied for some reason which is why its bright white. Next step is to get a skybox running with the Carmageddon horizon texture to get rid of that white sky. And fix the too-dark textures. Lots to do!