How to stop Terrain Blocks from repeating
by Ken Finney · in Torque Game Engine · 02/03/2002 (9:50 pm) · 21 replies
Has been a hot topic in the past. Well, it's not so hard :)

What to do:
in terrRender.cc at the start of the method TerrainRender::emitTerrChunk (around line 411 or so)
add a check to see if this is the primary block or not:
void TerrainRender::emitTerrChunk(SquareStackNode *n, F32 squareDistance, U32 lightMask, bool farClip, bool drawDetails)
{
// KCF ******** add next two lines to stop terrain tile repeating
if(mBlockPos.x || mBlockPos.y)
return;
primary block's position is 0,0 so x & y both = 0.
note that there is a similar test already in there, but commented out - however that test is looking at the wrong object.

What to do:
in terrRender.cc at the start of the method TerrainRender::emitTerrChunk (around line 411 or so)
add a check to see if this is the primary block or not:
void TerrainRender::emitTerrChunk(SquareStackNode *n, F32 squareDistance, U32 lightMask, bool farClip, bool drawDetails)
{
// KCF ******** add next two lines to stop terrain tile repeating
if(mBlockPos.x || mBlockPos.y)
return;
primary block's position is 0,0 so x & y both = 0.
note that there is a similar test already in there, but commented out - however that test is looking at the wrong object.
About the author
#2
02/03/2002 (10:29 pm)
have you also found a way to stop the repeating of the shwados, but don't stop the terrain repeating? You know what i mean? So everything would be normal, but without the shadows on the repeated terrain.
#3
What do you think about introducing some "repeating side selection"?
For example: You have a coast. The beach leads from east to west. The ocean is in the north and the continent (or land) in the south.
Now you could select, that the E, W and S -Sides are repeated. The N-Side is "strechted until the horizon".
That way, you would have a working "forever-coast".
The only problem would be the NE SE SW and NW tiles, that would have to be filled somehow. But there must be some solution.
02/04/2002 (12:32 am)
@GG:What do you think about introducing some "repeating side selection"?
For example: You have a coast. The beach leads from east to west. The ocean is in the north and the continent (or land) in the south.
Now you could select, that the E, W and S -Sides are repeated. The N-Side is "strechted until the horizon".
That way, you would have a working "forever-coast".
The only problem would be the NE SE SW and NW tiles, that would have to be filled somehow. But there must be some solution.
#4
02/04/2002 (2:52 am)
Any noticeable performance increase upon doing that Mr. Finney?
#5
I also need to get rid of the repeating water blocks so that I can model lakes properly as well.
02/04/2002 (6:56 am)
Haven't check for fps issues yet, but I will tonight. My reason for doing this has nothing to do with fps - I'm modelling a place with 10,000 sq. km of area (real world location) surrounded by ocean with a small strait and a causeway to the mainland. Repeating terrain blocks interfere tremendously with the ocean-going and airborne vehicles 'experience' :-)I also need to get rid of the repeating water blocks so that I can model lakes properly as well.
#6
P.S. Ken, did stopping the terrain tiling stop repeating shadows from difs?
And what happens if there is not water? Can you walk to the edge of the terrain and look into the ether? OR walk off and fall into the ether?
02/04/2002 (8:04 am)
Seems like it would be fairly easy to implement a new "flag" for the terrain so that these options are selectable in the mission file. (turn the terrain tiling on or off).P.S. Ken, did stopping the terrain tiling stop repeating shadows from difs?
And what happens if there is not water? Can you walk to the edge of the terrain and look into the ether? OR walk off and fall into the ether?
#7
02/04/2002 (9:43 pm)
you might notice collision is still happening on the now not rendered terrain
#8
I'm still trying, I was just wondering if anyone else was.
Dark
02/08/2002 (6:17 pm)
Has anyone gotten the collision data to stop repeating? I've been trying off and on. It would be kind of cool to have a single terrain block set up to look as an island with water all around it. This is my goal anyway.I'm still trying, I was just wondering if anyone else was.
Dark
#9
When it's off you can fall off the edge of the world, and it stops rendering the tiled terrain.
When it's on the terrain tiles just like it's supposed to.
Right now I'm going to get the water to stop repeating. I'll make another bool for it too.
When I'm all finished I'll right a little tutorial and post it as a resource (giving Kenneth Finney credit for showing me how to stop the tiling).
Dark
02/08/2002 (7:44 pm)
Ok, I sat down and focused myself this time. It won't collide any more, and I made a bool you can set in the editor to turn tiling on or off.When it's off you can fall off the edge of the world, and it stops rendering the tiled terrain.
When it's on the terrain tiles just like it's supposed to.
Right now I'm going to get the water to stop repeating. I'll make another bool for it too.
When I'm all finished I'll right a little tutorial and post it as a resource (giving Kenneth Finney credit for showing me how to stop the tiling).
Dark
#10
02/08/2002 (11:44 pm)
Well, I'm glad you dug deeper. I started to the other night and literally fell asleep at my desk while browsing the source at around 2 am. My kids woke me up at 8 am - good thing too, or I'd have been late for work ...
#11
I'll probably write a little tutorial now, and figure out the water later.
02/09/2002 (9:13 am)
I can't fix the water until I figure out why it doesn't render like it's supposed to. If the original waterblock isn't at least partally in my view, the repeated waterblocks disappear. I have to be looking at the original or else I can't see the repeated ones.I'll probably write a little tutorial now, and figure out the water later.
#14
01/05/2004 (7:27 pm)
Did this tutorial ever get written?
#15
11/08/2004 (4:24 pm)
I have an Island when I take my plane and fly in one direction I find a duplicate Island I want to just have neverending water possible?
#16
It would also be nice to have a flat baseline terrain at 1m max height, and have it tile for ever, while on top of that, have a normal terrain block, no tile, that would act as an island, starting at 1m min height.
I really want and Island campaign map using ships. I know the wave magnitude is client only, so I wouldn't even use that feature, just a flat water block to have some battleships and other boats in multi-player, and I'll use model animation for the waves if I want to. But so far, I haven't seen anyone make a working boat. Come on! What is up with this. Again, this is 2008 and none of this is even standard yet with Torque.
When I saw the ad for the Torque Engine, back then it was themed, "Why make a mod when you can make a game?". I guess that was true, you have to "make it all" yourself, where with mods, its already made and you don't have to fight with the engine. Just drop in your boat and go.
02/09/2008 (9:17 pm)
Its 2008 and this is still an issue in TGE 1.5, How can we have a simple island with water that never ends? (ocean without a hole punched through). I would settle for "un-optimized" water block that would cut through the terrain. I would just place my tunnel system above sea level. All modern games can do this, NovaLogic has been the champion of Terra and Water systems. And this was back in 1999.It would also be nice to have a flat baseline terrain at 1m max height, and have it tile for ever, while on top of that, have a normal terrain block, no tile, that would act as an island, starting at 1m min height.
I really want and Island campaign map using ships. I know the wave magnitude is client only, so I wouldn't even use that feature, just a flat water block to have some battleships and other boats in multi-player, and I'll use model animation for the waves if I want to. But so far, I haven't seen anyone make a working boat. Come on! What is up with this. Again, this is 2008 and none of this is even standard yet with Torque.
When I saw the ad for the Torque Engine, back then it was themed, "Why make a mod when you can make a game?". I guess that was true, you have to "make it all" yourself, where with mods, its already made and you don't have to fight with the engine. Just drop in your boat and go.
#18
The main problem is the water block, it has holes in it when you set the terrain block to tile = "0"; And stitching together multiple water blocks is out of the question, it wouldn't provide infinite ocean; and that would be sloppy.
And if you do set the terrain to tile = 0, you'll have a single island (good) but no endless ocean floor (bad, especially when sinking ships).
For a moment I thought the "flood fill" was the problem, disabled it, didn't make a difference, still have holes in the ocean.
02/10/2008 (2:06 am)
Yeah, thats old news. Thanks though.The main problem is the water block, it has holes in it when you set the terrain block to tile = "0"; And stitching together multiple water blocks is out of the question, it wouldn't provide infinite ocean; and that would be sloppy.
And if you do set the terrain to tile = 0, you'll have a single island (good) but no endless ocean floor (bad, especially when sinking ships).
For a moment I thought the "flood fill" was the problem, disabled it, didn't make a difference, still have holes in the ocean.
#19
02/12/2008 (7:51 pm)
Really, does anyone have any information to keep the water block from generating holes while tiled?
#20
02/17/2008 (3:06 pm)
Anyone?
Associate Ken Finney
Tubetti World