Tile Map - Building ground and houses

Started by
4 comments, last by SonicD007 11 years, 9 months ago
Hello guys, first of all, this is going to be a little complicated, since its mostly a matter of, I supposed, bad design on my part.

I have been building a map editor for the last months. Experiences with RPG Maker when I was younger made me thing about several things that I wished were different, and if you have used it, you most likely will understand my thoughts (or at least its what I hope)

One thing I decided would be different would be the way objects are placed on the map. In RPG Maker, you generally place objects such as trees on the scenery tile by tile, just like floor textures. I decided to go for a different approach and make things such as trees and big stones actual solid objects, just like a character, its not build one tile at a time, it has its own full sprite.

My problem began when I was thinking about big structures such as houses viewed from outside. Generally, on the aforementioned engine, houses would, like anything else, be built one tile at a time. This makes sense, and makes it easier to create houses on the actual map editor, rather than having to build them on an image editor first. The problem is that I designed my system so that each texture is its own file.

A grass texture that automaps its borders is nothing but 3 files (one for the center of the grass, 1 for inner grass borders, 1 for outer grass borders).

This way, to create something like a house using tiles, I would need over 30 texture files for each tile that could be part of the outside of the building. On RPG Maker, this process would be easier due to tilesets. A single image file containing several 32x32 textures side by side, on which you would be able to place a single house structure and modify it by placing tiles differently on the map.

Now, Im not sure if I should change my whole way of organizing tiles and start using tile maps instead of single files, since I'm really loving this model, EXCEPT for the issue with buildings! I have only worked with small games so far, so I never reached this point of having big maps to deal with.

TO THE POINT:

I would like opinions based on your experience. How do you usually build structures such as houses on your 2d games? Have you used the tileset method to store your texture files? What about using single files? What about single images for things such as a house viewed from outside? This could get a little complicated if you want to have hundreds of completely different house designs. But in that case it would require a lot of work either way.

Advertisement
Having a different file for each tile some what defeats the purpose of using a tile-based map, in my opinion.
Why not use a single tileset image and create "objects" to select from, using the tileset?
Its actually a different file for each texture, and the tile map basically contains a matrix of integers with the IDs of each texture, don't know if that's what you meant, since "a file for each tile" seems to mean something else. I just find the tileset concept too complicated, it doesn't make a lot of sense to me. I don't mean in a way such as I cannot understand how to implement it, but I see it as something that complicates the process, I have to edit the entire tileset if I want to adjust one texture, I would have to remove it from where it is or reorganize the entire thing, change references, it doesn't seem like the best idea, that why I wanted to go against it from the beginning.

Please proceed regarding how it would defeat the purpose.
I can't speak for how it might defeat the purpose, but regarding your comment about having to edit the entire tileset and reorganize the entire thing: Provided you don't plan to extend the number of textures you use indefinitely (ie you have a finite plan for where you are headed with this), would it not be simpler to create a single tileset with blank, unused spaces for future textures? If you want to remove a texture, just blank it out and eliminate the references. Adding a texture would just involve adding it to the tileset and creating a new reference. If it ends up disorganized, you can then reorganize it and change all your references, but I don't think you'd have to do that each and every edit.
I might be misunderstanding your question and over-simplifying it, but that seems like the most intuitive solution to me.
I've been trying to make a level editor for a while now and I have the basics done. I'm actually adding a grouping of tiles feature so you don't have to make a house 1 tile at a time. I also have can select multiple tiles by dragging from the tilesheet.

I think you should use sprite sheets instead of placing each texture into its own file. The pluses would be you can group tiles that belong to one level together for easy management and I THINK this takes up less memory. I believe that's the reason for having tile sheets as opposed to each tile having a file.

This way will require that you break up the sheet so to speak but if each tile is 32x32 or 16x16 you can do this easily. As for how to do this, what I did was I assigned each tileset an ID and I had two 2D arrays. One that held which tileset was where (ints represent the tilesets) and the second array told me which number tile in the tileset it was (also ints). To find out the tile I just had to find out how many rows and columns were in the tilesheet, then divide it up into whatever my tilesize was and then count up to whatever the tile array said was there.

I'm still working on tile animations but I have a basic system in place. I just have to get the animated tiles editor working. Let me know if you need more help.

Oh and each tileset has their own colorkey.
Double posted on accident

This topic is closed to new replies.

Advertisement