Jeff Harris

Software engineer, hobbyist game developer

New OpenNFS1 v1.2 video

I’ve just posted a new video showing the latest OpenNFS1 dev version. Compared to the original video I made years ago when I made v1.1, this version is much faster, with a better sense of speed and more faithful to the original.


Need for Speed XNA update

It’s been at least 4 years since I did any work on my remake of the original need for speed game. Back then it got picked up by a few gamedev sites and I was contacted by EA Canada asking if I was interested in interviewing with them! (A completely different story to Square Enix and my Carmageddon remake!). Looking at my code after so long is pretty cringe-worthy - I cut a lot of corners before the release, the code is messy but it is still sort of fun to play. With the end of XNA, and being between projects, I decided to do a quick port to MonoGame and move the project to GitHub.

I figured it would be a few days of work and I’d be done with the port, as MonoGame implements almost all of XNA 4. Unfortunately, I had compiled against XNA 3, so first I had to update to XNA 4 and deal with all the breaking changes. Once that was done, it was running in MonoGame pretty quickly. As all developers love to do, I started ripping, replacing and refactoring. The problem now was when I wrote the code I had built up a really good mental model of the Need for Speed track structure and how it was represented in code and in the data files. It’s quite complex, with many parts, represented by classes with names like TrackNode, TerrainSegment, TerrainRow, TerrainStrip etc. The code didn’t do a good job of explaining how these objects fitted together. I used to just know that a TerrainSegment always had 4 TerrainRows, and each row had 10 TerrainStrips, but coming back to it took a quite a while to get back in the groove.

A few weeks of late nights later, a load of new features, bug fixing, and more digging around the original data files with a hex editor, OpenNFS1 is much cleaner and more faithful to the original. A couple of things that made the biggest look and feel difference was changing the field of view and aspect ratio to match screenshots of the original. The values I originally used were way off, and resulted in a lack of feeling of speed. I’ve added some simple AI to race against, here are a couple of screenshots with 100 racers! The original game used some really fun optimizations to have 8 cars simulated at once, which I am also using, and 100 cars is actually pretty computationally simple because of it.

I’m going to write a few posts about how the tracks and scenery and physics are organized in the original game (as far as I can guess from understanding the data files) because some of the ideas could work well for mobile games today. Also, if I don’t write it down this time, I’ll forget and hopefully it will be interesting for someone else too.


7-Zip for Mac

I’ve been wanting to write an OSX app and get into Xcode recently, so I decided to make a nice Cocoa-based 7-Zip for Mac.

It was hard to understand the black magic behind InterfaceBuilder, but Apple has a bunch of nice examples built in to their help system which helped a lot. Objective-C is weird at first. You dont usually need to implement an interface (like C#), but if you name your methods the correct name, they just magically get called by the runtime. I found it makes discovering how to do things a RTFM/google/stackoverflow exercise, rather than inside your IDE.

This is v0.1. There is no support yet for creating archives, zip files are set to open with 7-Zip Mac by default and there are no preferences. But its semi useful already I think. link