Posted August 17, 2024 by Turtwiggy
Hiya! This week I implemented a symmetric shadowcasting fov algorithm but with a head-melter twist; edges.
The way I generate (ships/dungeons) means that there's an edge between two grid rooms. Symmetric shadowcasting doesn't need edges, but I do to prevent issues like:
My implementation was pretty ugly, I just ran the fov-algorithm in a pre-processing step to change anything behind an edge to be a wall, so it looks like this internally where red is the adjusted floor=>wall tile. However, this whole approach of edges breaks the symmetric-ness in some situations e.g.
Overall I'm gonna keep it to prevent looking through walls, but it's not ideal that a room that should have identical fov doesn't. Alternative fixes could be: a) change the room generation algorithm b) remove edges between rooms, but I don't like this because the eventual idea is that rooms will contain oxygen, so the smaller rooms allow for more fine-tuning of where o2 gets blown out the ship.
Thanks :) Turtwiggy