Sign in to follow this  

Making the tiles look 3d and overlap each other?

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to create something with the graphics similar to Civ 3. How do they achieve the 3d look? For instance, the tallest mountains actually cover up part of the tile above them. Here's the screen shot I'm talking about: Thanks. -Nick

Share this post


Link to post
Share on other sites
The tiles are drawn top to bottom so the closer ones will cover the ones that are further away. Or you could use Direct3D to actually make it in 3D with an orthographic view.

Share this post


Link to post
Share on other sites
couldn't you also do something like draw the map in layers? Ie: first you draw the "ground" layer, then the "elevation" layer, then the "cities" layer, and then the "sprite" layer? I dunno, that's kinda what I'm thinking about implementing right now (using only 2 layers).

Share this post


Link to post
Share on other sites
Not exactly, the layers would still need drawn top to bottom, otherwise the top of a mountain would be overdrawn by the bottom of the one above it.

Though I implimented a nice layer system, and it's working out fabulously. Though I have more layers, and they're not a fixed number.

Share this post


Link to post
Share on other sites
There is a funny problem about isometrics. You should definatly draw from top row to bottom row. But there is a problem.

Suppose each location could have several items stacked ontop of it.

An example would be if I made a generic block texture and I want to tile several blocks ontop of eachother to make a wall.

Then people tend to draw the ground tile, which calls some draw for each tile stacked ontop of it. The advantage to this system is that you will be keeping the top to bottom drawing and items of various heights will still render correctly.

The drawback is...say I have a huge pillar with 100 tiles stacked ontop of eachother. If I draw it top to bottom, no problem. But what happens when the screen moves up enough so that pillar's base is now off-screen. The base will never be drawn, thus its children tiles will never be drawn. It will appear like you walk one step and the whole pillar dissappeared.

That is where layers are often put to use. You can correct this problem with layers but then you need some clever layer management or you will be left with 100 layers for this pillar.

Anyway, I hope that helped.

Share this post


Link to post
Share on other sites
Quote:
Original post by ProgramMax
That is where layers are often put to use. You can correct this problem with layers but then you need some clever layer management or you will be left with 100 layers for this pillar.


Would it not solve this problem to just render a larger portion of the map in a buffer and then just blit the visible part?

Share this post


Link to post
Share on other sites
Quote:
Original post by sicu
Quote:
Original post by ProgramMax
That is where layers are often put to use. You can correct this problem with layers but then you need some clever layer management or you will be left with 100 layers for this pillar.


Would it not solve this problem to just render a larger portion of the map in a buffer and then just blit the visible part?


I'm sure it would as long as you made sure that your render portion was signficantly large enough. But the problem with this is that with all the extra drawing you can be sure to take a performance hit.

Share this post


Link to post
Share on other sites
It cant really need to be that much of a performance problem. Half a screen extra should be plenty. Im sure there is a nice algorithm for calculating the extra size depending on the "cameras" distance to the centre of the screen. But as far as I can see, you wouldnt need much more space, since if its further down, your camera would be infront of the stacked objects. And since you only see objects stacked below the screen you do not have to check the other sides, just the screen below.

Share this post


Link to post
Share on other sites
Why render the whole lot at the bottom of the buffer ? If you know the height of the items, then you can check the map locations off the bottom of the screen for what items need to be drawn. Then you only draw the portion thats visible.
Checking for visibility would be trivial compared to drawing the objects - and since you might only have a few objects its relevant to, you'll save heaps over using a larger buffer.

Share this post


Link to post
Share on other sites
Well, it's just theory. :p

Drawing half a screen extra wouldnt take that much extra time and your drawing routine would be smaller, since you wouldnt have to do the checks if its on screen or not etc. Just draw it. Obviously depending on complexity of your game.

Share this post


Link to post
Share on other sites
In my isometric engine for Golem, that is exactly what I did. I simply extended the area to draw 'downward' far enough to account for the highest possible object, then drew the area. Even with all the game mechanics (spellcasting, enemy movement, particle systems,e tc..) I still maintained fps of about 75 on a GeForce2.

For the record, I do the same with the Golem3D engine (since it is tile-based as well), though since the view is perspective projected, the visible area is wedge shaped rather than rectangular, so extending the drawing area causes even less of a performance hit, and I maintain about 105 fps on a Geforce2.

Share this post


Link to post
Share on other sites

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this