Jump to content
  • Advertisement
Sign in to follow this  
nex7

Rendering Technique

This topic is 4414 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

Looking around at other games...and a few websites here and there I've noticed a large difference in the way I draw tiles and the way everyone else draws tiles.... The first time i read Jim Adams' Introduction to isometric engines I was under the impression that you were supposed to draw your tile map like this: so...in this vein i created my tile map....which does exactly that. now since then I have seen others (everyone else) render their tile maps like this: Can one of you ISO pros shed some light on this for me. Which is better (probably the latter due to its popularity) and why? Thanks! [Edited by - nex7 on June 16, 2006 2:25:46 PM]

Share this post


Link to post
Share on other sites
Advertisement
My first iso engine was created in manner of your first example. It ran fine. But after half year of programming I had a BIG problem. When I tried to create a rectangular iso rooms I had to erase some areas from map, which led to non-optimal memory usage. Changes to new approach taked me a 3 week of my life[smile].
For example in second approach for erase a rectangular area on map, you do two 'for' loops. On first I had to do it with bunch of 'if'-s and similar.
Three lines of code for 2nd example and 70-80 lines of code for first. Which is simplier[smile]?
Also coordinate manipulation is much more easier for second than first example.

"Which is better (probably the latter due to its popularity)..."
If something is popular that doesn't mean that is good (better). [smile] In this case it is BETTER and that's reason why it is so popular :D

Share this post


Link to post
Share on other sites
The second view just confuses me..

Is there a good example on that type of rendering somewhere?

because that just screws up my head to try and think about scrolling around.

i mean when you go right...your going..down and right....sorta...

i know i just have to get the idea into my head but right now im stumped.

Share this post


Link to post
Share on other sites
even the math...if someone could post some scrolling and tile finding math for that view...

that would be great.

it just looks wierd...i mean really..who draws from right to left?

Share this post


Link to post
Share on other sites
Soon I'll upload tutorial on rendering this type of engine on my website. It is too much code for one simple post. Patience[smile]

Share this post


Link to post
Share on other sites
For those of you reading the post who have made iso engines...do you use the first or second technique to render your tiles???

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
My twopenn'th: both are accurate for me. I render my tiles in the order described in the first image, but I actually store the tiles in the order described in the second image (assuming the top number's the x coord, and the bottom's the y) - that is, the tilemap is one big 2D array, which makes it easy to do all the internal game logic, etc.



Share this post


Link to post
Share on other sites
welp...over the weekend i was able to implement the diamond shaped tile map...im going to need a way to cull the non visible tiles but ill figure that out later.

the mouse mapping logic was a bit tricky but the tile plotting was a LOT easier than the staggered map.

Share this post


Link to post
Share on other sites
Going the diamond shape is by far the 'nicest' approach...if you use matrices for your view transforms.

If your tiles are 40*20, then you render them like this (pseudo-code):


viewmatrix = [[20, -20]
[10, 10]]

for ( x = 0; x < mapwidth; x++ )
{
for ( y = 0; y < mapheight; y++ )
{
p = [x, y]
p' = viewmatrix * p

blit( tile, p' )
}
}


A basic grasp of linear algebra is needed though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!