Thursday, March 18, 2010

Back to "Work"

I know my previous post was only yesterday, but I thought I would show you what I managed to do in the couple of hours I've been awake. I mentioned earlier I had planned on paper the 'AutoTile' feature I wanted for my map editor and it really helped with the amount of time it took to code this:



As you can see, just by placing Water\Ground tiles the editor automatically fills in the edges for me so I don't have to. I know there is no pretty UI at the moment. But because I rewrote the engine, I haven't implemented it fully yet. Well enough to be of any use for this.

The way this works is pretty simple. The map consists of 4 layers, which only 2 of are used in the video. Layer 0 represents ground data. In this case only grass and water. Layer 1 contains edge data, which my "auto edge" function works out based on the ground tiles in use. To save memory, only Layer 0 is required to have valid 'Cells' loaded at all times. So when you see no edge, that means that the cell on the Edge Layer doesn't exist. In other words == NULL.

You might have noticed some choppieness when I started to tile. This is because at the moment, my resource manager is loading images on demand. Just as before, if the image has already been loaded, it is found and a pointer to it is returned instead of loading the image again. I can fix this by having the map load all the images it will need before hand, but I will get to that later when I reimplement my map loading feature.

Well this was just a quick update to let you know I'm still working!