Difference between revisions of "Shadow casting"
Jump to navigation
Jump to search
(added SquidLib to list of FoV libraries and link to page showing shadowcasting algorithm in Java from SquidLib) |
|||
Line 30: | Line 30: | ||
* [[SquidLib]] is a Java library which includes an easy to read recursive shadowcasting algorithm. | * [[SquidLib]] is a Java library which includes an easy to read recursive shadowcasting algorithm. | ||
* [[libfov]] is a C | * [[libfov]] is a C library which implements recursive shadow casting. | ||
* [[Roguelike Library For Java]] provides an implementation of shadow casting in Java. | * [[Roguelike Library For Java]] provides an implementation of shadow casting in Java. | ||
* [[libtcod]] | * [[libtcod]] |
Revision as of 18:59, 22 December 2015
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 two which only visits squares that are visible (Spiral Path FOV and FOV using recursive shadowcasting).
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?
- Computing LOS for Large Areas
- FOV using recursive shadowcasting
- FOV using recursive shadowcasting - improved
- Improved Shadowcasting in Java
- Spiral Path FOV
- Precise Shadowcasting in JavaScript
What games use it?
Most modern games use shadow casting.
What libraries implement it?
- SquidLib is a Java library which includes an easy to read recursive shadowcasting algorithm.
- libfov is a C library which implements recursive shadow casting.
- Roguelike Library For Java provides an implementation of shadow casting in Java.
- libtcod
- rot.js implements Precise Shadowcasting