27/01/2010

Rebuilding the Tile Editor + Tile Engine - Part 1

Hello my followers..

Today I've entangled myself into a very unpleasant task. I noticed that my TileEngine, taken almost directly from Nick Gravelyn's tutorial, was incomplete and was lacking a few important features I may need in future for the game. Especially the Tile Editor was full of small bugs, references to directories and stuff like that. It was nearly unusable.

That is why I decided to completely rebuild it from zero. The appearance is almost the same (save a pretty nice toolbox at the top) but the underlying classes, file parsing and functions are all improved/modified. I decided to use a completely different set of classes and project/solution because keeping a lot of different projects inside my own Harmonia Warders solution, in Visual Studio, was making it a real mess (and the two versions, PC and Xbox360 were not certainly helping).

I had to re-write from scratch the Layer, CollisionLayer, TileMap leaving only the required functionalities. I took out all the NPC support, collision detection etc etc that is needed in the game itself since it's just an editor.

I also changed the save/load functions from a simple .txt file to an XML file with linked tiles (so I won't have to manually load them into the projects on VS) and a fixed folder structure. I won't use a different structure anyways so I see no real reason to make it more complex than it actually is.

The more interesting add-on I put, which is what mainly led to believe I needed a new TileEditor, is a nice ForeLayer. What is a ForeLayer you may ask? It's a ForeGround TileLayer. It's a normal layer that, in the draw function, will be drawn AFTER the characters, sprites, monsters, npc have been drawn. This way I can simulate a bit of prospective and make the NPC/Character go behind a house, or behind a tree or show clouds (with an alpha channel) or other stuff. It's really nice in my opinion and really needed to make a tiled RPG feel more "lively".

Today I've only managed the code for the Tile Editor, tomorrow (or as soon as I have time) I will modify/implement those functions inside the actual game and, who knows, a somekind of promotional video might pop-up if I can get it done nicely enough.

Thank you for reading, keep tuned for the Part 2 of this update, coming soon!

Cheers!

No comments:

Post a Comment