Iris2.de
http://iris2.de/forum/

Uneven Terrain in 2D UO Client
http://iris2.de/forum/viewtopic.php?f=16&t=1123
Page 1 of 1

Author:  Avictus [ Thu Oct 18, 2007 10:33 pm ]
Post subject:  Uneven Terrain in 2D UO Client

I've been trying to figure this out for a few days now, hopefully someone in this forum can help me out. I'm trying to figure out how the 2D UO client implements uneven terrain. I believe Iris used to have a 2D client, so I'm assuming the developers figured this out. I would greatly appreciate some information on how this is done.

I'm trying to create my own isometric terrain engine, and I really liked the way UO's 2D client had uneven terrain, it made it look much more realistic. I'd love to be able to include this feature in my engine, I just can't figure out how they did it.

Thank you in advance for any help.

Author:  ghoulsblade [ Fri Oct 19, 2007 1:02 pm ]
Post subject: 

to try the 2d client, use the last stable iris version and switch with Z or so (see readme)

the trick we use for elevations is stretching the ground tiles, even in 2d mode. you basically need to draw textured polygons instead of sprites. this can be tricky depending on the lib you use, since it is rather a 3d technique "misused" for 2d.

an alternative would be to make "ramp" tiles, but you'll need lots of extra graphics (ramps in 8 directions, and possibly in multiple vertical angles) , and you have to place them, so that might be even more difficult, and it won't lend itself well to create uneven terrain.

good luck !

Author:  Avictus [ Fri Oct 19, 2007 2:24 pm ]
Post subject: 

Thank you very much for your reply. I was thinking of some ways to do it with textured polygons in OpenGL. It did seem easier to "cheat" by using 3D to draw the terrain.

Do you know if this is how the official UO client did it? This is more a curiosity than anything. It looks like I'm going to go the 3D route.

Again, thanks for your reply.

Author:  ghoulsblade [ Fri Oct 19, 2007 9:17 pm ]
Post subject: 

since the 2d client uses an orthographic cam to draw the terrain, there is no "perspektive depth" involved, so there is no difference between using 3d coordinates for the polygon and using 2d coordinates and calculate the "y += height*some_factor" yourself.

Author:  Avictus [ Sat Oct 27, 2007 4:31 pm ]
Post subject: 

I've decided to keep my terrain "2D" using textured quads. Originally I was going to generate a 3D terrain with textured quads and then draw my 2D sprites on top of it. What I'm going to do now is just draw a normal isometric 2D terrain, but offset the vertices on the Y axis according to the height of that particular vertex. This seems like it will be easier to mix with my 2D sprites then going with a full 3D terrain.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/