My next game has a tile-based system behind it. Gratuitous Space Battles didn’t have tiles because if it did, all of them would be “tile 1: space“, which is kinda dull.

Tile-based games are typically associated with very old school RPGs and with early top-down very basic RTS games. Generally, these games seemed to have a set number of tiles (a ’tileset’) and the tiles would be of  fixed size. The tile size was small, to enable sensible pathfinding, but this would make the terrain look very obviously gridlike, with tiles repeating and the largest terrain objects being tiny.

Tech has moved on, and we can afford to have big textures now, but the problem is that a system that uses the tiles for non-visual stuff (pathfinding, AI, terrain etc) still probably needs fairly small tiles. For a while, I was struggling with small tiles and coder art, but the first few bits of proper art have forced me to reassess how I was doing things.

It’s all coded now, and the solution was to basically have two overlapped tile systems. Effectively, the game grid works on smallish tiles, and the visual tiles that have textures applied to them are four times the size. This is completely transparent to the gamer, but it does make for a slightly strange ‘change edit mode’ button in the game editor, and some slightly messy code. Eventually, the system I plucked for just uses the smaller tiles, in the game engine and the editor cunningly lets you apply the larger ones, and transparently splits them into 4 and applies them to the smaller ones for you.

It was a bit of a pain to code, but worth doing. One day I’ll have screenshots to show!

2 Responses to “Revisiting the tile based game”

  1. K says:

    Take a look at Starcraft 2 (and its predecessors, SC1 and WC1-3). All of them are based on tiles with an underlying grid. The newer, the smaller the data grid.

  2. I found this pretty funny having very recently gone through the transition from coding for a space-based game with a very granular coordinate system to a tile-based game that takes place on land. The simulation is actually still mostly granular but there are tiles, etc.

    Art-wise it became a massive pain because we’re not pixel-artists. Eventually we just went with much larger textures using UV repetition for backdrops, and also doing some “cross tile layers” for stuff like roads that mostly repeat, etc, but are much larger than one tile in either dimension.

    Pathfinding-wise we’ve actually just dodged that bullet thus far (though it certainly makes sense to use the tile-based heuristics for long-distance stuff and switch to the granular coordinate system for near-target maneuvering), but the tile model actually greatly assisted the collision model because it led to much more intuitive spatial partitioning, etc.

    Anyway, fun stuff :)