Jump to content

Multiple Terrain in a scene


martyj
 Share

Recommended Posts

I'm using Leadwerks 3.1 (Steam edition) atm. I will upgrade as soon as the C++ version comes out.

 

I was wondering how I could add multiple terrain per a scene.

 

I have a map that I'd like to implmenet with a vast range of textures.

 

The heightmap size is 12288x7543.

Link to comment
Share on other sites

This is currently not possible in the editor. You would have to make your own terrain generation/import module.

 

This is not the easiest thing to make yourself though. It is not something that can be easily done with just a tutorial. This requires advanced algorithms, shader knowledge and a huge amount of finetuning.

Link to comment
Share on other sites

I haven't tried this yet but am considering it. Since there are 16 layers in the editor maybe you could set min/max limits to each type of texture. For instance layer 2 at max 20, layer 3 min 20 max 50, layer 4 min 50 max 70 etc. I haven't worked on terrain for a while so this may not be completely accurate but that is the idea. Kind of like the real world with texture and vegetation changing at different altitudes. This would take a lot of planning but it seems that it would be possible. You may have to adjust your terrain heights manually to accommodate this method. Like I said I haven't tried this yet but will soon. Hope it works because I need the same option.

Link to comment
Share on other sites

@martyj; There are a couple of questions that you should probably answer to yourself before putting work into this:

  • What is actually the "real-world" size of your terrain? If the heightmap size you have given is the number of pixels - how many units (meters) per pixel do you have? More than 1 m/pixel? Very large maps will create problems due to floating point errors far away from the origin (say, more than 16k in either direction), leading to rendering artifacts and physics problems. There are ways to counter this, but it's an additional complexity.
  • Do you really need such a large terrain? Does your game idea call for it? How fast will the player move through the terrain? How are you filling such an enormous terrain with interesting gameplay?
  • The dimensions of your heightmap are slightly unusual, normally you will find powers of two, and most often square dimensions (like 1024x1024, 2048x2048 and so on), not the least because GPUs are optimized for handling textures of those dimensions.
  • Objects (trees, enemies, houses, ...) for such a terrain can't be kept simultaneously, they will have to be streamed in and out according to player movement.

EDIT: @MajorAF, just saw your post in the Tutorial Request thread. As far as I know, Combat Helo uses terrain tiles that are streamed in and out of memory. But that's not part of the built-in Leadwerks 2 terrain, but a custom implementation. You might ask community member "Flexman" about this, he's one of the authors. But again, all of these large terrain solutions are hand-crafted and don't come with the engine.

Link to comment
Share on other sites

@Rastar The heightmap is for a MMO. Is there a easy way to switch out different terrains depending on the area you are in?

 

I don't need to implmenet the full sized for a while but in the full vision I would want to.

 

I just want to know is it possible to have, let's say a WoW sized terrain with leadwerks. Even if it's soley in the C++ version

Link to comment
Share on other sites

This can not be done with just a single command from the API. If you want to stream other world parts in your current level, then you will have to make your own implementation. Like said by Rastar, that is pretty complex and requires a custom made solution.

 

you can load another level if you want to which has different terrain, but then you will want to discard the old one

  • Upvote 1
Link to comment
Share on other sites

As Aggror said - possible: yes, easy: no. You basically have two options:

 

1) Use the built-in terrain and map system. Split your terrain over several maps and change the maps during run-time. You could pre-load the next map in a separate thread to reduce swapping time, but the transition will be visually noticeable, so you might need a loading screen or something like that.

 

2) Implement a streaming terrain solution. Leadwerks currently doesn't provide a lot in that area (few engines do), so you would have to do everything yourself. For example, you could use tiled meshes arranged in a checkerboard-like pattern and load/unload them (and their contents) as the player moves.

 

It probably depends a little on how much experience in game development you have. If you are just starting out, consider doing something smaller, otherwise you might quickly get frustrated. Otherwise - it's a fascinating journey ahead of you, but a long and twisted one.. :)

  • Upvote 2
Link to comment
Share on other sites

I'm fascinated by Rastar's terrain mesh tessellation exploration.

 

With large landscapes once you've licked the problem of the terrain mesh you have to deal with vegetation then any civilization layer for roads/buildings and finally collisions. It all adds up to (as Rastar says); a long and twisted journey. So I would seriously consider something small if you can get away with it.

 

Having multiple-terrain objects in a scene and having everything in it parented to the terrain entity would be ideal.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...