Saturday, 26 March 2011


Following up from an earlier blog post about being interviewed by Good Game, I've been cut from the episode to air.

It's on permadeath, so hopefully you'll still find it interesting. The story will be going to air this Tuesday 29th March at 8:30pm ABC2.

Latex, interrupted

I'm not finding a huge amount of time to program at the moment, but plenty of time to write - it's easier when you're building information with sentences instead of data structures if you get frequently interrupted.

And, man, LaTex generates some pretty documentation. But it looks like I've incorrectly chosen to use ctable instead of threeparttable and longtable, and I'm about 30 pages in (28 pages of which are tables).

Guess I'm going to have to learn Perl to reparse the stuff I'm written.

Can't get away from needing to invest time in knowing the tools to know which tool I should be investing time in...

Tuesday, 8 March 2011

Naive Javascript (possibly OO) questions

So I've got a data structure I want to initialize for a game map, for example:

// A grid is a collection of cells. It is initialized to the default contents.
function Grid(rows, cols, default)
this.rows = rows;
this.cols = cols;
this.cells = new Array(cols);
for(x = 0; x < cols; x++)
this.cells[x] = new Array(rows);
for(y = 0; y < rows; y++)
this.cells[x][y] = default;

Now, my question is given I want to have default represent a particular terrain type at a location, plus unit types, plus improvements etc. I can see 2 ways of approaching this:

1. Have multiple grids, each of which points to a different thing e.g. TerrainGrid, UnitGrid etc. where a thing might be an integer value, string, head of a linked list and so on.

2. Have a single grid, MapGrid, which points to a Cell object which contains information about these multiple things.

Now the complication is of course, I want multiple view ports pointing at possibly different lists of grids for e.g. multiple players, isometric views, overhead views, different map projections, so I also need a ViewPort object which contains a list of (possibly non-rectangular) cells. (Technically, a view port should always be a rectangular projection, so maybe call it MapProjection instead).

Now, here's the naive question. How do I ensure that I only have a single instance of each cell in my ViewPorts? My approach would be the view port contains a list of (x,y) coordinates of the cells in the view, but is there any advantage to directly pointing at the Cell objects, assuming I go with a single Cell object in a single Grid as opposed to multiple grids. If I do, how do I ensure that I'm using a reference to a cell (and not a copy) and that if I destroy a ViewPort I don't delete the underlying cells. What about concurrency issues, where I have two players acting on the same underlying cell object through different ViewPorts?

These are terribly naive questions which because of the elegant design of C, never really enter the picture when I'm working on Unangband.

I can see how people get paralyzed trying to develop in so-called higher level languages.

Sunday, 6 March 2011

Some notes on installing git on OSX Tiger

Get the latest copy of Xcode supported for Tiger (Xcode 2.5):

Update MacPorts:

sudo port -v selfupdate

Install Git:

sudo port install git +svn

Thanks MacPorts!

Wednesday, 2 March 2011

Procedural voyeurs

In lieu of anything interesting to say[1], I'll just point you in the direction of a couple of PCG blogs I have been enjoying: nullpointer, and Procedural World. Feel free to mention more in the comments.

[1] The closest I've come to being 'interesting' of late is realizing my fractured schedule was ideal for Facebook gaming, and signing up for Brenda Braithwaite's Ravenwood Fair. I got as close as opening the game once - but was luckily saved at the last minute by the fact it refused to sync correctly. Close call.