Adding “Fork Me on Github” to Pelican Templates

I just wrote a blog about a project I uploaded to GitHub and I wanted to have a “Fork Me On GitHub ribbon” in the top right of the page. This is the cool thing to do nowadays after all.

I write my blog using a static website generator called …


Python Script to build a Texture Page or Sprite Sheet

Why pack textures/images?

If you’re making a game then it’s more efficient to tell the hardware:

1
2
3
4
use packed texture 1
draw primitive 1,2,3,4,5,6
use packed texture 2
draw primitive 7,8,9,10

than to

1
2
3 …

Graphing Electricity Usage with Current Cost and Munin

Many years ago I bought a Current Cost meter. Infact it was so long ago now that they have called my version The Classic. I wanted to see how much electrical energy all my servers, home computers and gadgets were using.

The Current Cost package contains two main parts, a …


Using Python and Tkinter to capture script output

In order to build the assets for my games I have a series of python scripts that know how to take files TexturePacker, Tiled, and Blender and build them for use within the engine. My main platform is OS X and it has good terminal support and more importantly I …


Starter Blender Exporter

I’ve settled on using Blender 2.6 both as a level editor and modeller for my next game (code name BBM). BBM is a 2D game but modelling the characters and rendering the sprites will save a lot of time. Blender isn’t the best level editor but it …


NvStrip and Blender – Stripifying Models for the iPhone/iPad.

What Is Stripification?

Stripification is the process of turning lists of triangles in an arbitrary order into as many lists of triangles that contain adjacent edges. There is a great explanation of a triangle strip of wikipedia.

Why would you stripify?

On most platforms Triangle Strips render more quickly. The …


A Pythonic “Center New” in Blender

Part of my Art pipeline for Tentacles is to import a directory of 3DS files. Each of these files is a map piece and the map pieces are instanced to create a map. That way I can store the geometry for a shack once but instance it across the level …


Replaying an Apache Logfile with Python

NOTE: This is an old article I wrote in October 2008, it’s still relevant today. It was originally posted on luckydonkey.com which I am in the process of retiring.

In order to test for a memory leak in New Metal Army I needed to replay my apache log …


Python Style Plugins Made Easy

NOTE: This is an old article I wrote in January 2008, it’s still relevant today. It was originally posted on luckydonkey.com which I am in the process of retiring.

Sometimes you need to write code that loads python at runtime. Plugin architectures are a good example of this …


PostgreSQL, SQLAlchemy, Dropping All Tables and Sequences

NOTE: This is an old article I wrote in January 2007, it’s still relevant today. It was originally posted on luckydonkey.com which I am in the process of retiring.

There were a number of insightful comments in the original article that I have not copied across. They ended …