3D Terrain

Hi there,

I’m interested in creating a 3D terrain application, as the start of some work on a MMORPG. However all the examples I’ve seen on the net so far don’t allow 2 players to stand above each other, i.e. same longitude and latitude but different alititue.

Does anyone have any thoughts on how this could be implemented to give my terrain application a realistic 3D look. I’m not really keen on using a 3D array of points, since that will only have a finite number of positions, I’d like something a bit better than that.

If it makes any difference to the solution I’d like to use gl4java as my implementation rather than Java3D.

Thanks for any help you can give,

Andy.

To me this sounds like a data structure question rather than a 3D graphics one. Either of the rendering APIs you mention can handle having one object above another as easily as beside each other or below each other. Have you been looking at the 2 1/2 D systems like the Doom engine? I can’t imagine that any modern application of this type would be constrained in this way.

From what I’ve seen of the Doom/Quake engines, they’re really good at doing worlds that are enclosed/indoor spaces. I’d like to create an outside world similar to Everquest. This outside world could have mountains, and ravines, cliffs with overhangs etc, so I need a data structure that will hold all this info for a huge map.

I’m planning on having many sectors, but only loading 9, the one you’re in and the 8 surrounding sectors, that way I’m hoping I’ll bve able to render parts of the world that are far off in the distance. As you move from sector to sector, I’ll unload some sectors, and load in the new ones, so that I always have the 9 in your vicinity.

Java3D can handle this very well- it is a huge amount of work to put the world together, but the system is more than up to it.

We’ve had a bunch of people looking to start putting together MMPORGs lately- maybe everyone interested should look to working together on this.

Take a look through the archive for articles by David Yazel (wizardofid) for more background on the progress of magicosm ( http://www.cosm-game.com ) which combines being the only serious Java3D MMPORG with being the platform’s current showpiece project. He is probably the leading expert on the topic.

From a data structure point-of-view, I suggest that what you have is three basic structures to build your world.

At the most basic level you may need a heightmap, as there is always ground somewhere.

I would then generate an octree of the actual geometry that the heightmap produces upon loading the sector.

The octree solves the problem of having things on different levels.

The next data structure you need is probably directly going to be the geometry of overhangs and caves or other more three dimensional structures. Most of your map won’t have any such structures in, I’m guessing, which is why you can stash the floor in the memory-and-bandwidth efficient heightmap format. However the overhangs may as well be stored directly as polygons, and shoved straight into the octree.

You can also add smaller lumps of repeating scenery at this point - trees, walls, rocks and things like that - and place them directly in the octree.

The complexity then comes from collision detection, made slightly easier by the octree, but made slightly more complex than a traditional BSP because you have to do a bit more checking against individual polygons.

Cas :slight_smile:

There was a couple of good IOTD over at flipcode.com on terrain techniques, the most interesting one being based on meta-balls: Gives completly free-form geometry, simplifies collision and texturing and was used in an oct-tree for rebuilding only the surfaces that had changed.

Probably good for calculating LOD from as well, you can’t have a decent terrain rendering without some sort of LOD in there 8) And if you were to go completly overboard then you could go for worms style totally deformable landscape…

Just an alternative method for you to ponder over.

Thanks for the ideas so far, this is all great stuff.

I definately want to be able to change the terrain, either through things like earthquakes/volcanoes (natural events), or through things like explosions (caused by players).

So my early choice look like:

  1. Meta-balls (which I’ll have to go and look at)
  2. a height-map with extra poly info for overhangs etc.

Anyone have any thoughts on which is likely to be harder to implement or slower to execute once done? I know this will depend on my coding skills, but is one of these going to require 100 sqrts/pixel more than the other technique?

Cheers,

Andy.

I to Google and searched flipcode.com for meta balls and could not find anything. ???

Any idea where I could get some more info on this? Thanks!

I think the mentioned IOTD was the one from the 24. of april this year:
http://www.flipcode.com/cgi-bin/msg.cgi?showThread=04-24-2002&forum=iotd&id=-1

Hope this help!