Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: Grim <marcinb64@xxxxxxxxxxxxxx>
- Date: Sun, 18 Jan 2009 12:50:01 -0800 (PST)
On 15 Sty, 14:25, b0rsuk <jaze...@xxxxxxxxx> wrote:
I see. I've examined the other Python implementation (seems much
nicer, by the way) and it seems that it's not too hard to modify it to
stop expanding into thick walls. You may want to check it if you're
interested in improving it.
(I'm not sure if it actually speeds things up in some cases. Probably
yes. By the way, the workaround I proposed is not actually changing
the implementation, but the data you feed into it. Hopefully made
obsolete by that other version, I'll have a closer look.
I think going one tile behind walls is what this algorithm needs to
work properly. Only then, after merging inputs from potentially more
than one tile, it can decide if it should terminate the ray or not.
Anyway, I couldn't find a way to make it stop on the first wall tile
without breaking it...
The original implementation assumes that all obstacles are visible,
and the algorithm is used to determine what other tiles are visible,
not which obstacles. The obscure() method returns true for all walls,
visible or not (like those "deep" walls behind other walls). That's
why instead of a boolean value I've got 3 possible values (the FOV_*
constants): visible, visible obstacle, and obscured. For FOV
calculation, the last 2 values are the equivalent of the original
obscure() returning true, but from visibility point of view, the first
two values designate a visible tile.
I haven't had much time lately to look into libtcod's implementation
but I'm looking forward to it. The post processing step sounds
interesting. My current code produces artifacts - missing room
corners.
Grim
.
- Follow-Ups:
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: Ray Dillinger
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: b0rsuk
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- References:
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: Grim
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: dominikmarczuk
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: Grim
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: jice
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: b0rsuk
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: jice
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- From: b0rsuk
- Re: Intriguing new Line Of Sight algorithm (Java, Python)
- Prev by Date: Re: Intriguing new Line Of Sight algorithm (Java, Python)
- Next by Date: Re: My First Roguelike: "Gruesome" v0.0.1
- Previous by thread: Re: Intriguing new Line Of Sight algorithm (Java, Python)
- Next by thread: Re: Intriguing new Line Of Sight algorithm (Java, Python)
- Index(es):
Relevant Pages
|