Page 1 of 2

Automatic fog settings

PostPosted: Sun Nov 21, 2010 12:41 pm
by Sirius
Hi again.

I would like to tell Uru to set automatically the fog of an Age depending of a precise number of hour, in order to have a daytime/nighttime cycle.
It would set the line "Graphics.Renderer.Fog.SetDefColor" (and "Graphics.Renderer.Setyon" if possible).

Gira, Kemo and Payiferen already use it, but it seems it doesn't use any Python file for this. Is it in the PRP and how can I reproduce it ? Thanks a lot.

Re: Automatic fog settings

PostPosted: Sun Nov 21, 2010 4:23 pm
by Lontahv
I don't think the fog is changing for those ages, but however, they have an animated sun. To get the sky to change color dramatically they also use a plLayerSDLAnimation that changes the ambient color of the layer.

The plLayerSDLAnimation is possible if you're using PlasmaMax, but I'm not entirely sure if it possible in the main branch of PyPRP (It's in GPN's contrib though). The animated sun is a very easy and doable thing to do with PyPRP; just insert keyframes for the sun's intensity, color, and/or position and rotation. For the time of day to affect the animation, use a ageglobalanim. http://www.guildofwriters.com/wiki/Animations should explain that. I've used animated suns before and they're pretty great, however, you must be careful to have your outdoors areas completely dynamically lit (no lightmaps or shadelessness). A tip for making the outdoors realistically lit at night or during the day is setting all your objects to have their vertex paint black (or, the darkest you ever want the objects to get). Hopefully this was helpful.

If you just want to change the fog, you'd need to set up a python file with a timer callback that updates the color of the fog according to the time of day SDL.

Re: Automatic fog settings

PostPosted: Mon Nov 22, 2010 4:14 am
by diafero
Actually, there is an age with time-depending fog in MOUL, it's Negilahn. The nglnFogTweener is controlling that. The source seems to be general enough to work for other ages, too - it takes the "Battery Updated SDL" as first argument and registers for that SDL, but never actually uses it.

Re: Automatic fog settings

PostPosted: Mon Nov 22, 2010 12:22 pm
by Sirius
Hmmm... yes, I saw a few time something as "VAR Agetimeofday" in the SDLs...
But my problem with animated Suns is... well... In fact I used "/fogcolor 0 0 0" in Ae'Gura and was wondering if I could have the MOUL's fog (a bit brighter than in CC) going gradually to this one and then to the original one again... (another problem with your method is that the city is already wide enough, and it would increase lags)
That's since I heard about the Pellets and algae cycle that we could never saw as Cyan removed the Light Meter.
About Negilahn fog tweener, I don't know how it really controls the fog as I never saw any kind of "night time" there. But I'll see.
Thanks to both of you.

Re: Automatic fog settings

PostPosted: Mon Nov 22, 2010 5:37 pm
by tangara
Sirius wrote:I would like to tell Uru to set automatically the fog of an Age depending of a precise number of hour, in order to have a daytime/nighttime cycle.

Of course, I do not know how to do :lol: but the daytime/nighttime cycle in Gira is the most beautiful I have seen : splendid sunsets, fabulous sunrises ... I do not know how they get it but I would like to be able to do it. ;) I would never thought it was fog settings... :shock:

Re: Automatic fog settings

PostPosted: Tue Nov 23, 2010 2:48 am
by diafero
Well, it is not fog settings ;-) .- Gira uses "nomal" SDL animations for layers and objects and lights to accomplish this astonishing effect.

The only ages with dynamic fog are Negilahn (time-dependant) and Minkata (where the fog gets denser as you get farer away from the cage, and is disabled when you enter a cave).

Re: Automatic fog settings

PostPosted: Tue Nov 23, 2010 3:27 am
by tangara
Thank you for the explanations Diafero. Each day I learn a bit more! 8-)

Re: Automatic fog settings

PostPosted: Wed Dec 15, 2010 11:02 am
by Sirius
Hey, I got it working !
I used a fog setting based on Negilahn. So, I have a fog going from 0 0 0 (midnight) to .4 .3 .1 (noon). The sunset is .3 .25 .1, and the sundown .35 .2 .05 (however, the fog settings are not only these four - they are going from one to another smoothly).

In Negilahn, the fog is updated every 10 seconds. In the city... well, on each link in. Is there a way to update it more often ?

Re: Automatic fog settings

PostPosted: Wed Dec 15, 2010 2:40 pm
by diafero
Using a timer, this should be possible. You will need some changes in the Python as the city does not have an AGETIMEOFDAY.

Re: Automatic fog settings

PostPosted: Thu Dec 16, 2010 12:40 pm
by Sirius
AGETIMEOFDAY, ok. In which Python file the other changes should be located ? Is it only in the FogTweener, or also in the default python file ?