Charlie storm a rooftop

While one bot is firing the other advances

With his team mate providing suppresion fire a bot advances


Hosted by:
Bot Epidemic
and
TeleFragged

Visitor #: 00908

Latest news on CGFThe CGF conceptTechnical CGF information [AI and design]Got a CGF question? Read this firstHow to script CGF missions yourselfGet your CGF files and missions hereLinks to related sites [such as AQ2 or AI sites]

Fog for CGF
(OpenGL1.1 graphics drivers only)

If you have an up to date graphics boards that implements the full OpenGL library (most new boards, and also the 3dfx Voodoo series via a trick described here), CGF brings you something special: fog (CGF versions 0.80 and later).

Fog reduces visibility, and adds atmosphere. It transforms a standard sniper map into a map that requires a new way of combat. You'll change your tactics, weapon preferences, and experience a map anew, as can be seen from the screen shots below.

Note that on some maps (and for some drivers), fog doesn't seem to work right: player models light up in the distance. It's out of my control (and there must be a reason why Id Software didn't enable fog in the first place).

fire team, advancing towards hard to spot threat medium range sniping at city - forget about long range in these weather conditions friends or foes, those guys running towards me?

There are four important aspects to fog in CGF:

  • it's optional (and defaults to 'off'); only when you set the console var 'fog' to 1, run the OpenGL video mode, and load a new map (or mission), you'll see fog
  • it's fully configurable - pick the type of fog, fog density, fog color and define your default and per map preferences
  • the bot AI understands fog and operates with reduced visibility. The AI also understands the ability to 'hide' in the fog.
    Your preferences regarding fog type and fog density are taken into account - not a trivial thing to do but it didn't take rocket science either.
  • you can toggle fog on a mission per mission basis - set fog to '0' and the next mission is ran without fog (and AI understanding this). Set fog to '1' and during the next mission, everything will be hazy (including the bots' vision).
Fog preferences are stored in the directory '.\action\cgf\fog' as '*.fog' files. The directory will contain the following files:
  • default.fog
    contains the default fog settings that are applied when 'fog' is enabled and no map specific settings have been found.
  • <mapname>.fog
    contains the map specific fog preferences for map <mapname>. By defining a fog density of '0', fog is disabled for that map.
A '*.fog' fog preferences is really a text file that you can view and edit. It looks like:

// format: mapname density fog_type red green blue begin end
//       - density: 0.00 -> no fog
//         density normally in range 0.05 ... 0.20
//       - fog_type: 0 = exp     (fog linear with distance)
//                   1 = exp2    (fog increasing more than linear)
//                   2 = linear  (fog linear within specific begin-end range)
//       - red/green/blue in range [0.0 .. 1.0]
//       - begin:    start distance for linear fog (no fog within begin dist)
//       - end  :    end distance for linear fog (no vision beyond end dist)
actcity2     0.10  2  0.50 0.50 0.45 200 1600
 
To craft a new preference file for map <mapname>, all you have to do is:
  1. copy the defaults.fog file to <mapname>.fog
  2. change, at the last line, 'default' to <mapname>
  3. pick a fog density (0 = no fog, good values are between 0.05 and 0.20)
  4. pick a fog type - linear fog (value: 2) tends to work best, followed by exp2 (value 1)
  5. define the fog color by specifying values for the red, green and blue components. Values close to grey (red, green and blue values identical work best - change one of these for a slight color effect - actcity2 above has a yellow shaded fog).
    Note that the fog itself adds or removes ambient light from the map: picking small values, such as 0.1 0.1 0.1, results in a very dark map, whereas large values, such as 0.8 0.8 0.8 results in a bright map.
  6. pick a begin distance (for linear fog only). Fog effects won't start at distances smaller than this. (Distance in Q2 units (about an inch)).
  7. pick an end distance (for linear fog only). You cannot see thru fog beyond this distance (and neither can the bots). (Distance in Q2 units (about an inch)).
  8. save the file and launch the game
In most cases, the fog defaults suffice. In 'office style' indoor maps, you map want to disable or reduce the fog considerably though.
The effects of fog color are shown below:

the City map with linear fog colored: rgb = 0.1 0.1 0.1 the map prepared for fog conditions: p1_lightbeam (and it's light tower - exp2 fog) the City map with linear fog colored: rgb = 0.9 0.9 0.9

The table below lists information on 3D chipsets and their support for fog. The table reflects the information I've received from gamers. I do not guarantee its accuracy. If you get fog working on one the of 'probably' boards work, please let me know.
To determine the chipset in your 3D accellerator, don't email me but look it up in the manual or on the box accompanying your 3D accellerator.

chipset support for fog (via OpenGL1.1 drivers)
supported probably probably not no
Riva TNT
Riva TNT2


Matrox G400
using OpenGL ICD

3dfx Voodoo
with glquake opengl32.dll
Savage4 ATI Rage 128
ATI Rage Pro
3dfx Voodoo
with 3dfx Q2 drivers

Matrox G400
using Turbo DLL

Apparently, fog can be enabled on the 3dfx Voodoo board using the following trick:

  1. get the opengl32.dll intended for glquake (Quake1);
    it's here at FilePlanet.
  2. copy the opengl32.dll into your quake2 (root) dir
  3. launch Quake2, in the video menu, set the mode to 'default opengl'
  4. make sure you've set fog to 1 (see here)
  5. quit and launch CGF

I wouldn't have been able to add fog to CGF without the work and assistance of:

William



Questions? Comments? Suggestions? Send them here
CGF is written by William van der Sterren. All content is © William van der Sterren unless otherwise stated.
Action Quake2 is written by, and ©, the A-Team
CGF website designed by Cube, © 1999. Best viewed @ 800x600 HiColor in a version 4 browser.
And yes, a large number of bots were hurt during the photo sessions (but they fell in the line of duty).

This site uses the PNG (Portable Network Graphics) image format.
If your browser cannot display this image format please go to this site to download a plug-in.