Server Totals
Deglos - (1)
Visimontium - (1)
Le'Or - (0)
Ferrell - (0)
Elysia - (0)
M'Chek - (0)
Mikona - (0)
Wilderness - (0)
Underdark - (0)
Total players: 2
Gallery

Links Menu

getfogamount and setfogamount: How do they work?

Moderators: Nighthawk4, Dungeon Masters

getfogamount and setfogamount: How do they work?

PostAuthor: 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?

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

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

PostAuthor: 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
Alexandru Stanicu
Legacy DM
Legacy DM
 
Posts: 14082
Joined: Sun Oct 20, 2002 10:59 pm
Location: Texas
Timezone: CST
DM Avatar: The Hammer

PostAuthor: 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
Psyco
Elder Sage
 
Posts: 3297
Joined: Mon Jun 30, 2003 10:05 pm
Location: New Zealand (NZDT, +12 GMT)

PostAuthor: 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.
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: 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

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

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

PostAuthor: 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);
}

Alustriel
Apprentice Scholar
 
Posts: 854
Joined: Mon Apr 07, 2003 12:08 pm
Location: GMT+1/+2 dst

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

PostAuthor: 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.

Alustriel
Apprentice Scholar
 
Posts: 854
Joined: Mon Apr 07, 2003 12:08 pm
Location: GMT+1/+2 dst

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


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Google [Bot], Gorgon, slow feet