David Grace

Bay Area, California

Programmer, SysAdmin, Artist

Decoding Ancient Image Files

I’m going to rewind a bit. I started making games in DOS, using GW-BASIC (and later QuickBASIC) on my first 16-bit computer.

These games aren’t much to talk about, being that I was just a pre-teen at the time. Nontheless, the games hold a special place in my heart. I fondly remember the days of puzzling out the code needed to make my first platformer game. This was all before the Internet, and my only source of documentation was the GW-BASIC Technical Reference Manual by Microsoft.

Twenty-six years later, and I am presented with a unique problem. All of the data I used to store the graphics for my games is now unreadable. JPG and BMP didn’t exist. GIF was around, but it was unknown to me. Universal image file formats were not a common occurrence.

Like everyone else around that time, I stored my image files in extremely unique and proprietary formats. In particular, I used BSAVEd sections of video memory.

From Hunters Law  (circa 1990).

Read More

Playing With Minecraft And Lua

We all know Minecraft. It’s a great tool for relaxing and creative building. I’ve spent many hours, alone or with friends, building and exploring.

There’s a lot of mods for Minecraft which have greatly extended its replay value. One of my favorites is ComputerCraft. It adds Lua-driven computers which can act upon redstone signals (Minecraft’s form of wiring) or drive signals on its own. Even better, you can control a robot called a Turtle.

Read More

Of C#, SOAP, and UPnP

The problem with a geek mindset is that you are looking to solve problems which might have already been solved. It isn’t about fame or bragging rights (usually), but a deep desire to understand a system in thorough detail.

Past readers might be noticing a trend by now.

Read More

Silly Twitter Bot Tricks

A few of my friends have Twitter horse_ebook style accounts. If you’re not familiar with this, well, it has a Wikipedia entry these days! In short, it’s a semi-famous (in a meme-ish way) bot which posted snippets from Ebooks in an attempt to avoid spam detection on Twitter. It mixed up the sentences of the books in a way that generated a lot of unintentionally funny non sequiturs.

Back to Twitter – My friends have their own versions of this account, and most use something like Mispy’s twitter_ebooks Ruby program. It’s a fun and silly thing to do, and I wanted join in.

Using a pre-existing program would have been convenient and easy, but I wanted to make my own! And so I did. I decided to use Node.js, because it’s always handy to keep my Javascript skills honed and sharp. I’ve used Node.js successfully, along with the Grunt task management library, to build back end systems for processing data or web pages. So it’s a natural choice for me.

The process is simple: Acquire Twitter timeline, and then process it into a Markov chain. Then walk this Markov chain to generate a new Tweet, and post that. Do so on a schedule, so the program can be triggered and run unattended.

The source code for Malkavianizer

Nothing too exciting, but I did learn a bit about writing unit tests using Mocha. My previous projects used my own simple testing suite.

Advanced Flixel Tutorials: Object Recycling

I use Adam Atomic’s excellent lightweight 2D Flash game library called Flixel. But this article is not a tutorial about how to use Flixel or write games in Flixel; There are plenty of pre-existing blogs which do an excellent job of teaching the basics.

My goal for these series of articles will be to teach more advanced Flixel concepts. Not all of these concepts will be specific to just Flixel, so you might get use out of my tutorial even if you are using something like Flashpunk or an entirely different platform.

Read More