Worklog for SculptureOfSoul

Worklog 1

Return to Worklogs

The Tile Engine(Posted 2006-07-27)
Well, I've just started programming after a couple year hiatus. Actually, I don't know if you could rightfully call what I used to do "programming" in the truest sense of the word, since I was using Clickteams Click & Create, a clickable script oriented game making environment.

Anyways, I've got a lot to learn and I figured I might as well dive in the deepend. So I started working on my tile engine. Tile engine...deep end? Well, whipping up a basic tile engine is quite easy, but I looked at some of the features I'd like to have and unfortunately they demanded a more complex engine.

Anyhow, I've been working on the engine and surrounding framework for a couple of weeks now, learning Bmax and OOP as I go. So far, everything has gone fairly smooth, except for the fact that my engine framework keeps growing and growing, and I've got so much code to put in place before I can do anything fun.

Here are the core design specifications of the Martyr Tile Engine, further described below:

Unlimited map size
Any size tile at any location
Y sorting & Height sorting
Unlimited layers*
Dynamic Virtual Layer system
Tile Image Independance
Animated Tiles
Dynamic Data loading (map & tilesets)
Advanced File scheme - 1 int per ANY tile type, be it an animated tile, a map object, a player object, etc.
Seamless travel


Unlimited map size:
Theoretically the map can be as large as you like. The only constraint is the amount of disk space available.

Any size tile at any location:
Each tileset can only contain tiles of one size, but that size can be different for each.

Y & Height sorting:
Tiles are Y sorted and height sorted. Height sorting draws tiles that have a higher "height value" above those with a lower height value.

Unlimited Layers:
Theoretically unlimited layers are possible. *Although right now I've got it set to 256 as I'm using a byte to represent the layer value of a tile.

Dynamic Virtual Layer System:
Imagine a map that consists primarily of a background grass tile. Now that's one virtual 'layer'. In the middle of the map is a house - these tiles are layered over the grass tiles. The walls of the house, the floors, and the interior, comprise the next virtual layer. The roof and chimney are placed above the walls, floor and interior, and comprise the next virtual layer. At this point, each tile on the map where the house is has 3 layers. With a normal layer system this would require three passes across every spot in the map array that is visible on screen.

The dynamic virtual layer system allows *each spot in the map file* to have only as many layers as it needs. If you want to utilize 8 virtual layers on 2 tiles, the render engine will only make 8 passes on those 2 tiles, and every other tilespace will only require as many passes as it has virtual layers.

This allows you to stack tons of masked tiles on top of one another in one or two spots without slowing the rendering process down much at all.

Coupled with some other features in the engine, this will also allow some other neat effects, which I will display in the future.


Tile Image Independence:
Each tile in a tileset is completely independent of any draw flags, animation info, or any other extraneous info about the tile. What does this mean?

This means that you could have two copies of an animated tile, say a water tile, on the map, and each is functionally unique while they share the same image set. So the water tile at the top of the screen can have waves rippling gently in the wind while the water tile that your character just stepped into can be displaying a splash animation.

Again, all extraneous info about a tile (besides the actual images) is not stored in the tile.

Animated Tiles:
Animated tiles that can have multiple animation states, varying speeds per frame, various loop states (PingPong, etc). The animation is not stored in the tile, but in the tileset, and each incarnation of an animated tile can have unique parameters.

Dynamic Data Loading:
...will add info later.

Advanced File Scheme:
...will add info later.

Seamless Travel:
This is possible thanks to the dynamic data loading along with the virtual layer system (you can go up or down floors within a building without any need for a pause to load, for instance).


A pretty big bite for my first real programming project. Of course, it's just the tip of the iceberg =).

More info soon, I hope.