The other day, I was thinking about graphics styles in video games. I realized that the old 8-bit style graphics never really got old for me. Maybe the newer generations don’t get it, but seeing 8-bit Mario always cheers me up.

I came across some blogs that show how to use Photoshop to turn any image into an 8-bit version. I don’t have Photoshop, so I wrote a simple application that does it for you!

It has both a command line tool, and a GUI on top of that. There are only three parameters, but it produces a satisfying effect. The GUI tool can only process one image at a time, but you get to play with the parameters. With the command line tool, you simply drag and drop as many images as you want onto the application, and it automatically converts them all for you! You can also run an image through twice or more, making the effect more pronounced.

Here are a few others:

You can download the application here.

It won’t work if you don’t have .NET 4.0 installed, but if you have windows then you most likely already have it.

Gemini Physics Development 2: Android Proof of Concept

The other day I started on Gemini Physics, and have been making great progress since then.

I fixed several small issues, and started making the c++ interface pretty. But most importantly, I got it running on android! That may not be very exciting for some, but its an accomplishment for me since it’s the first time that I’ve messed around with the NDK before. I can’t get over how painless the process was…

The NDK is basically a tool-chain that allows you to run native C/C++ code on android. Many programmers know that most android development is in Java. For Gemini, I didn’t want to use Java because I need every ounce of performance from the device, and because it’s already in C++. Why port to another language?

The new NDK is very easy to use. You can develop with it without ever touching java, and you can do it on windows without cygwin.

If you want to make your own NDK based applications, you need the Android SDK, NDK, and either Eclipse or Ant. After you have those, follow “Exploring the native-activity sample application” tutorial at the bottom of the NDK download page.

Next on the list is friction and rigid body constraints.

GPU List Class for C#

I was doing some GPU compute testing and I realized that it was quite painful to actually get data on to the GPU. I ended up spending most of the time just trying to copy some data over. So, I finally broke and wrote up a C# IList<T> implementation that is fully GPU backed. It fully implements the interface, and makes it very easy to get data on and off the GPU.

It’s easier to explain what I mean by just looking at some usage code. This is a basic GPU particle system, with all the data transfer totally encapsulated inside the GPUList.

It is not implemented to be super fast, rather super convenient. So if you ever want to do a GPU compute test using SlimDX, but don’t feel like dealing with the hassle of data management, this class could be useful for you.

You can get the Visual Studio project and source here: Download GPUList Project

You’ll need Visual Studio 2010, and the latest release of SlimDX.

Gemini Physics Development 1: Continuous Particles

I officially started working on Gemini Physics on the 4th of July.

Why then? The mood was right I suppose. But also because I don’t really care about being social and celebrating yet another arbitrary point in time. People love to be told when and how to celebrate and be happy. I like to have more control than that.

Philosophy aside…

I’ve been trying to make this idea work for some time now, with varying success. I finally sat down and worked out an elegant solution with my day off, and these are the results.

I have always had a minimalistic approach to things. I like doing things in the most efficient way possible. With respect to programming, this translates in to code complexity. I’ve spent quite some time learning the ins and outs of writing simple code, and this shows just how far I have come. Aside from the rendering code, all the physics (including math) you see in the video are written in 350 lines of c++.

The idea is that everything you need to do an accurate 2D physics simulation are: particles, edges, and constraints. The rules for these are are quite simple.

Particles: Move based on their velocity and acceleration

Constraints: Keep particles a certain distance from each other

Edges: Prevent particles from passing through them

With those 3 simple primitives and rules, we can construct an extremely robust and accurate simulation.

We can derive lots of cool features using these rules:

  • Rigid bodies that we’re all used to seeing
  • Soft bodies by changing a single number
  • Arbitrary shapes by changing edge configuration
  • Self intersecting shapes
  • Completely continuous with no tunneling
  • Thin, fast moving, heavy objects simulated no problem

It is a very elegant solution that I’m very happy with. It will make a nice base for Gemini Physics (coming soon to a game near you).

Gemini Physics Development 0: Getting Started

I was going to release the library used in the Gemini Physics Test Bed demo, but I’ve decided to go further than that.

I’m going to start a new engine based around all that I’ve learned over the years, and make it the go-to solution for 2D physics simulation.


Firstly, I just flat out love this stuff. Secondly, indie and mobile games are quickly becoming a very large part of the games market. I’m convinced that the mobile market in particular is going to really soar in the coming years. This means that people are going to want to start making high quality games. Due to interface and hardware limitations, the primary types of games created here are going to be 2D, at least for a while.

People could use one of the many great physics engines out there right now today. But, if I were developing the next hit game, I would want features that simply are not available in any of the current solutions. This is the problem the I want to solve with the introduction of Gemini Physics.

I have already started development, and it’s looking promising. I will post eye candy as I add features to the engine, all the way up to its first release.

Space Invaders Clone in 300 Lines

I was digging through some old stuff from high-school and I found one of the first java games I ever made!

Launch the Applet

I was very efficient back then. The entire game fits in 300 lines of java code!

That said, you can download the source code. I don’t feel like deciphering my previously cryptic ways so there are no comments, but maybe it will be helpful to someone.

G’day mates.

Quadcopter Design

I’ve always wanted to build a quadcopter. I have finally started the design phase. This one is a little more ambitious than most of the hobbyist projects that I’ve seen. I always dream big (but maybe not always best).

Here are my requirements:

  • At least 30 minutes of up-time
  • Automatic take off and safe landing
  • Propeller guards
  • High resolution video camera
  • Video recording to on-board SD card
  • Automatic stability control using accelerometer / gyro / camera
  • Connectivity using blue-tooth and 3G
  • Automatic obstacle avoidance using multiple range sensors
  • Sensor and status feedback to controller
  • Video transmission to controller with automatic quality scaling
  • Programmable with three modes to start with
  • Local control mode:
    • Connected to PC or android over blue-tooth
    • Fly manually with game-pad or touch screen
  • Long range control mode:
    • Connected to PC or android over 3G
    • Fly manually with game-pad or touch screen
  • 3rd person mode
    • Connected to android over blue-tooth
    • Automatically track you as a personal 3rd person camera
    • Manual perspective adjustments

I’ve also started scouting parts. Here is the first pass parts list:

I still need to do a lot more research. Particularly, I need to figure out how much the thing is going to weigh, and make sure that my motors can lift it, and that my batteries will give me the up time that I want. I also need to research propellers, and frame material. I expect this thing will cost at least $500. But, I’ll have an awesome project by the end of it!

I’ll post more updates as I get further in the design process.