TGEDayNight Released!
by Prairie Games · in Technical Issues · 12/05/2002 (9:01 am) · 143 replies
Here is the Day and Night Cycle stuff as featured here.
*** Sorry, over the years we've lost this file. Please foward to Support@PrairieGames.com, thank you.
The source is available: HERE!
This is in GNU patch format... read the docs...
EDIT: I added the 2 TMU support for the interiors, get it from the link above :)
EDIT 2: Fixed a small problem with the horizon and made Sunrise/Sunset/Clouds much more dynamic/vibrant, highly recommended... the source is available from the link above or down below in the thread
Cheers,
-Joshua Ritter
Prairie Gamesm Inc.
*** Sorry, over the years we've lost this file. Please foward to Support@PrairieGames.com, thank you.
The source is available: HERE!
This is in GNU patch format... read the docs...
EDIT: I added the 2 TMU support for the interiors, get it from the link above :)
EDIT 2: Fixed a small problem with the horizon and made Sunrise/Sunset/Clouds much more dynamic/vibrant, highly recommended... the source is available from the link above or down below in the thread
Cheers,
-Joshua Ritter
Prairie Gamesm Inc.
#102
No Problem.
12/05/2003 (3:02 am)
AFAIK one such change is called a hunk. But i'm not sure about this. Maybe each subtraction and each addition is a hunk? So one job has 2 hunks (normaly you do subtract something and add something).No Problem.
#103
"
Torque Demo error LNK2019: unresolved external symbol "void __cdecl tgeDNGLEnableLighting(float)" (?tgeDNGLEnableLighting@@YAXM@Z) referenced in function "public: void __thiscall fluid::Render(bool &)" (?Render@fluid@@QAEXAA_N@Z)
"
12/05/2003 (3:15 am)
Heh heh, ok so after making the change and recompiling I am now getting a bunc of link errors that were not happening before the changes. Here is an example of one they are all very similar:"
Torque Demo error LNK2019: unresolved external symbol "void __cdecl tgeDNGLEnableLighting(float)" (?tgeDNGLEnableLighting@@YAXM@Z) referenced in function "public: void __thiscall fluid::Render(bool &)" (?Render@fluid@@QAEXAA_N@Z)
"
#104
Note that I never really did a proper interface for the released version... though, it took me maybe 10 minutes to come up with something workable for syncing time across multiple servers... of course I use Twisted Python. ;)
-J
12/05/2003 (8:44 am)
You need to add the .cc source files as well... from daynight.txt in the zip:Quote:Installation:
1. Apply daynight.patch : see http://www.garagegames.com/docs/torque.sdk/gstarted/patches.html
2. Copy the stuff in the contained torque folder (some source code, bitmaps, and fixed trees.. the ones in GG CVS are
emissive)
3. Add ARPG/environment/atgeDayNight.h and and ARPG/environment/atgeDayNight.cc to the Torque Demo project
4. Compile, run, and feel somewhat like you are in a persistent MMP game :)
Note that I never really did a proper interface for the released version... though, it took me maybe 10 minutes to come up with something workable for syncing time across multiple servers... of course I use Twisted Python. ;)
-J
#105
12/05/2003 (12:34 pm)
I assume you mean I need to add the atgedaynight.h and .cc files but I am still not totally clear where to add them. Do you add them to the Visual C++ project? Or are you just supposed to put them in one of the libraries? Sorry I am not very familiar with this environment up until this point I have mostly used unix based systems for this type of thing. Again thanks for all the help.
#106
I just installed the TGE and grabbed your patch. It's absolutely brilliant. Between you and Melv I almost feel guilty for all the work that has been done for me ;) With this patch in place, I notice that the sun moves from one side of the sky to the other during the day, pauses, and then works its way back across the sky during the night.
Forgive my ignorance but, is there a way to get the sun to 'set' and then rise again on the other side in the morning? In the screenshots for the patch I see that gorgeous sunset but, when I try it, the sun never gets close to the horizon.
Cheers,
-gordon
12/08/2003 (1:19 pm)
Joshua,I just installed the TGE and grabbed your patch. It's absolutely brilliant. Between you and Melv I almost feel guilty for all the work that has been done for me ;) With this patch in place, I notice that the sun moves from one side of the sky to the other during the day, pauses, and then works its way back across the sky during the night.
Forgive my ignorance but, is there a way to get the sun to 'set' and then rise again on the other side in the morning? In the screenshots for the patch I see that gorgeous sunset but, when I try it, the sun never gets close to the horizon.
Cheers,
-gordon
#107
Did you try the included mission?
-J
12/08/2003 (1:46 pm)
Thanks, please feel more guilty about Melv's stuff though... it's awesome :)Did you try the included mission?
-J
#108
Thanks,
-gordon
12/08/2003 (2:22 pm)
Thanks for the quick response! I tried the Stronghold mission; I saw that the patch updated it so I figured it was the place to start. Is there another mission I should be using? I've tried playing around with azimuth and elevation settings in the hopes that they might affect it but with no luck. I'll take a look at the code behind it all tomorrow when I'm more awake to see if I can figure it out.Thanks,
-gordon
#109
Thanks for the great patch. It does really make an impressive effect! I thought it was incredible the first time I saw it.
that being said, onto the problems.. :)
I'm trying out your patch on Linux (with all of the latest files downloaded from your site) with TGE HEAD from dec 05th 2003. Here are the patch files:
I'm testing your patch on an NVidia Quadro 580XGL with 64Mb and over two TMU's (I think).
I'm getting a couple problems:
1) The day/night cycle loops in about 5-7 minutes (approx). I thought this was supposed to be about an hour but perhaps I'm wrong.
2) The position of the SUN in the sky is back and forth along a line but the SUN never actually goes below the horizon. I do get the different lighting effects (the sun is vibrant, changes colors, etc..) but it never gets below 45 degress (approx). It basically does this:
- a) The game starts in day time and the sun starts moving up.
- b) time flows by and the sun stops moving while still well above the horizon. However, its looks reflect the fact that the night is near.
- c) After some time, the sun starting moving backward toward its original position.
Perhaps this is related to a warning that I got when compiling one of the modified files:
Those lines in engine/interior/interiorRender.cc are:
I hope this helps. I really want this incredible effect of yours to work cross-platformly.. :)
Best regards,
Vincent
12/16/2003 (2:18 am)
Hi Joshua,Thanks for the great patch. It does really make an impressive effect! I thought it was incredible the first time I saw it.
that being said, onto the problems.. :)
I'm trying out your patch on Linux (with all of the latest files downloaded from your site) with TGE HEAD from dec 05th 2003. Here are the patch files:
-rw-r--r-- 1 root root 17031 Dec 5 13:35 TGEDayNight_interiorRender.cc -rw-r--r-- 1 root root 175425 Dec 5 13:40 daynightpatch001.zip -rw-r--r-- 1 root root 1970 Dec 5 13:36 patch3.txt
I'm testing your patch on an NVidia Quadro 580XGL with 64Mb and over two TMU's (I think).
I'm getting a couple problems:
1) The day/night cycle loops in about 5-7 minutes (approx). I thought this was supposed to be about an hour but perhaps I'm wrong.
2) The position of the SUN in the sky is back and forth along a line but the SUN never actually goes below the horizon. I do get the different lighting effects (the sun is vibrant, changes colors, etc..) but it never gets below 45 degress (approx). It basically does this:
- a) The game starts in day time and the sun starts moving up.
- b) time flows by and the sun stops moving while still well above the horizon. However, its looks reflect the fact that the night is near.
- c) After some time, the sun starting moving backward toward its original position.
Perhaps this is related to a warning that I got when compiling one of the modified files:
--> Compiling interior/interiorRender.cc g++ -DUSE_FILE_REDIRECT -I/usr/X11R6/include/ -MD -march=i586 -mcpu=i686 -ffast-math -pipe -g -DTORQUE_DEBUG -I../lib/lungif -I../ lib/ljpeg -I../lib/zlib -I../lib/lpng -I../lib/directx8 -I../lib/vorbis/include -I../lib/openal/LINUX -I. -c -o out.GCC2.DEBUG/int erior/interiorRender.obj interior/interiorRender.cc interior/interiorRender.cc: In method 'void Interior::renderARB_FC (bool, MaterialList *, unsigned int)': interior/interiorRender.cc:1415: warning: assignment of negative value '-1' to 'U32' interior/interiorRender.cc:1415: warning: argument of negative value '-1' to 'unsigned int' interior/interiorRender.cc:1416: warning: assignment of negative value '-1' to 'U32' interior/interiorRender.cc:1416: warning: argument of negative value '-1' to 'unsigned int' --> Linking out.GCC2.DEBUG/torqueDemo_DEBUG.bin
Those lines in engine/interior/interiorRender.cc are:
//TGEDNSUPPORT
// Render environment maps...
if (smRenderEnvironmentMaps && sgEnvironPolyListSize) {
glDisable(GL_FOG);
currentlyBound1 = -1; // LINE 1415
currentlyBound0 = -1; // LINE 1416I hope this helps. I really want this incredible effect of yours to work cross-platformly.. :)
Best regards,
Vincent
#110
I made the source code available, *hint, hint*
:)
Cheers,
-J
12/16/2003 (8:55 am)
I'm glad you like the effect... now onto your problems:I made the source code available, *hint, hint*
:)
Cheers,
-J
#111
12/17/2003 (4:13 am)
@Vincent I'm testing this on Windows XP with a GeForce FX 5600 and I get exactly the same problem (minus the moving back, mine just jumps back sometime near dawn), so it isn't a linux problem.. Could be a nVidia one though............ Also I'm not getting any warnings, so don't think it has to do with that...
#112
Should have guessed you'd say that. :) *chuckle* Oh well, let's dig up into the code... :) I mostly doing porting and platform stuff for TGE on Solaris but that will give me the chance to look into some higher-level stuff.. :)
@Owen:
Thanks for the reply! At least I know it's not engine/platform*'s fault.. :) Do you also get the 5 minutes day/night cycle thing?
@everyone:
I made a patch file that applies cleanly to current CVS HEAD. That patch is made of all three patches released by Joshua and adapted for current CVS Head. Anyone want it? All you have to do is 'patch -p1 < patchfile' and add grass2.png to the right place (./example/starter.fps/data/foliage/grass2.png
by current CVS standards).
Regards,
Vincent
12/17/2003 (4:30 am)
@Joshua:Should have guessed you'd say that. :) *chuckle* Oh well, let's dig up into the code... :) I mostly doing porting and platform stuff for TGE on Solaris but that will give me the chance to look into some higher-level stuff.. :)
@Owen:
Thanks for the reply! At least I know it's not engine/platform*'s fault.. :) Do you also get the 5 minutes day/night cycle thing?
@everyone:
I made a patch file that applies cleanly to current CVS HEAD. That patch is made of all three patches released by Joshua and adapted for current CVS Head. Anyone want it? All you have to do is 'patch -p1 < patchfile' and add grass2.png to the right place (./example/starter.fps/data/foliage/grass2.png
by current CVS standards).
Regards,
Vincent
#113
(Fades in and out in a very noticable fashion)
Perhaps it may be due to me not applying the colours to the env map properly or something...hmmm...
12/17/2003 (4:46 am)
Just out of curiousity, does anyone have a problem where at night the water glows if environment mapping is turned on?(Fades in and out in a very noticable fashion)
Perhaps it may be due to me not applying the colours to the env map properly or something...hmmm...
#114
12/17/2003 (4:48 am)
@Vincent: Yes the day lasts about a minute or 2.. Also if you could e-mail that patch to me please, because I would like a single install for should I need to repatch. Right going to see if I can figure out this Sun movement problem... Got an hour before work :)
#115
I built up a patch against current CVS and placed it here:
Patch file (apply in TGE dir with 'patch -p1 < patch_file'):
step.polymtl.ca/~coyote/torque/TGE-DayNight-05122003.patch
PNG file (copy to ./example/starter.fps/data/foliage/grass2.png)
step.polymtl.ca/~coyote/torque/grass2.png
Owen requested this patch so I'm posting it here in case others need it too. All of the code was written by Joshua Ritter. I only edited it to make it work against current CVS so it could simplify my work:
1) take TGE + Day/Night diff.
2) update TGE from CVS, overwritting files.
3) re-apply patch (no need to back-port changes from either TGE CVS or Day/Night stuff).
Cheers,
Vincent
12/17/2003 (5:07 am)
@Owen:I built up a patch against current CVS and placed it here:
Patch file (apply in TGE dir with 'patch -p1 < patch_file'):
step.polymtl.ca/~coyote/torque/TGE-DayNight-05122003.patch
PNG file (copy to ./example/starter.fps/data/foliage/grass2.png)
step.polymtl.ca/~coyote/torque/grass2.png
Owen requested this patch so I'm posting it here in case others need it too. All of the code was written by Joshua Ritter. I only edited it to make it work against current CVS so it could simplify my work:
1) take TGE + Day/Night diff.
2) update TGE from CVS, overwritting files.
3) re-apply patch (no need to back-port changes from either TGE CVS or Day/Night stuff).
Cheers,
Vincent
#116
12/17/2003 (4:08 pm)
Update to problem that Vince and I are having: the speed is intentional and can be altered at source, not a bug. The horizon problem, with the sun simply not moving low enough is still and issue, I can't see why it's doing it from the source, but my 3D math may not be quite strong enough and the code can be hard to follow in places (but thanks for doing the work Joshua, not trying to be ungrateful just sounding it!!). If anyone could help me shed some light on this little bug it would be appreciated, until then I will keep working!
#117
Thanks,
Krum
12/19/2003 (10:17 pm)
I've been playing with various engines and I'm just starting to look at TGE. With this patch, it looks like the best choice for what I want to do. My question is, do patches like this generally end up being merged into the official project? Is it possible at this point to estimate when that might happen?Thanks,
Krum
#118
This code doesn't really belong in the official Torque CVS... there is stuff like Melv's incredibly functional/clean code that does... and it is generally adopted into CVS promptly. The bulk of stuff that has gone into CVS has been bug fixes, this is valuable.
I very recently applied the patch against the HEAD (just before 1.2) and it applied and ran just fine... I am not sure why Owen is having trouble, there could be a bug or two, either in the original code, or as applied to the current Torque HEAD... Chris Weiland(sp?) submitted this stuff as a resource, and did some work with it... I haven't looked at what he did, if it has the additonal work I did outside of the patch, What bugs it fixes/introduces, etc... You may want to give it a try...
I get a number of emails regarding code I have released for Torque every week... I cannot support this or other code I have released... I am just being stretched like butter over too much bread...
Good luck,
-J
12/19/2003 (11:01 pm)
The code in this patch makes changes all over the place... some of the code is ok, some of it flat out sucks... I wrote this in around 6 hours (+ a couple hours to get the 2 TMU support working), mostly just to see what it would take to get Torque doing day/night cycles... the effect ended up being quite complete/nice (there is some additional code linked which *greatly* increases visual quality)... and so I released it... This code doesn't really belong in the official Torque CVS... there is stuff like Melv's incredibly functional/clean code that does... and it is generally adopted into CVS promptly. The bulk of stuff that has gone into CVS has been bug fixes, this is valuable.
I very recently applied the patch against the HEAD (just before 1.2) and it applied and ran just fine... I am not sure why Owen is having trouble, there could be a bug or two, either in the original code, or as applied to the current Torque HEAD... Chris Weiland(sp?) submitted this stuff as a resource, and did some work with it... I haven't looked at what he did, if it has the additonal work I did outside of the patch, What bugs it fixes/introduces, etc... You may want to give it a try...
I get a number of emails regarding code I have released for Torque every week... I cannot support this or other code I have released... I am just being stretched like butter over too much bread...
Good luck,
-J
#119
Once again thanks!
12/20/2003 (3:23 am)
Understandable, if I figure out where it's going wrong I will e-mail you the changes so you can adjust the patch accordingly.Once again thanks!
#120
I found the part of the code where it happens.
In fact, commenting out lines 405 to 423 of atgeDayNight.cc will result in a nicer effect. They are reproduced below in order to help you locate them:
I have no idea why taking these lines out results in the SUN moving correctly. Also, I'm sure these lines are needed but my math is a little bit rusted. I'll investigate more this week.
@Joshua: I understand you're very busy. At any case, thank you for coding this great eye-candy. :)
Cheers,
Vincent
12/20/2003 (2:10 pm)
@Owen:I found the part of the code where it happens.
In fact, commenting out lines 405 to 423 of atgeDayNight.cc will result in a nicer effect. They are reproduced below in order to help you locate them:
/* if (shadphase>0.75f)
shadphase= (0.75f - (shadphase-0.75f));
if (shadphase<0.25f)
shadphase= (0.5f - shadphase);
if ((shadphase >= 0.25f) && (shadphase <= 0.35f))
{
shadphase=0.35f;
}
if ((shadphase >= 0.65f) && (shadphase <= 0.75f))
{
shadphase=0.65f;
}
*/I have no idea why taking these lines out results in the SUN moving correctly. Also, I'm sure these lines are needed but my math is a little bit rusted. I'll investigate more this week.
@Joshua: I understand you're very busy. At any case, thank you for coding this great eye-candy. :)
Cheers,
Vincent
Torque Owner Brenden Vaughan