[T3D 1.1a Bug] River causes infinite loop online
by Joshua Halls (Xerves) · in Torque 3D Professional · 11/29/2009 (8:32 pm) · 7 replies
River seems to load just fine in single player, but when trying to load it when connecting to a server it gets stuck around line 1336 in this while loop.
rowsize simply is never less than mMaxDivisionSize. This doesn't seem to be an issue in single player though and this loop happens when the client connects to the server to load the zone.
while ( rowSize > mMaxDivisionSize )
{
numRows++;
rowSize = segLength / numRows;
}rowsize simply is never less than mMaxDivisionSize. This doesn't seem to be an issue in single player though and this loop happens when the client connects to the server to load the zone.
About the author
Part of the team that works on The Repopulation, a SciFi based MMO using a heavily modified version of the Torque MMO Kit - T3D. I also take care of the T3D version of the Torque MMO Kit.
#2
12/01/2009 (6:56 am)
It seems to be getting dirty information as the value is set to some really small number. Need to take a look and see if it is something we garbled up or not as all of the values are pretty much screwed up. It should be .25 as it is when I debug locally, but something is getting out of whack going from a dedicated server to the client. Just removed the river for now as we have some other things to attend to first.
#3
BTW mMaxDivisionSize is controlled by the field SubdivideLength or the ConsoleMethod setMaxDivisionSize. I noticed that the min value of 0.25 is enforced only if the field is assigned to from the inspector or from the ConsoleMethod call. So assigning the field directly from the console or in script to a value smaller than 0.25 would cause this.
12/01/2009 (2:59 pm)
Have you made any changes to River or WaterObject? In particular its pack/unpack? BTW mMaxDivisionSize is controlled by the field SubdivideLength or the ConsoleMethod setMaxDivisionSize. I noticed that the min value of 0.25 is enforced only if the field is assigned to from the inspector or from the ConsoleMethod call. So assigning the field directly from the console or in script to a value smaller than 0.25 would cause this.
#4
12/01/2009 (7:21 pm)
This is the current river we have. Might notice two of the nodes commented out. If 2 nodes are removed it loads just fine (tried both the front and back and it loads). Not sure if that helps, but probably points to something we didn't do :-).new River() {
SegmentLength = "10";
SubdivideLength = "2.5";
FlowMagnitude = "2";
LowLODDistance = "50";
density = "1";
viscosity = "1.5";
liquidType = "Water";
baseColor = "45 108 171 255";
fresnelBias = "0.3";
fresnelPower = "6";
waveDir[0] = "0 1";
waveDir[1] = "-0.707 -0.707";
waveDir[2] = "-0.5 -0.86";
waveSpeed[0] = "1";
waveSpeed[1] = "1";
waveSpeed[2] = "1";
waveMagnitude[0] = "0.2";
waveMagnitude[1] = "0.2";
waveMagnitude[2] = "0.2";
overallWaveMagnitude = "1";
rippleTex = "core/art/water/noise02";
rippleDir[0] = "0 1";
rippleDir[1] = "0.707 0.707";
rippleDir[2] = "0.5 0.86";
rippleSpeed[0] = "-0.065";
rippleSpeed[1] = "0.09";
rippleSpeed[2] = "0.04";
rippleTexScale[0] = "7.14 7.14";
rippleTexScale[1] = "6.25 12.5";
rippleTexScale[2] = "50 50";
rippleMagnitude[0] = "1";
rippleMagnitude[1] = "1";
rippleMagnitude[2] = "0.3";
overallRippleMagnitude = "1";
cubemap = "DefaultSkyCubemap";
fullReflect = "1";
reflectPriority = "1";
reflectMaxRateMs = "15";
reflectDetailAdjust = "1";
reflectNormalUp = "0";
useOcclusionQuery = "1";
reflectTexSize = "256";
waterFogDensity = "0.1";
waterFogDensityOffset = "1";
wetDepth = "1.5";
wetDarkening = "0.2";
foamTex = "core/art/water/foam";
foamScale = "1";
foamMaxDepth = "2";
foamColorModulate = "0.5 0.5 0.5";
distortStartDist = "0.1";
distortEndDist = "20";
distortFullDepth = "3.5";
clarity = "0.5";
underwaterColor = "29 0 0 0";
Position = "2914.63 3758.83 168.728";
rotation = "1 0 0 0";
scale = "1 1 1";
isRenderEnabled = "true";
dnStartTime = "-1";
dnEndTime = "-1";
canSaveDynamicFields = "1";
/*Node = "2914.634521 3758.833008 168.727707 117.432831 31.224598 0.000000 0.000000 1.000000";
Node = "2828.834717 3699.117920 152.598648 222.232574 29.489588 0.000000 0.000000 1.000000";*/
Node = "2798.538818 3628.001465 87.823235 122.880005 19.478474 0.000000 0.000000 1.000000";
Node = "2767.581299 3539.456055 57.891060 122.047516 27.167120 0.000000 0.000000 1.000000";
Node = "2714.427246 3418.211182 45.604416 173.483444 26.812963 0.000000 0.000000 1.000000";
Node = "2639.948242 3261.620605 67.487808 97.597252 19.868134 0.000000 0.000000 1.000000";
Node = "2602.646729 3200.569824 61.657120 110.362473 38.321117 0.000000 0.000000 1.000000";
Node = "2519.245361 3124.639404 43.793694 123.127693 56.774101 0.000000 0.000000 1.000000";
Node = "2485.424805 3087.890381 36.973145 116.018082 47.147663 0.000000 0.000000 1.000000";
Node = "2453.229980 3053.652100 30.479950 108.908463 37.521225 0.000000 0.000000 1.000000";
Node = "2403.578369 2998.623291 21.342087 94.689240 18.268349 0.000000 0.000000 1.000000";
Node = "2374.652100 2945.578125 22.915863 107.717514 20.839966 0.000000 0.000000 1.000000";
Node = "2353.861084 2871.575684 0.567719 102.501274 59.997330 0.000000 0.000000 1.000000";
};
#5
12/02/2009 (3:10 pm)
Thank you, logging for investigation THREED-821.
#6
Although loading that River ( with or without all nodes ) did not reproduce an infinite loop for me, I simplified the problem code.
I really have no idea why I ever wrote it the previous way...
01/27/2010 (9:17 pm)
Sorry for the delay.Although loading that River ( with or without all nodes ) did not reproduce an infinite loop for me, I simplified the problem code.
U32 numRows = 1; if ( segLength > 0.0f ) numRows = mCeil( segLength / mMaxDivisionSize );
I really have no idea why I ever wrote it the previous way...
#7
01/31/2010 (2:26 pm)
Woah that is much better!
Associate James Ford
Sickhead Games
What is the value of mMaxDivisionSize? River should be preventing you from setting it smaller than 0.25f because it will cause this.