Re: What's up with LOS?
- From: Ray Dillinger <bear@xxxxxxxxx>
- Date: Fri, 27 Apr 2007 17:04:47 -0700
Jude H wrote:
John Doe <NOTOSPAMjohndoe64738@xxxxxxxxx> wrote:
Are all the LOS ideas I've read about in here on roguebasin? If not,
would you please transfer them there?
For myself, it wouldn't be worth the time, since recursive shadowcasting meets all of my current and likely future requirements.
Well, let's see: I use spiral-path for O(N) player and monster
light radii (where N is the number of squares lit) and also for
O(N) player field of view. I've made two simple variations in
the algorithm not mentioned in the article on roguebasin, though.
One is to mark squares as visible iff there's a center-to-center
lineofsight. ie, light can pass through a square without making
that particular square (or monsters in it) visible, provided it
doesn't pass through the square's center. This means that sight
checks are always mutual; if you have line of sight on a monster,
it has line of sight on you.
The second is that while illuminating squares for player field of
view, I also mark the squares with distance to the player and the
dungeon time of the FOV calculation. This gives monsters a "free"
O(1) line of sight check on the player; they just check the square
they're standing in to see if the player saw their square the last
time s/he moved. This also means that a monster standing in any
square that the player has ever seen, can just check the eight
squares next to it for more recently seen squares and squares seen
from a shorter distance and make a local decision in constant time
about how to chase and follow the player. It always goes for the
most recently seen square. Given squares seen equally recently,
it goes for the one seen from a shorter distance. I call this
ability "autochase." You have to be careful what monsters get to
use it and how much; before the player gets teleport, autochase
can make most levels unwinnable if a lot of monsters have it, or
if more than a few have it all the time.
One thing I think will work well, but haven't done yet, is that
most monsters only get autochase when they actually *see* the
player character, and depending on monster INT, the ability
doesn't last very long.
Bear
.
- Follow-Ups:
- Re: What's up with LOS?
- From: Stefan Dorn
- Re: What's up with LOS?
- From: Gerry Quinn
- Re: What's up with LOS?
- From: Jude H
- Re: What's up with LOS?
- References:
- What's up with LOS?
- From: John Doe
- Re: What's up with LOS?
- From: Jude H
- What's up with LOS?
- Prev by Date: Re: Crash Course to Roguelike Development
- Next by Date: Re: What's up with LOS?
- Previous by thread: Re: What's up with LOS?
- Next by thread: Re: What's up with LOS?
- Index(es):
Relevant Pages
|