Category Archives: Software

Arduino Raytracer

Every programmer worth his salt has written a raytracer of some sort. It’s one of the classic “recursion exercises”, with a fair amount of math to wrap your head around. I’m not interested in writing one to run on the PC – there are already far more capable ones that can run on pretty much any hardware, complete with optimizations and features I couldn’t hope to implement in my lifetime.

Instead, I decided to write a raytracer which targets the Atmega 328 microcontroller in my Arduino! In the end, I succeeded in banging one together that calculates ray-triangle intersection, and each triangle can have a material attached with ambient / diffuse / transparent / reflective values and an RGB color. The scene is compiled in with a .h file (stored in PROGMEM), and outputs a PPM image pixel-by-pixel over the serial port.

The same engine can be used on the PC with a few modifications, so I was able to benchmark the performance of the Arduino in comparison with a modern laptop. The “detailed scene” rendered a 640×640 image in 263 seconds on the laptop. The same scene, scaled to only 64×64, still took 4008.471 seconds… in other words, the PC outperformed the Arduino by a factor of ~1500.

I posted the code, and further write-up, on the Arduino.cc message board at this link: http://forum.arduino.cc/index.php?topic=281076.0. There are a lot of features that COULD be added here, but none that I actually intend to do. If I need a raytracer in the future, I’m just downloading POVRay : )

Crazy Taxi Garmin GPS Voice

Here is a project I’d been talking about for years, but never actually pulled it off until recently. It’s a voice set for a Garmin GPS, which replaces the default “narrator” with the obnoxious announcer from Crazy Taxi.
All voice clips were pulled from the PC version of the game, which had them in convenient .wav format already. Some trim / normalize with Audacity and import into Garmin Voice Studio to assemble together. I wanted to do more than just the announcer, but didn’t have any luck with that… there just weren’t enough clips to make it happen.

Here’s a video of the system in action:

I hosted all the downloadables on archive.org. You can get it from here:
https://archive.org/details/Garmin-CrazyTaxiVoice

cfg_parse on Sourceforge

cfg_parse Icon cfg_parse, that tiny config parser I wrote a few months back, has now been moved to Sourceforge. I also took the time to make some Doxygen comments and generate a manual for it. No major bugs were found but a couple minor tweaks help tighten up the release.

Check it out here: http://cfg-parse.sourceforge.net

The easiest, easiest way to use this is to add it as a subversion externals for your project – that way it will automatically get checked out with the rest of your code, and you can build it right in! The syntax would be something like…
svn:externals svn://svn.code.sf.net/p/cfg-parse/code/trunk cfg_parse .

GregerQuest

gqTitle
Before there was World of Warcraft, there was Everquest. I never played it but I had a buddy in college who did: he talked about how amazing the MMO genre was, with all its social aspects, technical quirks, and just plain cool experiences.

Naturally it inspired me to make my own clone. In Visual Basic. With 2d graphics and piping everything through the Winsock .ocx control. Full of programmer art made with a pirated copy of Bryce 3d.

gqChars

Ah, the wide-eyed days of a young programmer in a rapidly expanding genre. It’s like I was playing out every cliche of the Gamedev.net newbie at once. The one thing I had going for me, though, was a thorough understanding of the impossibility of such a project – and a sense of humor about it all. For example, I often joked that the only enemies were going to be Gelatinous Cubes, because that would be easy to render. I once wrapped a photo of my roommate’s face on a sphere to use for a hideous player character head. And so on. Eventually I got about as far as a character select screen, with a couple songs, before giving up and moving on to something else.

Unlike SlugFest, this is one that isn’t ever going to get off the ground. If anyone is interested in the art and music resources, you can have them: hereby released into the Public Domain.

shore

This isn’t my only brush with the MMO genre. Later on some friends and I tried another take on it (“Draconis”) as the U of A Game Dev club project – with a result somewhat similar to The Mana World, and it once held up to five players online simultaneously. The real killer for these kind of games is the sheer amount of content required. Though Draconis worked technically, all the content in the world was viewable at first login. Hardly a compelling MMO experience.

Download GregerQuest Resources: .ZIP file, 1.9mb.

Smoke Help (for OSX)

This is a tool to help people quit smoking. My wife gave me the idea, I just wrote it.

coach

Start the program up and put it into Learn Mode. Every time you have a cigarette, hit the “SMOKE” button. This trains the program, over the course of 100 cigarettes, your (natural) average time between cigarettes.

Then put it into Coach Mode. At this point the program will begin telling you when it’s time to smoke again, using an alarm. Don’t smoke until instructed to do so, and then hit the button when you do. The program starts by alarming at the learned rate, but extends the interval each cigarette. Eventually your rate will slow down to the point where quitting is natural.

At least, in theory. My wife quit without my help so I wasn’t ever able to test it.

This is the sort of thing that would be super-ideal as a mobile app. I don’t have time nor inclination to set that up, but I’d love to see it. So, this is now public domain software. (Included font isn’t though).

Smoke Help OSX Binary – .zip – 2.45 MB
Smoke Help source code – .tar.gz – 227kb