Shadow casting

From RogueBasin
(Difference between revisions)
Jump to: navigation, search
(Added articles, a couple of advantages/disadvantages and a link to libfov.)
 
(Added a quick summary of shadow casting. Tweaked disadvantages.)
Line 1: Line 1:
 
==What is Shadow Casting?==
 
==What is Shadow Casting?==
 +
 +
Shadow casting is a way to implement [[Field of Vision]]. In shadow casting, a destination square is visible from a source square if there exists an unobstructed line from the center of the source square to any point in the destination square. There are several efficient algorithms to accomplish this, including one which only visits squares that are visible ([[Spiral Path FOV]]).
  
 
==Advantages==
 
==Advantages==
Line 9: Line 11:
 
==Disadvantages==
 
==Disadvantages==
  
* Some counter-intuitive results
+
* Some artifacts (corners of rooms, for example).
 +
* Non-symmetric, making it awkward for some implementations of ranged combat.
  
 
==How do I implement it?==
 
==How do I implement it?==

Revision as of 06:37, 27 April 2007

Contents

What is Shadow Casting?

Shadow casting is a way to implement Field of Vision. In shadow casting, a destination square is visible from a source square if there exists an unobstructed line from the center of the source square to any point in the destination square. There are several efficient algorithms to accomplish this, including one which only visits squares that are visible (Spiral Path FOV).

Advantages

  • Moderately easy to implement
  • Efficient
  • Existing library

Disadvantages

  • Some artifacts (corners of rooms, for example).
  • Non-symmetric, making it awkward for some implementations of ranged combat.

How do I implement it?

What games use it?

Most modern games use shadow casting.

What libraries implement it?

  • libfov is a C++ library which implements recursive shadow casting.
Personal tools