Enviro-Torque
by Steven Peterson · 10/16/2005 (12:33 am) · 89 comments
---------------------------------------------------------------------------------------------------------
Authors Notes:
---------------------------------------------------------------------------------------------------------
This is my first patch. I did not have a lot of time to detour from my project to work
on it but I wanted to make a contribution. I hope you find this useful, and that
as you find improvements - you will submit them in return. It is good, but not perfect.
If you e-mail me (email in profile)
new patch files I will galdly add them to the resource. I hope to do another
maintenance release based on the comments below in a couple months,
but probably not till Q1-2006. (unless it's something HUGE ;-)
Enjoy!
(edit: June 28th, 2008 - Things got moved around on my website recently. This resource link has now been updated, to point to the correct location.)
-----------------------------------------------------------------------------------------------------------
Current Resource File:
----------------------------
envTorque-1.zip
Original Sources:
------------------------
GameManager Resource
Celestials Day/Night Cycles Resource
Dynamic Skies Forum Thread
Works With:
------------
This should patch to:
- TGE 1.3
- TGE+Lighting Pack (1.3.5)
Justification:
--------------
I'm new to Torque and found the above three resources incredibly
usefull. I also found them severely out of date. The mod was easy to
get working but the patches were a bear to merge by hand, bug-fix, and then
integrate into each other.
I figured that the three of these resources went together logically and
there was no reason for someone to go through the work I did all over again.
I was also afraid that if no one put out a maintenance release to any of them,
they would be lost to the sands of time when TGE 1.4 rolled around.
So here it is -
Included
------------
- Stand-alone "GameManager" mod - updated
- Enviro-Torque patch/mod
What Is Enviro-Torque
--------------------------------
Good Question.
Enviro-Torque has 3 components:
- Celestial day/night cycles with seasons
- Fractal Skies for dynamically generated sky patterns
- GameManager Date/Time and Weather system
I did not write any of them. I simply updated them to patch with the
current version of Torque, added in all the known bug-fixes and combined
them into one larger system. Some minor new features made it in too. :-)
You can read about the gameManager in detail in the (included)gameManager.txt file.
It's most important purpose is to bring dynamic weather into the mix.
The Celestial portion of the patch implements a sun that rises and sets
and moves with the seasons, as does the real sun. It also colors the sky,
terrain, and objects based on the time of day, and makes it get lighter/darker out.
The Fractal skies is a feature that creates a random sky pattern
using a fractal calculations. It is good for very light clouds. It can be turned
on/off with the:
FractalSky = true/false
at the top of sky.cc
Work In Progress
-----------------
One of this resources goals have yet to be accomplished: The GameManager
turns clouds on/off based on the weather. Unfortunately a "clear-blue" sky looks
fairly freakish in torque.
The FractalSkies is excellent for giving just a wisp of clouds.
With a little more tweaking, it should be perfect for texturing the sky on a
"clear" day without making it look overcast.
Then on a cloudy day we want to turn "on" or switch to our normal
.bmp storm clouds. This switch is what I'm currently stuck on.
For now you can select whether you want to use FractalSkies or
.bmp skies on a 'cloudy' day using the true/fals value listed above.
Last note, this is a living resource. If you submit fixes I will try to
update it from time to time. thx.
Current Status of Resource:
---------------------------
CRITICAL BUGS REMAINING:
- Need to finish dynamic weather integration with fractal-skies
- - Very Light clouds for "clear skies"
- - Big storm clouds for "story skies"
- - - (w/ or w/out fractal)
- If the weather is "clear" at game initialization, it mistakenly shows a
cloudy sky. It will abruptly fix itself when the sky changes to "cloudy".
NON-CRITICLE BUGS:
- Player and objects remain 'glowing' at night
- - Only a partial fix is available for this, and it's BAD.
- Terrain Shadows don't move - Apparently this has NEVER been an included feature...
OTHER-ISSUES:
- (?)
FIXED:
NOTES:
- Chances look good for a 1.4 if I release soon.
- - Any Takers?
- I don't believe this version has network support. sorry.
Authors Notes:
---------------------------------------------------------------------------------------------------------
This is my first patch. I did not have a lot of time to detour from my project to work
on it but I wanted to make a contribution. I hope you find this useful, and that
as you find improvements - you will submit them in return. It is good, but not perfect.
If you e-mail me (email in profile)
new patch files I will galdly add them to the resource. I hope to do another
maintenance release based on the comments below in a couple months,
but probably not till Q1-2006. (unless it's something HUGE ;-)
Enjoy!
(edit: June 28th, 2008 - Things got moved around on my website recently. This resource link has now been updated, to point to the correct location.)
-----------------------------------------------------------------------------------------------------------
Current Resource File:
----------------------------
envTorque-1.zip
Original Sources:
------------------------
GameManager Resource
Celestials Day/Night Cycles Resource
Dynamic Skies Forum Thread
Works With:
------------
This should patch to:
- TGE 1.3
- TGE+Lighting Pack (1.3.5)
Justification:
--------------
I'm new to Torque and found the above three resources incredibly
usefull. I also found them severely out of date. The mod was easy to
get working but the patches were a bear to merge by hand, bug-fix, and then
integrate into each other.
I figured that the three of these resources went together logically and
there was no reason for someone to go through the work I did all over again.
I was also afraid that if no one put out a maintenance release to any of them,
they would be lost to the sands of time when TGE 1.4 rolled around.
So here it is -
Included
------------
- Stand-alone "GameManager" mod - updated
- Enviro-Torque patch/mod
What Is Enviro-Torque
--------------------------------
Good Question.
Enviro-Torque has 3 components:
- Celestial day/night cycles with seasons
- Fractal Skies for dynamically generated sky patterns
- GameManager Date/Time and Weather system
I did not write any of them. I simply updated them to patch with the
current version of Torque, added in all the known bug-fixes and combined
them into one larger system. Some minor new features made it in too. :-)
You can read about the gameManager in detail in the (included)gameManager.txt file.
It's most important purpose is to bring dynamic weather into the mix.
The Celestial portion of the patch implements a sun that rises and sets
and moves with the seasons, as does the real sun. It also colors the sky,
terrain, and objects based on the time of day, and makes it get lighter/darker out.
The Fractal skies is a feature that creates a random sky pattern
using a fractal calculations. It is good for very light clouds. It can be turned
on/off with the:
FractalSky = true/false
at the top of sky.cc
Work In Progress
-----------------
One of this resources goals have yet to be accomplished: The GameManager
turns clouds on/off based on the weather. Unfortunately a "clear-blue" sky looks
fairly freakish in torque.
The FractalSkies is excellent for giving just a wisp of clouds.
With a little more tweaking, it should be perfect for texturing the sky on a
"clear" day without making it look overcast.
Then on a cloudy day we want to turn "on" or switch to our normal
.bmp storm clouds. This switch is what I'm currently stuck on.
For now you can select whether you want to use FractalSkies or
.bmp skies on a 'cloudy' day using the true/fals value listed above.
Last note, this is a living resource. If you submit fixes I will try to
update it from time to time. thx.
Current Status of Resource:
---------------------------
CRITICAL BUGS REMAINING:
- Need to finish dynamic weather integration with fractal-skies
- - Very Light clouds for "clear skies"
- - Big storm clouds for "story skies"
- - - (w/ or w/out fractal)
- If the weather is "clear" at game initialization, it mistakenly shows a
cloudy sky. It will abruptly fix itself when the sky changes to "cloudy".
NON-CRITICLE BUGS:
- Player and objects remain 'glowing' at night
- - Only a partial fix is available for this, and it's BAD.
- Terrain Shadows don't move - Apparently this has NEVER been an included feature...
OTHER-ISSUES:
- (?)
FIXED:
NOTES:
- Chances look good for a 1.4 if I release soon.
- - Any Takers?
- I don't believe this version has network support. sorry.
#62
I got the DRL 2.0 & TGE Water Shader resources to work fine with Enviro-Torque. (DRL 2.0 had to be changed a little bit though)
I used a fresh TLK 1.4 then added the DRL 2.0 how it says to in the instructions. I then added in the Water Shader with the posted instructions except for the SceneGraph files. You will overwrite the ones that already have the DRL patch in them. Just merge by hand. There is also a fix for adding the water to DRL posted on the resource page. After testing the "Rebuild" I then manually patched in the Enviro-Torque (Celestials Mod) using the sky.cc/h that came with them and then I copied the entire celestials.cc/h that Barry Mesa posted above. I rebuilt the "Torque Demo" again and then added the celestial block in the stronghold.mis file and then ran the .EXE. I had No errors or warnings but I did have to adjust some of the DRL stuff in the engine to get it to work realistically and not go crazy when it gets dark. The interiors and objects all get dark because I used the mbLight to filter outdoor lighting of objects. Also take note of the other two demo missions that come with TLK 1.4, they wont work with just adding in the
05/07/2006 (6:23 pm)
@AlexanderI got the DRL 2.0 & TGE Water Shader resources to work fine with Enviro-Torque. (DRL 2.0 had to be changed a little bit though)
I used a fresh TLK 1.4 then added the DRL 2.0 how it says to in the instructions. I then added in the Water Shader with the posted instructions except for the SceneGraph files. You will overwrite the ones that already have the DRL patch in them. Just merge by hand. There is also a fix for adding the water to DRL posted on the resource page. After testing the "Rebuild" I then manually patched in the Enviro-Torque (Celestials Mod) using the sky.cc/h that came with them and then I copied the entire celestials.cc/h that Barry Mesa posted above. I rebuilt the "Torque Demo" again and then added the celestial block in the stronghold.mis file and then ran the .EXE. I had No errors or warnings but I did have to adjust some of the DRL stuff in the engine to get it to work realistically and not go crazy when it gets dark. The interiors and objects all get dark because I used the mbLight to filter outdoor lighting of objects. Also take note of the other two demo missions that come with TLK 1.4, they wont work with just adding in the
#63
the celestials block.
@Steven
Thanx for the resource! It's great I used skyboxes that slowly blend in with the Gamemanagers time for stars at night and also for thunder storms and blizards.
05/07/2006 (6:28 pm)
the celestials block.
@Steven
Thanx for the resource! It's great I used skyboxes that slowly blend in with the Gamemanagers time for stars at night and also for thunder storms and blizards.
#64
Unfortunately i have too many changes in the engine, so its not so simple to merge it *g*
Can you post changes, that you have maked to get it work together?
Its would be a great resource, if we will get Enviro-Torque+Water Shader+DRL 2.0 together. ^^ But still a framerate-killer, unfortunately ;)
Have played with quality a bit, but its still around 10-25% of "normal" framerate.. -.-
05/09/2006 (11:43 pm)
it hasnt work well with TLK 1.4 a few months ago... but i will try to implement it.Unfortunately i have too many changes in the engine, so its not so simple to merge it *g*
Can you post changes, that you have maked to get it work together?
Its would be a great resource, if we will get Enviro-Torque+Water Shader+DRL 2.0 together. ^^ But still a framerate-killer, unfortunately ;)
Have played with quality a bit, but its still around 10-25% of "normal" framerate.. -.-
#65
I wouldn't mind reposting this entire resource on a whole new page. I would just post files needed to overwrite the originals in the engine and make 3 seperate downloads. One for TGE 1.4/TLK 1.4/TLK+DRL+Watershader and it would be as simple as that but I need to make sure its cool with the ppl who originaly made these resources bacuase in a sense it would basicaly override there work. Just posting the changes is hard because there are too many little snippets added here and there throughout these resources that you would have to do. I could easily creat a resource that would just include everything you need.
05/10/2006 (10:41 am)
@AlexI wouldn't mind reposting this entire resource on a whole new page. I would just post files needed to overwrite the originals in the engine and make 3 seperate downloads. One for TGE 1.4/TLK 1.4/TLK+DRL+Watershader and it would be as simple as that but I need to make sure its cool with the ppl who originaly made these resources bacuase in a sense it would basicaly override there work. Just posting the changes is hard because there are too many little snippets added here and there throughout these resources that you would have to do. I could easily creat a resource that would just include everything you need.
#66
05/10/2006 (11:20 pm)
WinMerge will help too ;)
#67
Well in my opion,... as goes for all opensource'd resources, you can just edit and (re-)release whenever you want when you properly credit it.
05/11/2006 (1:28 am)
@ChadWell in my opion,... as goes for all opensource'd resources, you can just edit and (re-)release whenever you want when you properly credit it.
#68
I will see what I can do, shouldn't take long. You could help me by testing it.
05/11/2006 (10:06 am)
@AlexI will see what I can do, shouldn't take long. You could help me by testing it.
#69
05/25/2006 (11:14 pm)
some news here?
#70
11/27/2006 (7:05 pm)
i would be interested in seeing your work chad.
#71
lm->setVectorLightsEnabled(false);
lm->setAmbientColor(mCurrentColor);
01/01/2007 (6:03 pm)
I have been able to get some of this working in TGE 1.5. However, there are some methods on the LightManager class that no longer exist. These methods were called from the Celestial Class in the UpdateSunPosition method. These are listed below. Does anyone know what they have been replaced by:lm->setVectorLightsEnabled(false);
lm->setAmbientColor(mCurrentColor);
#72
Anyone have an answer?
02/09/2007 (6:41 pm)
I've the same question as Robert Rice above about TGE 1.5 and LightManager methods he mentions.Anyone have an answer?
#74
05/23/2007 (12:48 pm)
When we can see Enviro solution for TGE 1.5.2 as Resource ???
#75
08/12/2007 (12:25 am)
Any word yet on a port to 1.5.2?
#76
The Last information/update to Enviro-Torque 2.0 is 17 Months old.
10/18/2007 (6:03 am)
Seems this useful Ressource is dead.The Last information/update to Enviro-Torque 2.0 is 17 Months old.
#77
Does anyone know what getSunLight(), setVectorLightsEnabled(), and setAmbientColor() where replaced by? This is the only thing keeping this resource from working with TGE 1.5.2.
03/04/2008 (1:10 pm)
I can partially get this working for TGE 1.5.2. As mentioned by Robert Rice above, there are some missing LightManager methods that apparently weren't included in the lighting kit merger.// Now do the lighting stuff
GetColor(mCurrentColor);
LightManager *lm = gClientSceneGraph->getLightManager();
lm->getSunLight()->mColor = mCurrentColor;
lm->getSunLight()->mDirection = -mSunVector;
lm->setVectorLightsEnabled(false);
lm->setAmbientColor(mCurrentColor);
//Con::printf("Leaving Celestials UpdateSunPosition");Does anyone know what getSunLight(), setVectorLightsEnabled(), and setAmbientColor() where replaced by? This is the only thing keeping this resource from working with TGE 1.5.2.
#78
terrain/terrRender.cc
//--- Celestial Patch Changes ---//
//NOTE: Patch Does NOT apply cleanly here -
// I'm takeing a a guess! (SP. 9/18/2005)
//---------------------------------------------//
//Does this line belong?
VectorF sunVector = gClientSceneGraph->getLightManager()->getShadowLightDirection();
//
if(gCelestials != NULL)
{
static Vector lights;
lights.clear();
gClientSceneGraph->getLightManager()->getLights(lights);
sunVector = -lights[0]->mDirection; //first light is always sun
}
else
{
sunVector = gCelestials->mSunVector;
}
//----- End Celestial Patch -----//
Changed To:
LightInfo *sun = gClientSceneGraph->getLightManager()->sgGetSpecialLig(LightManager::sgSunLightType);
VectorF sunVector = -sun->mDirection;
if(gCelestials != NULL)
{
static LightInfoList lights;
lights.clear();
gClientSceneGraph->getLightManager()->sgGetBestLights(lights);
sunVector = -lights[0]->mDirection; //first light is always sun
}
else
{
sunVector = gCelestials->mSunVector;
}
game/fx/Celestial.cc
LightManager *lm = gClientSceneGraph->getLightManager();
lm->setVectorLightsEnabled(false);
lm->setAmbientColor(mCurrentColor);
Changed To:
LightInfo *sun = gClientSceneGraph->getLightManager()->sgGetSpecialLig(LightManager::sgSunLightType);
sun->mAmbient = mCurrentColor;
OK~!Good Luck~!
03/05/2008 (7:32 pm)
I can faultlessly get this working for TGE 1.5.2.terrain/terrRender.cc
//--- Celestial Patch Changes ---//
//NOTE: Patch Does NOT apply cleanly here -
// I'm takeing a a guess! (SP. 9/18/2005)
//---------------------------------------------//
//Does this line belong?
VectorF sunVector = gClientSceneGraph->getLightManager()->getShadowLightDirection();
//
if(gCelestials != NULL)
{
static Vector
lights.clear();
gClientSceneGraph->getLightManager()->getLights(lights);
sunVector = -lights[0]->mDirection; //first light is always sun
}
else
{
sunVector = gCelestials->mSunVector;
}
//----- End Celestial Patch -----//
Changed To:
LightInfo *sun = gClientSceneGraph->getLightManager()->sgGetSpecialLig(LightManager::sgSunLightType);
VectorF sunVector = -sun->mDirection;
if(gCelestials != NULL)
{
static LightInfoList lights;
lights.clear();
gClientSceneGraph->getLightManager()->sgGetBestLights(lights);
sunVector = -lights[0]->mDirection; //first light is always sun
}
else
{
sunVector = gCelestials->mSunVector;
}
game/fx/Celestial.cc
LightManager *lm = gClientSceneGraph->getLightManager();
lm->setVectorLightsEnabled(false);
lm->setAmbientColor(mCurrentColor);
Changed To:
LightInfo *sun = gClientSceneGraph->getLightManager()->sgGetSpecialLig(LightManager::sgSunLightType);
sun->mAmbient = mCurrentColor;
OK~!Good Luck~!
#79
sgGetSpecialLig should be sgGetSpecialLight ... missing the 'ht' at the end of "light" ;-).
It compiles, however, I'm experiencing 100% black sky and terrain now.
Edit:
In your last post you wrote:
but if gCelestials == NULL, gCelestials can't be referenced (as it is in your else statement).
Do you have this working in 1.5.2?
03/12/2008 (11:20 am)
Thanks Louis! sgGetSpecialLig should be sgGetSpecialLight ... missing the 'ht' at the end of "light" ;-).
It compiles, however, I'm experiencing 100% black sky and terrain now.
Edit:
In your last post you wrote:
if(gCelestials != NULL)
{
static LightInfoList lights;
lights.clear();
gClientSceneGraph->getLightManager()->sgGetBestLights(lights);
sunVector = -lights[0]->mDirection; //first light is always sun
}
else
{
sunVector = gCelestials->mSunVector;
}but if gCelestials == NULL, gCelestials can't be referenced (as it is in your else statement).
Do you have this working in 1.5.2?
#80
Okay, for those of you out there experiencing the "Black Terrain and Sky" problem with this resource... try this:
Go into your World Editor (F11), go into Creator mode (F3), and under Mission Objects and Environment objects you should see fxSunLight.
I just dropped one of those in my mission and voila... the sky and terrain are there!
*Note I made changes to fxSunLight's AnimateSun function to update and get Celestials info needed to animate the sun. I believe those changes are are the patch file provided with the resource*
03/14/2008 (10:29 am)
Oh... My... God.... LOL.Okay, for those of you out there experiencing the "Black Terrain and Sky" problem with this resource... try this:
Go into your World Editor (F11), go into Creator mode (F3), and under Mission Objects and Environment objects you should see fxSunLight.
I just dropped one of those in my mission and voila... the sky and terrain are there!
*Note I made changes to fxSunLight's AnimateSun function to update and get Celestials info needed to animate the sun. I believe those changes are are the patch file provided with the resource*

Alex (Stalker) Sakablukow
Default Studio Name
DRL 2.0: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10232
TGE Water Shader Update: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10357