Temple of The Roguelike Forums

Development => Programming => Topic started by: KarlG on February 17, 2020, 04:33:07 PM

Title: My FOV Algorithm for Atari 2600 Game
Post by: KarlG on February 17, 2020, 04:33:07 PM
Hello, I am not actually making a roguelike at the moment, but I would like to take a stab at it eventually. What I am making is an 2D tiled Ultima-style game on the Atari 2600, so I have had to implement a FOV algorithm on there. I have extremely limited RAM (256 bytes) and CPU time to work with, so I needed to come up with something that would work on that platform. The result seems to be the same as what I've seen of the output of Permissive FOV algorithms.

Anyway, what I am wondering is if there are any existing algorithms that use a similar approach to what I did with my Atari game. Here's what I do to determine tile visibility:


Obviously, the order in which tiles are checked matters, since the visibility of the parent tile/tiles needs to be known. In my case, I pre-computed the parent tiles for each tile and store those in the ROM of my game to save precious CPU time. How I'd implement it on a more modern system is doubtless different, but I'm curious if there are any existing algorithms that use a similar approach.

(https://i.ibb.co/6JSmFwn/penult-21.png) (https://ibb.co/BKJtB3z)
Title: Re: My FOV Algorithm for Atari 2600 Game
Post by: Krice on February 18, 2020, 11:11:50 AM
That explanation is kind of vague, but if it works then it's quite clever! I have a faint recollection that this kind of routine has been discovered earlier.