Game Development Community

VisibleDistance Limitation in 1.5?

by Robert Seeman · in Torque Game Engine · 10/27/2006 (10:37 pm) · 6 replies

I have a space-based mission with a visibleDistance of 50000. Works great in 1.4

I am finding in 1.5 that my sky is limited to a visibleDistance of 2000. Shows as 50000 in the .mis file (see below).

new Sky(Sky) {
position = "336 136 0";
rotation = "1 0 0 0";
scale = "1 1 1";
materialList = "~/data/skies/sky_day.dml";
cloudHeightPer[0] = "0";
cloudHeightPer[1] = "0";
cloudHeightPer[2] = "0";
cloudSpeed1 = "0";
cloudSpeed2 = "0";
cloudSpeed3 = "0";
visibleDistance = "50000"; <<<<< This shows as 2000 in the World Editor Inspector!
fogDistance = "30000";
fogColor = "0 0 0 1";
fogStorm1 = "0";
fogStorm2 = "0";
fogStorm3 = "0";
fogVolume1 = "0 0 0";
fogVolume2 = "0 0 0";
fogVolume3 = "0 0 0";
fogVolumeColor1 = "128 128 128 -2.22768e+038";
fogVolumeColor2 = "128 128 128 0";
fogVolumeColor3 = "128 128 128 -1.70699e+038";
windVelocity = "1 1 0";
windEffectPrecipitation = "1";
SkySolidColor = "0.547 0.641 0.789 0";
useSkyTextures = "1";
renderBottomTexture = "1";
noRenderBans = "1";
locked = "true";
};

Is 1.5 limiting visibleDistance to 2000? Please tell me this is not the case.

#1
10/27/2006 (11:18 pm)
Just found this in my console.log:

Error: visibleDistance is capped at 2000.

One question: Why?
#2
10/27/2006 (11:32 pm)
You neglected to post/read the rest of that error message:

Error: visibleDistance is capped at 2000.
To increase this limitation requires C++ code changes.
Please see comment at the top of sky.cc

Basically if the visibleDistance is pushed out beyond 2000 and too much of the terrain is in view, it causes the blender to use too much memory and overrun the amount allocated to the FrameAllocator. This causes a hard crash. You can sometimes get away with a higher visibleDistance as long as you keep your characters close to the ground and never ahve too much of the terrain in view but I found that 2000 was the highest I could go and stay stable in most every situation.

Feel free to push it higher in your project. I would recommend following the instructions in the comment in sky.cc and upping the amount of memory allocated to the FrameAllocator to match your new visibleDistance. However, be sure to read the warning written there also.
#3
10/27/2006 (11:33 pm)
And, yes...in a space based mission with no terrain feel free to remove this limit and run with a higher visibleDistance.
#4
10/27/2006 (11:37 pm)
Yes, I should learn to read! I'll tinker around with it. I'll push it out as far as my hardware will allow and see where the breaking point is for a space based mission.

Thanks for the insight and the VERY fast response!

Robert
#5
10/27/2006 (11:55 pm)
Yes, I should learn to read! I'll tinker around with it. I'll push it out as far as my hardware will allow and see where the breaking point is for a space based mission.

Thanks for the insight and the VERY fast response!

Robert
#6
10/27/2006 (11:57 pm)
I set the max visibledistance in sky.cc to 10000 and FrameAllocator in main.cc to 15 << 20. So far, so good!