Research Article

A Survey on 2D Visibility Algorithms: Ray Casting, Rectangle-Based FOV and Recursive Shadowcasting

Wenjun Huang*, Ziming Weng
University of Nottingham

* Corresponding author: [email protected]

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.

Keywords: FOV algorithms; 2D games; Ray casting; Recursive Shadowcasting
Published: February 2, 2026
DOI: 10.54254/2755-2721/2026.AD31573
Volume: ACE Vol.226
pp. 22-28
Download PDF

References

  1. 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.
  2. 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.
  3. J. C. Wilk. Ray casting. RogueBasin. Available online: https: //roguebasin.com/index.php/Ray casting, accessed on 2026-01-14. 2009.
  4. 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.
  5. "Computational geometry: Algorithms and applications". eng. In: Computers mathematics with applications (1987) 36.6 (1998), p. 139. ISSN: 0898-1221.