A Survey on 2D Visibility Algorithms: Ray Casting, Rectangle-Based FOV and Recursive Shadowcasting
Abstract
Field of view (FOV) algorithms are essential in determining the visible area of a player in 2D games. These algorithms dynamically calculate the visible areas while occluding these hidden areas, and play an important role in games such as roguelikes and stealth games. This survey summarizes three 2D FOV algorithms: ray casting, rectangle-based FOV, and recursive shadowcasting. The ray casting algorithm casts rays to determine which area was hidden from the player, which is a basic FOV algorithm. Rectangle-based FOV optimizes computation for large 2D grids by representing obstacles as rectangles, also using a quadtree to improve the access speed. Recursive shadowcasting efficiently computes the visible area by dividing the grid into 8 octants and recursively splitting the view when obstacles are encountered. This survey also mentioned how to adapt the recursive shadowcasting algorithm to 2.5D and 3D environments.
References
- Evan R.M. Debenham et al. "Efficient Field of Vision Algorithms for Large 2D Grids". In: International Journal of Computer Science and Information Technology (2021). DOI: 10.5121/ijcsit.2021.13101.
- J. C. Wilk. Comparative study of field of view algorithms for 2D grid based worlds. RogueBasin. Avail- able online: https: //www.roguebasin.com/index.php/Comparative study of field of view algorithms for 2D grid based worlds, accessed on 2026-01-14. 2009.
- J. C. Wilk. Ray casting. RogueBasin. Available online: https: //roguebasin.com/index.php/Ray casting, accessed on 2026-01-14. 2009.
- Ana Batinovic et al. "A Shadowcasting-Based Next-Best- View Planner for Autonomous 3D Exploration". In: IEEE robotics automation letters (2022). DOI: 10.1109/lra.2022.3146586.
- "Computational geometry: Algorithms and applications". eng. In: Computers mathematics with applications (1987) 36.6 (1998), p. 139. ISSN: 0898-1221.