Rendering Technique

Started by
14 comments, last by GameDev.net 17 years, 10 months ago
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]
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
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.

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?
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]

For those of you reading the post who have made iso engines...do you use the first or second technique to render your tiles???
well i was making that way too hard
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.



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.
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.
-LuctusIn the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move - Douglas Adams

This topic is closed to new replies.

Advertisement