getfogamount and setfogamount: How do they work?
Moderator: Event DM
-
- Sage
- Posts: 2163
- Joined: Wed Jul 16, 2003 5:47 pm
- Location: GMT +1
getfogamount and setfogamount: How do they work?
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?
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)

Playing as: Sir Douglas Hope of Gorethar, old school paladin | Krator Blackfist, gold mage | Warren, half nymph barbarian
- Alexandru Stanicu
- Legacy DM
- Posts: 14074
- Joined: Sun Oct 20, 2002 10:59 pm
- Timezone: CST
- DM Avatar: The Hammer
- Location: Texas
- Psyco
- Elder Sage
- Posts: 3288
- Joined: Mon Jun 30, 2003 10:05 pm
- Location: New Zealand (NZDT, +12 GMT)
- Contact:
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.
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.
Player Housing info - This answers most questions people have. Read this before asking.
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
uhm..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.
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.
-
- Sage
- Posts: 2163
- Joined: Wed Jul 16, 2003 5:47 pm
- Location: GMT +1
-
- Apprentice Scholar
- Posts: 853
- Joined: Mon Apr 07, 2003 12:08 pm
- Location: GMT+1/+2 dst
- Contact:
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.
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);
}
-
- Apprentice Scholar
- Posts: 853
- Joined: Mon Apr 07, 2003 12:08 pm
- Location: GMT+1/+2 dst
- Contact:
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.
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.
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?
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?