Page 1 of 1
getfogamount and setfogamount: How do they work?
Posted: Mon Jan 24, 2005 3:17 pm
by Mothandric
A new thing added with the upgrade to 1.65 has been the addition of setfogamount and getfogamount. What i want to know is how do they work and can they be used to set a decent mist/fog scene without using the fog and smoke placeables that are way too lag happy?
Posted: Mon Jan 24, 2005 3:26 pm
by Krator
Code: Select all
// Sets the fog amount in the area specified.
// nFogType = FOG_TYPE_* specifies wether the Sun, Moon, or both fog types are set.
// nFogAmount = specifies the density that the fog is being set to.
// If no valid area (or object) is specified, it uses the area of caller.
// If an object other than an area is specified, will use the area that the object is currently in.
void SetFogAmount(int nFogType, int nFogAmount, object oArea=OBJECT_INVALID)
that's what bioware wrote. Testing it now

Posted: Mon Jan 24, 2005 11:44 pm
by Alexandru Stanicu
I am not sure that players can use these on multiplayer servers...
Posted: Tue Jan 25, 2005 12:00 am
by Psyco
The lag caused by fog is primarily client side, and felt a lot more on lower end systems.
I can't see the method used to create the fog significantly reducing lag from fog.
If anything, using a script to create fog would be harder on the server than using a placeable.
Posted: Tue Jan 25, 2005 8:31 am
by JollyOrc
Psyco wrote:The lag caused by fog is primarily client side, and felt a lot more on lower end systems.
I can't see the method used to create the fog significantly reducing lag from fog.
If anything, using a script to create fog would be harder on the server than using a placeable.
uhm..
adding ambience fog: nice on weaker systems. Don't ask me to give the specifics, but it does help a lot as the systems have to render less.
adding fog placeables: Quickly gets really nasty on even better systems if you overdo it.
Case example: The steamtunnels under The Canvas. In the first iteration I used mostly fog placeables, which made my computer crawling sometimes. When I switched to ambience fog from the visual settings, things got much nicer fast.
NO idea about server side load with these scripts of course.
Posted: Tue Jan 25, 2005 9:53 am
by Mothandric
Cheers for the input, I shall happily ignore the existence of setfogamount etc. commands and continue on my merry way without them.

Posted: Sun Jan 30, 2005 1:54 pm
by Cymbolism
does anyone know, did fog amount exist in the toolset as an area property before 1.65, or just fog distance?
Posted: Sun Jan 30, 2005 5:32 pm
by Alustriel
Just distance in the area settings. The SetFogAmount is doing something similar, will test it a bit later.
For testing I had the following attached to a lever placeable, it increments the fog amount by 10% everytime you use it with 100% as maximum. Don't know yet if the integers on the area stored are needed, perhaps the Get/SetFogAmount does the same.
Code: Select all
void main()
{
object oArea = GetArea(GetLastUsedBy());
int iFogAmount = GetLocalInt (oArea, "FogAmount");
iFogAmount = (iFogAmount<100) ? iFogAmount+10 : 100;
SetFogAmount (FOG_TYPE_ALL, iFogAmount, oArea);
SetLocalInt (oArea, "FogAmount", iFogAmount);
}
Posted: Sun Jan 30, 2005 5:41 pm
by Cymbolism
ok cheers, does that mean then that the 'fog amount' setting of any areas built before 1.65 have defaulted to '0' does anyone know?
Posted: Mon Jan 31, 2005 8:44 am
by Alustriel
The fog distance in the area settings looks likes something different, e.g. if you set it to 20 you just see a wall of fog appear, impenetrable and not really natural.
The Set/Get Fog commands create fog all around you and look much better, both together look real unheimlich (ominous [new word for me], sinister, creepy).
I am currently enhancing the fx wand to add features for fog setting.
Posted: Fri Mar 11, 2005 11:17 pm
by Ulversial
the fog settings has always been accesible from the toolset, although one of these two; fogdistance and fogammount was introduced with HTOU to deal with skybox issues methinks...
so, the values of course default to what's set in your areas specefic settings in the toolset...
the scripts commands has only provided the ability to change those settings on the fly, in-game
lagwise, it's just a call to change a parameter so unless it isn't changed repeatedly it wouldn't be a prob right?