Tuesday, August 5, 2014

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.

Sunday, May 25, 2014

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 Carnageddon remake!). Looking it now is a bit embarrassing - I cut a lot of  corners before the release, the code is messy but it does let you blast along the Alpine tracks and it's 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, XNA 3 was the latest version when I made nfs, 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. The problem was it wasn't as fun to play as I thought it was, and the code was much worse than I thought it would look :(  Somehow if I leave code for several years it seems to degrade! I started ripping, replacing, refactoring, all the things that software devs love to do! 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. Looking back on it now, the code doesn't do a good job of explaining how these objects fitted together. I used to know that a TerrainSegment always had 4 TerrainRows, and each row had 10 TerrainStrips, but a few years later there was a lot of head scratching!

Anyway, a few weeks of late nights later, a huge amount of refactoring, 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 n feel difference was changing the field of view and aspect ratio to match screenshots of the original. The values I used before 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.

Wednesday, March 14, 2012

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.  Makes discovering how to do things a 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 useful already I think.