Skip to main content
GameDev.net gamedev.net
🔒 Locked

Draw buildings in 2d iso diamond world

Started by brainydexter Mar 26, 2008 at 5:14 AM 3 replies 2k views
Original Post
brainydexter
brainydexter
I have a 2d isometric tiles(64 by 32) system drawn in diamond manner. It took me some time to understand the basics of this and draw the same. I want to now, place buildings on this isometric world. I have been searching a lot of places, but I get boggled down. Can any1 please suggest me as to how to approach this. I want to keep things simple as of now. I would like to know as to what kind of art would i need..dimensions or any other info would help! Also how to go about the whole thing of plotting buildings. Im developing the code in C++ in tandem with SFML.
Wyrframe
Wyrframe
Simple approach for buildings; very, very tall tiles. Start doing your tile position math relative to the bottom corners, or allow a tall tile to offset upwards by its height minus the default tile height from the "base" position. See this quick & dirty testing tileset for reference...



The base size of each tile is 48x24 pixels, but takes up 48x32 in the graphic set so I can have slopes. The small house fits inside that 48x32 envelope fine, as does the Wierd Blue Thing (that's all I called it when I drew it), but the Hospital Tower and its Emergency Entrance attachment are taller than that; just draw their base in the same places a tile's normal base would be, and all works out fine.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
brainydexter
brainydexter
This is my take on your reply , wyrframe, if i draw the buildings as u suggest.. I think the objects behind a given object would be hidden or not viewable..since we'd be drawing them in a given order ( for loop) and thus the obscurity. This is what I imagine, and if I am correct, it wont really solve the purpose, right?

I might be wrong, but Id like somebody to guide me on this.

Thanks
Woron kar DeDulle
Woron kar DeDulle
hm, could you tell more about your map you are drawing? Does it have multiple heights? Do you have problems just drawing it or do you need also help how to store the data? I have never worked with SFML but maybe I can help more on.

The easiest way is if you have only one flat layer of terrain and want to place buildings with an base area of one cell on it. Personally I think the best way to do this is to draw the complete terrain first and within a second loop draw the buildings (so buildings can not be covered by the terrain).
BEHOLDER192875
BEHOLDER192875
Rendering order is so important. Even if you did render the objects on the terrain in the correct order then you gotta worry about the correct placement of the moveable objects (ie, a character, a car, or whatever). That will create somewhat of a speed hit because you will be shifting between textures. There is no other option if you have alpha values in your textures, but if you keep it simple then it wont be a big deal, and you can just draw everything at once in the correct order of course. Using a z-buffer would be quite useful in that case.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.