The quadtree is an important 2D data structure and forms the core of many spatial algorithms, including compression, collision detection, and stitching algorithms. Below you can download general purpose quadtree implementations in Java and Python.

The code accompanies the Quadtrees article in Dev.Mag. The tutorial explains how the implement a quadtree that can be use to store 2D data efficiently, lists what considerations there are in real-world applications, and gives some debugging tips.

Channels Compressed Simultaneously

bar bar_c
The original image (by smcgee). The image after being loaded into a quadtree.

Continue reading “Quadtrees”

Generating Random Numbers with Arbitrary Distributions

For many applications, detailed statistical models are overkill. Instead, we can get away with a rough description of the distribution – not in mathematical formula form, but just as a graph with a few sample points.

For example, when trying to model the traffic around a school, you might know that the graph looks something like this:


The input is the number of minutes before the first bell rings, and the output the number of children dropped off at that time. You know that most kids are brought before the bell rings, and that the closer to the bell, the more kids are being brought every minute. Only a few kids are late.

This tutorial describes how to generate random numbers that can generate a distribution described by an arbitrary (piece-wise linear) curve, as the one above.

Continue reading “Generating Random Numbers with Arbitrary Distributions”

Google App Engine for Games

Google App Engine has many properties that makes it suitable for indie development. Two articles in Dev.Mag look at GAE for game development (Issue 24 and Issue 25). The first is an overview of Google App Engine, with some focus on games. The second is a tutorial that explains the implementation of “Guess a Number” on Google App Engine, for which you can download the code. For the tutorial you will need:

Continue reading “Google App Engine for Games”

60 Ways to make Game Maker projects more maintainable

Game Maker is a great tool; it is especially suited for rapid development and small projects. However, as a project becomes bigger, it becomes more difficult to find things, easier to break it, and generally harder to work on. This is of course true for any production environment, and there are many things you can do to tame the beast of scale. Here are 60 things to make Game Maker projects more maintainable.

Continue reading “60 Ways to make Game Maker projects more maintainable”