Isometric terrain with uneven tiles

Howdy all,

I’ve been playing around with some ideas on how to create isometric games with uneven ground. In my current version every tile has its corner heights defined, so I can easily create more interesting terrain compared to those flat ones.

Example: http://4.bp.blogspot.com/_ahF-tM2HtPE/SVBel-aSrmI/AAAAAAAAAAM/Lp-OfzKhM1A/s1600-h/Kuvakaappaus_1.png

Now I’m wondering, how am I to apply textures to tiles such as these? Or if it’s possible at all (in plain 2D) and if I’ll have to abandon this polygon-based terrain stuff completely. Whichever it is, I haven’t really been able to find anything which would have helped me on this question.

That screen shot is pretty neat ;D. Is that purely 2D rendered?

For my current isometric game, I am using a stack of tiles to represent height like so:
http://www.gamedev.net/reference/articles/article738.asp

That isn’t exactly what your looking for but I think the general idea will be the same.

at (1, 0) you have a tile that has an a primary part, the diamond, and a secondary part, the little triangle. You could associate textures with the primary and secondary parts of a type of terrain. For example a grass terrain type might have a green texture for the primary (the grass) and a brown texture for the secondary (the dirt). To manipulate the textures to fit those shapes, you should google Java2D shearing, but it would be much easier (and faster) if you used JOGL or LWJGL. I say that it would be easier with OpenGL because OpenGL automatically fits your textures to your shapes.

Thanks :). And yes, that’s pure 2D with simple polygons formed from text file data. I’m way too unfamiliar with the game development side of Java to do anything more complicated than this :stuck_out_tongue:

But thanks to this

I know what I should try next. I did some really-not-so-thorough research on these but they seemed too much of a overkill to do something as simple as 2D-tile texturing. D’oh, I guess.

Oh, I’ve also read that tutorial you posted. Good stuff, just like all the other gamedev tut’s out there. Helped me so much that I only really wanted to know how to stretch, twist 'n turn textures to make them fit those “strange” tiles. And now I might know. Thanks.

I wrote some code once which fills an arbitrary quad with an image’s pixel data. It’s pretty basic & slow but I guess it might do for what you have in mind? (has to be better than becoming dependent on native GL libraries!)

Righto, JOGL did the job. Turned out to be quite easy, really. But still, being interested enough I think I’ll have to see and try to do it without any GL libraries.

hi, I don’t have the answer for your question… but I think you can help me… :stuck_out_tongue: I have posted a thread here asking how to transform my current rendering method to uso iso tiles. Are you able to give me a help? Please use the thread I used to post. Thanks a lot.

I actually like the original terrain, it’s more rugged. I kinda like the cliffs etc, forces players to walk around them…

You might want to look at the last reply date next time :wink:

Well Ill use this thread anyway, because I had just the same idea, to experiment with different heights for every corner in a tile map, and I have the same problem, applying correct lighting and textures. On one hand, I would appreciate any more ideas considering the problem. On the other hand, I’d like to share my ideas so far:

My first attempt would be using a simple flat texturing, so that the texture is not perspectively morphed but just clipped to the tiles shape. And to create the look of depth just using lighting / shadows on each tile. That could be done by manipulating the image data and lighten or darken pixels row by row, or painting a fading from light white or black to transparent over the tile. Anyway, one really needs to buffer the result and do the texturing only once, everything else would be to slow.

My attempt number two would be writing my own texture routine. I have the book from David Brackeend and he describes 3d software rendering and texturing. Using some rather simple math is already enough to calculate the position of each point of a texture to a destination point on the morphed tile. For each different shape and texture, you’d need to at least one apply the texture to the tile shape by calculation each pixel value using 3d math. You probably want to buffer the resulting images, for you cannot calculate this every frame.

The problem here is not actually texturing but perspective morphing. Isometric graphics use some simple math to produce results that look like having a perspective. When you consider it the way a 3d engine does, each tile is a flat shape with some angle along the 3 axes. There is some math involved in projecting a shape in 3d into a view from a given point of view. The basic calculations for 3d transforming can probably found on the web.

-JAW

I’d probably just try to be tricky about angling my hills and then use OpenGL to draw full sized quads except at the edges - that way the texture isn’t squished or resized any weird ways. Although I imagine just letting OpenGL draw using your 4 texture coordinates might be just fine anyway.

Here are some Java sources I wrote earlier (see section 2):
http://www.noblemaster.com/public/