Tile Based Fog Of War

Nocturne Assets

You must be logged in to obtain assets


This small set of scripts are ideal for anyone making grid-based games that wants a light and easy to use fog of war system. The basis for the scripts are tiles, which are layered over the room then cleared away around a given point when required. You can add multiple instances which clear the fog to the room.

As a bonus, the scripts also permit a VERY basic grid-based lighting system, which only permits one light source, but that source will convincingly illuminate a given area, and cast tile "shadows" behind any blocker instances.

Please note that the scripts use a rounding method to convert room coordinates to grid coordinates, meaning that you may have to offset the origin (x,y) by about half the tile size +1 when calling the update script. So for a 16x16 tile size, the arguments would be (x + 9, y + 9). The actual values you use will depend greatly on the tile size you have and the origin of the instance calling the script.

UPDATE: There is now a new script included with this to calculate the correct grid squares between two points. This is called "Bresenham's Line Algorithm" and is VERY handy in a number of situations. It is a stand-alone script so that you can use it in other games or situations.

More info

End User Licence Agreement (EULA).

Age Rating: 4+


GMS1 - Version 1.1.0. Published October 6, 2014

  • Minor tweak to the Bresenhams script to make wall detection and tile choice better. Most noticeable in narrow corrifors, where previously there was more of one side shown than the other. This is no longer the case.
  • Scripts should now work with sprites that have a center offset rather than a corner offset, although this is not the recommended choice
  • Overhauled the demo GFX to make it more attractive... :)
Privacy Policy
Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait