Game Development Community

LP with no terrain and gamma problems

by Thomas \"Man of Ice\" Lund · in Torque Game Engine · 09/26/2005 (1:12 pm) · 2 replies

I have some severe problems with 1.3+LP that I'm trying to "debug".

Until now I've tried pointing the fingers at my own lack of competence in using the LP - and it might still be so.

But I'm getting increasingly confident that there is something wrong with the engine code - maybe LP. Mind me - I'm not pointing any fingers at any direction, but this mail is to hear if anyone had similar problems like me.

Game is a battleship game. Levels consist mostly of nothing but water. Both water and ships are custom code. Most levels have no terrain - which might be part of the problem maybe.

We are having 2 problems:

1) Increasingly darkening of levels when game is restarted/crashes
Every time the exe file is started, the gamma setting of the computer is lowered. Its not the value inside TGE, but all the 3d apps (not the desktop it seems). After a while its so pitch dark, that I cannot see the ships on the water anymore.

A reboot fixes the problem, but after 10-20 restarts of the game, we are back to dark everything.


2) Entire game being too dark with washed out textures and only occasional lighting of ships.

A screenshot to show the problem we have:

www.steelsentinels.com/lightscreenshot.jpg
Most of the time the ships do not recieve any light at all, and neither does the water. Sometimes a ship gets light, and then it shines like a firefly at night.


So anyone have any clue about either of these problems? Any ideas at all? IGC is close, and this is a real showstopper for us at the moment (besides the occasional crash).

#1
09/26/2005 (2:14 pm)
Hey Thomas,

I got your email and was hoping to get back to you today.

The Torque Lighting Kit doesn't change the system gamma (or even TGE's gamma code), though Torque itself does alter the gamma settings (I assume you're using videoSetGammaCorrection). I could definitely see how a crash or shutting TGE in an unclean manner may not restore the gamma values, but I've never adjusted the levels, so I can't say for certain. Again the gamma code is unchanged by TLK and is stock TGE code.


Dynamic DTS objects receive lighting from the terrain or interior directly below them, in your email you mentioned that the terrain was removed, so right now the objects are not receiving any lighting (and are likely using the previously setup GL state).

To set a default lighting value add this code to SceneObject::SceneObject:

mLightingInfo.mLastColor = ColorF(05f, 0.5f, 0.5f, 1.0f);
mLightingInfo.mDefaultColor = mLightingInfo.mLastColor;
mLightingInfo.mUseInfo = true;
mLightingInfo.mInterior = NULL;
mLightingInfo.mLightSource = SceneObject::LightingInfo::Terrain;

And comment out the following line in SceneObject::getLightingAmbientColor:

mLightingInfo.mUseInfo = false;

Then you can tweak mLightingInfo.mLastColor to your liking.

-John
#2
09/27/2005 (1:36 am)
John - you are my saviour!

I put in your changes, and now everything lights up as expected! Fantastic.

Will I get into trouble with this if single missions HAVE terrain? If so, I maybe better put some code around the above to check for a terrain block in the mission.