Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - KarlG

Pages: [1]
1
Programming / My FOV Algorithm for Atari 2600 Game
« 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:

  • The hero and all adjacent tiles are always visible.
  • For each tile in an orthogonal or perfect diagonal line from the hero, the tile remains visible if its adjacent "parent" tile one step closer to the hero is visible and not solid.
  • All other tiles have two "parent" tiles, which are the two adjacent tiles closest to the hero. If either of these parent tiles is visible and not solid, then the tile remains visible.

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.


Pages: [1]