Line of view in a 2d maze (RPG)
Hi
I'm making a clone of Eye of the Beholder and I'm stuck when I need to detect if the team (the player position ie) can see a given location (or for example, does a monster can see the team). The maze is a simple 2d grid with 1 = wall and 0 = empty place. Team and monsters can't see through walls. My first attempt was to use bresenham algorithm but with this, team virtualy can see in through wall in diagonal.
Do you have any suggestion or better idea ?
Quote:Original post by iliakTry doing a search for '3D-DDA', '3DDDA', '2D-DDA', and '2DDDA'. This algorithm is a pretty good choice for line-of-sight queries.
Hi
I'm making a clone of Eye of the Beholder and I'm stuck when I need to detect if the team (the player position ie) can see a given location (or for example, does a monster can see the team). The maze is a simple 2d grid with 1 = wall and 0 = empty place. Team and monsters can't see through walls. My first attempt was to use bresenham algorithm but with this, team virtualy can see in through wall in diagonal.
Do you have any suggestion or better idea ?
Another option would be simple SAT-based line-segment vs. axis-aligned-box queries, perhaps with a quadtree- or grid-based broad phase to speed things up.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement