Jump to content

Fog effects in Enhanced Editions


Recommended Posts

I'd like to experiment a bit with fog effects in one of my mods. Apparently both FOGAREA.2DA and FOGPT.2DA can be used to influence fog behavior and appearance.

FOGAREA.2DA (SoD):

2DA V1.0
-1
          ALPHA   CONTRAST  OUTER_RED   OUTER_GREEN   OUTER_BLUE  INNER_RED   INNER_GREEN   INNER_BLUE  PRE_DISPERSE_SECONDS
1         0.75    120       211         211           211         211         211           211
2         0.10    100         0           0           205         224         255           255
3         0.10    100       238         232           170         238         232           170
4         0.10    100       238         232           170         238         232           170      
BD0120    0.25    100         0           0             0         255         255           240         60
BD1200    0.10     70         0           0           205         224         255           255         60
BD3000    0.25     80       210         180           140         210         180           140         60
BD4000    0.10     70       210         180           140         139          69            19         60
BD4400    0.49    110        35          15            15          65          45            45         60  
BD4500    0.49    110        35          15            15          65          45            45         60
BD4700    0.25     80        45          15            15          45          45            45         90
BD5100    0.20     50       176         224           230         175         238           238         60
BD6100    0.90    100       238         232           170         238         232           170         10

And FOGPT.2DA (SoD):

2DA V1.0
-1
    AMOUNT  DURATION  X     Y     U_VEC   V_VEC      
1   35      800       4473   583  -30.0    15.0  
2    5      400       3611  1637   -3.0     0.0 
3   70      400       2560  1920  -20.0   -15.0
4   15      400       1070   960   -1.0    -1.0

Does anyone have more detailed knowledge about what each parameter does mean? Are there more options to influence fog? (Avenger, CamDawg?)

Edited by argent77
Link to comment

Some bits from my own observations:

FOGAREA.2DA: Both ALPHA and CONTRAST appear to define visibility of generated fog. (OUTER/INNER)_(RED/GREEN/BLUE) can be used to define fog color (edges and inner area). RED and BLUE columns for both types are mixed up though. RED is actually BLUE and vice versa. PRE_DISPERSE_SECONDS is probably the delay before the stream of fog particles starts to disperse.

FOGPT.2DA: AMOUNT seems to be the amount of fog particles generated per time frame. DURATION defines the duration of the fog generator before it stops producing fog particles. X and Y can be used to define the location of the fog generator. I don't know if there is a way to define more than one fog generator per map. Adding multiple lines for the same area doesn't work. U_VEC and V_VEC define speed and direction of the fog particles, U for horizontal direction, V for vertical direction.

Both files support area-specific definitions by putting the respective area code in the first column.

Screenshot from ToB starting area (green fog with bluish edges, generated over one of the stone faces on the map):

z6j8wyr6f0tg.jpg

 

Link to comment

Colors are defined by their RGB values (each component in the range of [0..255]). I don't remember exactly which RGB values I've used for the example screenshot above (for the solid area some light green with a bit of blue mixed in and a bluish/cyan color value for the fog edges).

Some additions: Fog is a weather effect, so it does work only correctly if the map is added to MASTAREA.2DA. The fog effect itself needs some space to develop properly, so the map should not be too small. I wanted to use it in a smaller dungeon map, where fog should simulate poisonous fumes emanating from a portal. But it's difficult to make it look right, since dispersion starts too late.

Link to comment
FOGAREA.2DA: Both ALPHA and CONTRAST appear to define visibility of generated fog. (OUTER/INNER)_(RED/GREEN/BLUE) can be used to define fog color (edges and inner area). RED and BLUE columns for both types are mixed up though. RED is actually BLUE and vice versa. PRE_DISPERSE_SECONDS is probably the delay before the stream of fog particles starts to disperse.

 

FOGPT.2DA: AMOUNT seems to be the amount of fog particles generated per time frame. DURATION defines the duration of the fog generator before it stops producing fog particles. X and Y can be used to define the location of the fog generator. I don't know if there is a way to define more than one fog generator per map. Adding multiple lines for the same area doesn't work. U_VEC and V_VEC define speed and direction of the fog particles, U for horizontal direction, V for vertical direction.

 

Both files support area-specific definitions by putting the respective area code in the first column.

 

You pretty much got it.

I don't remember if pre disperse was actually working, though.

 

Unfortunately it does not work with vanilla games and I am reluctant to provide two sets of maps, according to the game. :(

 

I believe you need to set the fog flag/probability in the area.

Edited by Ardanis
Link to comment

Interesting. I intended to add light fogs in forest and grove maps. Unfortunately it does not work with vanilla games and I am reluctant to provide two sets of maps, according to the game. :(

 

I don't understand this one. Yeah, fog won't work in vanilla games, but why would you need to provide two sets of maps because of fog? The fog feature, while it won't work in vanilla as it is an EE feature, doesn't break any vanilla area.

Link to comment

Update:
It looks like the global variable "FOG_TYPE" can be used to select a specific fog definition that should be used by the map. It refers to the (numeric) value found in the first column of FOGPT.2DA.


Example from SoD's BD6100.BCS, which enables a specific fog effect after progressing the main story to a certain point:

Spoiler

IF
  GlobalLT("bd_plot","global",680)
THEN
  RESPONSE #100
    SetGlobal("bd_plot","global",680)
    SetGlobal("FOG_TYPE","GLOBAL",4)
    Continue()
END

IF
  !GlobalTimerNotExpired("bd_ambush_timer","bd6100")
  Switch("bd_finale","bd6100")
THEN
  RESPONSE #0
    IncrementGlobal("bd_finale","bd6100",1)
    SetGlobal("FOG_TYPE","GLOBAL",4)
    CreateCreature("bdcutid",[500.400],S)  // No such index
  RESPONSE #1
    SetGlobal("bd_plot","global",690)
    IncrementGlobal("bd_finale","bd6100",2)
    SetGlobalTimer("bd_ambush_timer","bd6100",4)
    Weather(FOG)
    PlaySound("EFF_M87")
    // ...
END

 

However, once FOG_TYPE is set it doesn't seem to be possible to return to map-specific fog definitions (for any map using fog). Setting it to 0 doesn't work. Not sure if this is intended or a bug.

 

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...