Game Development Community

Terrain/Waterblock interaction problems

by GregM · in Torque Game Engine · 12/15/2004 (11:05 am) · 6 replies

This was originally posted by my art guy in the art forums but we were referred to the private SDK forums so I am reposting it here.

Ben said it was better to post in TGE than RTS for this kind of problem since the RTS pack doesn't touch the terrain and water code much

Please pardon the spam.

********
I am working with the RTS kit and am having a problem with water that is stumping me. I have read and reread everything I can find on the subject with no luck.

The problem is that my "shore texture" will not render unless I move the water block AWAY from the terrain feature it should intersect with to create the shore line effect in the first place.

This is best illustrated by screen shots, please see the link for a more detailed explanation.

www.shapesandlines.com/SYBartproblems.htm

********

My art guy walked me through recreating the map and I was able to experiment some.
The map (see link above) is just a single island with a water block around it. He could not get the shore texture to render properly. When he moved the water block aside the shore texture began rendering off in the distance in the shape of the island!

I had him increase the size of the waterblock so that it encompassed the island again but now it clips around the island in a jagged hole of squares (look about 32 by 32 each). The shore texture in the outline of the island is off in the distance. Moving the waterblock to line it up with the island just causes the shore texture to disappear as it gets closer.

#1
12/15/2004 (11:18 am)
What is your terrain BlockSize? I remember several issues with waterblocks and a Terrain BlockSize different than 8, but I have no idea if they have been fixed or not.

If yours is other than 8, you may want to search the forums for that and see what the current status is.
#2
12/15/2004 (12:02 pm)
Stephen, That indeed was the problem. In fact I vaguely remembered readng about that and asked my art guy if he had changed it. I couldn't find where to set it and had assumed it was a sane value.

It turns out that the default mission map for the RTS had a squaresize of 5.
When we imported a new heightmap it took the old squaresize of 5.

I was under the impression that there were no sane odd values for squaresize.
#3
12/20/2004 (2:17 pm)
Not at all. It's just that a lot of code works under the assumption of 8, so things like waterblocks tend to mess up...
#4
06/10/2005 (1:31 am)
Greetings,

I am having a similar problem of the shore textures not showing up. I have the default parameters and I have not changed the terrain data.
BlockSize = 256,
      BlockShift = 8,
      LightmapSize = 512,
      LightmapShift = 9,
      ChunkSquareWidth = 64,
      ChunkSize = 4,
      ChunkDownShift = 2,
      ChunkShift = BlockShift - ChunkDownShift,
      BlockSquareWidth = 256,
      SquareMaxPoints = 1024,
      BlockMask = 255,
      GridMapSize = 0x15555,
      FlagMapWidth = 128, ///< Flags that map is for 2x2 squares.
      FlagMapMask = 127,
      MaxMipLevel = 6,
      NumBaseTextures = 16,
      MaterialGroups = 8,
      MaxEmptyRunPairs = 100

Any idea? I'm using Torque 1.2

Thanks.
#5
06/10/2005 (9:19 pm)
Found the problem.

My water was very shallow and the ShoreDepth in the water datablock was too large.

Thanks.
#6
09/28/2005 (11:00 am)
Here is a fix for the waterblock hole issue when the terrain squareSize is changed.