Difference between revisions of "Permissive Field of View"

From RogueBasin
Jump to navigation Jump to search
Line 27: Line 27:
* A fast algorithm using pre-cached dependencies is described in the source code for [[Dungeon Crawl Stone Soup]]
* A fast algorithm using pre-cached dependencies is described in the source code for [[Dungeon Crawl Stone Soup]]
* [[Precise Permissive Field of View]] -- A fast and, in theory, artifact free variation.
* [[Precise Permissive Field of View]] -- A fast and, in theory, artifact free variation.
** [[Roguelike Library For Java]] --  A port of Jonathan Duerigs Precise Permissive code to Java.
** [[Permissive Field of View in Python]] -- Provides an implementation of the precise permissive field of view algorithm in python.
** [[Permissive Field of View in Python]] -- Provides an implementation of the precise permissive field of view algorithm in python.



Revision as of 21:29, 25 December 2007

What is Permissive Field of View?

Permissive field of view defines visibility more loosely than other Field of Vision methods. A destination square is visible from a source square if there is any unobstructed line from some point in the source square to some point in the destination square. This means that players and monsters will automatically 'peek' around corners, for example. It also means that field of view is symmetric. That is to say that if a destination square is visible from a source square, then that source square is also visible from the destination square. Some approximation algorithms might lose the property of guaranteed symmetry.

One tricky corner case are literally the corners. There are two questions that must be answered. Are corners of squares valid points in the source and destination squares for determining visibility? And do corners of walls obstruct line of sight? Different algorithms may answer these questions in different ways.

Advantages

  • Symmetry of field of view may make ranged combat more sensible.
  • Monsters cannot sneak up on the player as easily.
  • Reduced player exploitation of line of sight artifacts.
  • There is an existing library implementing it.
  • May make certain aspects of the game easier (realistic lighting).

Disadvantages

  • The most complicated method to understand and implement (and therefore debug).
  • The player cannot sneak up on monsters more easily.
  • May ruin play balance of current games.
  • It is more difficult for the player to withdraw from ranged combat.

How do I implement it?

There are a number of articles describing different methods:

What games use it?

What libraries implement it?

  • permissive-fov is a library which implements Precise Permissive Field of View and exports it using a flexible interface. Note that currently it does not support beams which means that it is not useful for determining affected squares for beam attacks, etc.