Game Development Community

Maximum terrain size in T3D?

by Vincent Ellis · in Torque 3D Beginner · 09/19/2013 (6:30 pm) · 11 replies

What is the maximum terrain size in T3D? Apart from LOD, is there a culling technique built-in to avoid lag in multiplayer games with large terrains?

#1
09/19/2013 (8:05 pm)
The maximum size for a heightmap is 2048px x 2048px but there's a resource somewhere, I think from Andy Wright, that allows up to 4096px. Torque then uses the terrain grid to set the meters-per-pixel to whatever works for you. Higher ratios (4 meters per pixel for example) with create a larger lower resolution terrain, and smaller ratios will give you smaller higher resolution terrains.

I Torque unit is 1 meter, so a 2048px heightmap with a 1:1 ratio will produce a terrain that is 2,048 meters across. The same heightmap with a 4:1 ratio will give you roughly a 64km square terrain. And that's huge.
#2
09/20/2013 (2:20 am)
4096px is max, 8192px will crash.
4x4km would be 16 square kilometer, you can also use grid size 2 on it, that is still acceptable, so 64 square kilometers is the biggest you can get without stretching the grid size unrealistically.
#3
09/20/2013 (2:55 am)
There is zoning to reduce draw targets and processing of entities that are not in range. I don't know much more than that, and that is regurgitation.
#4
09/20/2013 (3:18 am)
I'm using a 8192px texture base terrain. The problem is the application can't load 8192x8192x3 bytes without crashing, because there is a limit of 2GB, like I said here:
www.garagegames.com/community/forums/viewthread/135124
#5
09/20/2013 (4:57 am)
A problem I am having.... the height scaling doesn't seem to let me go above 1024, so if I make a 4m/p terrain it is very flat.
#6
09/20/2013 (5:05 am)
The max height (as far as I've been able to ascertain) is quarter (or maybe half)of the heightmap's size. Thus, a 2048px heightmap will have a max height of 1024px. I believe this is because the generated .ter file is actually a cube of 2048x2048x2048 and the terrain is drawn within that from the center of that cube, with the average height being at the center of the cube.

The way I work with it is to divide the size of the imported heightmap by 4 and use that as the max height. It results in the terrain being exactly the same relative height as it is in World Machine, which I use to build my terrains. This way, a 2048px heightmap will have a max height of 512 at the standard 1:1 ratio. If I want a 2:1 ratio (2 meters per pixel) which will give me an effective 4096 Torque units - or 4,096 meters - I'd set the height to 1024.

Hope this is helpful.
#7
09/20/2013 (5:12 am)
Thanks Dan. That makes sense.

But how then can we make terrains that are bigger than 2m/p? Are we not basically saying the size is limited to 4km then, else our mountains become bumps?
#8
09/20/2013 (5:26 am)
I've taken a 2048px heightmap and imported it with a 4:1 ratio and 2048 height. That is plenty high, believe me. In fact, ask the guys at Winterleaf Entertainment for a peek. ;)
#9
09/20/2013 (6:05 am)
You can enter the height-scale manually when importing heightmaps, so you can set it whatever you want.
#10
09/25/2013 (11:14 pm)
Also as it`s said in manual it is possible to add another terrain blocks. It looks for me that Torque 3D has tool to make almost endless world, but this statement was not prooved in real life.
#11
09/27/2013 (8:25 pm)
You can stitch terrains endlessly, BUT because of floating point precision you are quickly limited.

I.E. your objects won't be in the correct place the farther you go from 0, 0, 0.

there are ways of getting around this, but you'll have to google it :-)