Game Development Community

BUG: Waterblock is WRONG

by Nicolai Dutka · in Torque Game Engine Advanced · 04/29/2009 (8:36 am) · 4 replies

I placed a waterblock in my level which I copied out of the default Stronghold level. When I place it in my level, I can clearly see the texture does NOT cover the bounding box/extents of the actual water volume.... When I place a default waterblock, it works, but as soon as I start scaling it up, the texture stops going all the way to the edges of the waterblock.

WORSE:

I can CLEARLY see where the extents of the waterblock are in my level, yet when I move a player who is at least 30 meters away, I am seeing the damn water splash emitters on my character! It's like Torque is treating the water as if it covers the ENTIRE level!!! This is fuckin TERRIBLE!!

Torque needs to make use of "volumes" the way Unreal does it... I should be able to place in a volume ANYWHERE I want, including making volumes overlap, and the player should ONLY 'swim' or be effected by the water volume if they enter that specific volume! I need to be able to place little pockets of liquid ANYWHER I WANT without worrying about it effecting the whole level...


Anyway, why would my player be displaying water splashes if the waterblock i placed is nowhere near the player?

#1
04/29/2009 (10:11 am)
Calm down and submit a professional bug report including:

  • Version of TGEA being used
  • Verification that the issue appears in a stock copy of that version (I tested it in stock TGEA 1.x.x and the same thing happened)
  • The full set of WaterBlock settings (copy/paste from the .mis is fine)
  • Screenshots of the issue

And I will look into it.
#2
04/29/2009 (10:20 am)
I changed one setting and got it to look normal:

Grid Size: 100

Change to:

Grid Size: 1


This makes the texture fully reach the edges of the waterblock. And my player is no longer swimming in invisible water. :)
#3
04/29/2009 (3:31 pm)
The problem here is that the Grid Size needs to be a equally divisible number of the scale's x and y values.

Example.
If the scale on the water block is 2048 then the grid size must be something like 102.4.
102.4 will divide into 2048 by 20.
When the water block is setup the vertex is created by using
mWidth   = (U32)mFloor( mObjScale.x / mGridElementSize ) + 1;
mHeight  = (U32)mFloor( mObjScale.y / mGridElementSize ) + 1;
mWidth and mHeight are used later to run thru a for loop to create the vertex data.
As you can see mGridElementSize,a F32, is used to produce a integer.
And consequently if the gridsize cannot be divide into mObjScale.x's or mObjScale.y's without a remainder the vertex will be setup slightly smaller than the objects scale.

This is not a bug. At best I would say that Gridsize's use should be more clearly defined for the user.
#4
04/29/2009 (3:41 pm)
In TGEA 1.8.x trunk I've fixed that limitation, so waterblock properly deals with the edge case (pun intended) and always extends to its full size without issues. Also, I'm probably going to rename GridSize to VertexSpacing or similar.