Members - Reputation: 1422
Posted 04 July 2012 - 03:28 PM
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.
Members - Reputation: 1422
Posted 04 July 2012 - 04:11 PM
Please proceed regarding how it would defeat the purpose.
Members - Reputation: 620
Posted 04 July 2012 - 06:38 PM
I might be misunderstanding your question and over-simplifying it, but that seems like the most intuitive solution to me.
Members - Reputation: 464
Posted 05 July 2012 - 07:47 AM
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.