getfogamount and setfogamount: How do they work?

Moderator: Event DM

Post Reply
Mothandric
Sage
Posts: 2163
Joined: Wed Jul 16, 2003 5:47 pm
Location: GMT +1

getfogamount and setfogamount: How do they work?

Post by Mothandric » Mon Jan 24, 2005 3:17 pm

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?
User avatar
Krator
Elder Sage
Posts: 4935
Joined: Thu Jun 10, 2004 6:44 pm
Timezone: GMT
Location: Amsterdam

Post by Krator » Mon Jan 24, 2005 3:26 pm

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 :)
Playing as: Sir Douglas Hope of Gorethar, old school paladin | Krator Blackfist, gold mage | Warren, half nymph barbarian
User avatar
Alexandru Stanicu
Legacy DM
Legacy DM
Posts: 14074
Joined: Sun Oct 20, 2002 10:59 pm
Timezone: CST
DM Avatar: The Hammer
Location: Texas

Post by Alexandru Stanicu » Mon Jan 24, 2005 11:44 pm

I am not sure that players can use these on multiplayer servers...
I ain't as good as I once was, But I'm as good once as I ever was...


:devil: 4evar!
User avatar
Psyco
Elder Sage
Posts: 3288
Joined: Mon Jun 30, 2003 10:05 pm
Location: New Zealand (NZDT, +12 GMT)
Contact:

Post by Psyco » Tue Jan 25, 2005 12:00 am

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.
Player Housing info - This answers most questions people have. Read this before asking.
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Tue Jan 25, 2005 8:31 am

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.
Mothandric
Sage
Posts: 2163
Joined: Wed Jul 16, 2003 5:47 pm
Location: GMT +1

Post by Mothandric » Tue Jan 25, 2005 9:53 am

Cheers for the input, I shall happily ignore the existence of setfogamount etc. commands and continue on my merry way without them.

:D
User avatar
Cymbolism
Scholar
Posts: 1437
Joined: Tue May 20, 2003 6:32 pm
Location: Bunbury, Western Australia, GMT+8
Contact:

Post by Cymbolism » Sun Jan 30, 2005 1:54 pm

does anyone know, did fog amount exist in the toolset as an area property before 1.65, or just fog distance?
I have three kids and no money.
Why can't I have no kids and three money? - Homer Simpson.
Alustriel
Apprentice Scholar
Posts: 853
Joined: Mon Apr 07, 2003 12:08 pm
Location: GMT+1/+2 dst
Contact:

Post by Alustriel » Sun Jan 30, 2005 5:32 pm

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);
}
User avatar
Cymbolism
Scholar
Posts: 1437
Joined: Tue May 20, 2003 6:32 pm
Location: Bunbury, Western Australia, GMT+8
Contact:

Post by Cymbolism » Sun Jan 30, 2005 5:41 pm

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?
Alustriel
Apprentice Scholar
Posts: 853
Joined: Mon Apr 07, 2003 12:08 pm
Location: GMT+1/+2 dst
Contact:

Post by Alustriel » Mon Jan 31, 2005 8:44 am

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.
User avatar
Ulversial
Whiney Peasant
Posts: 16
Joined: Tue Jun 29, 2004 8:16 pm
Contact:

Post by Ulversial » Fri Mar 11, 2005 11:17 pm

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?
Post Reply