Fog of War
#1
Fog of War
Ver 2.01
by Wachunga
Not DerVVulfman

Text within the post was written by Wachunga, Dec. 6, 2005.

Summary
A map specified as having "fog of war" has tiles that are (fully or partially) obscured until the player gets within visual range. The amount of fog of war to disappear as the player moves depends on the visual range specified. Gamers with experience playing Real Time Strategy games like Warcraft, Age of Empires, etc. should be quite familiar with the concept.

This script supports two kinds of fog of war: static and dynamic.

Static fog of war is the kind that typically hides terrain in RTS games. It covers the entire map until the player explores the area, discovering the underlying terrain. Once static fog of war disappears from an area of the map, it stays gone indefinitely (even if loading a saved game, leaving the map and returning later, going to the menu, etc).

Dynamic fog of war is identical to the static kind except that it doesn't stay gone forever: as soon as the player leaves visual range of an explored tile, dynamic fog of war covers it again. This kind is typically used to hide enemy units in RTS games.


Features
  • both types of fog of war supported
  • customizable view range
  • customizable fog autotile (plug in your own if you wish)
  • doesn't take up any tileset or autotile slots
  • handles move events (jumping, speed)
  • works with Cogwheel's Pixel Movement script
  • persists between saves, teleports, etc.
  • customizable opacity
  • can be turned on and off dynamically



Resources
You'll need this custom fog of war autotile, unless you choose to make your own.


Demo
Featuring a cantankerous old man:

.zip   FOG OF WAR DEMO.zip (Size: 955 KB / Downloads: 6)
-- Instructions are within the script --


Compatibility
For compatbility with Cogwheel's Pixel Movement script, place Cog's script ABOVE the Fog of War script. Then replace Cog's Game_Player/update method with the following version (or just copy and paste the section preceded by a "FoW" comment):
Compatability Patch

Note: this is a repost. There were many pages of discussion in the original thread at RMXP.net that you would have liked to look through. Site no longer available.


.png   fow_default.png (Size: 4.51 KB / Downloads: 7)
Reply }


Messages In This Thread
Fog of War - by Wachunga - 03-02-2008, 07:19 AM
RE: Fog of War - by Tepe - 11-03-2024, 11:41 PM



Users browsing this thread: 1 Guest(s)