Page 1 of 1

Radius and blocked line of sight on a grid.

Posted: Wed Sep 30, 2015 6:37 pm
by Sharkinmytea
Hi, I'm in the making of a rogue like game and I bumped into two problems.
The first one is my attack system.
It's turn by turn based and I'm having difficulties to create a solution to solve my line of sight problem.
Image

Basically, there is the player and there is the wall. I want the squares behind the wall to be unable to receive damage since the ''fire breath'' started from the player.
Does anyone have a good way of doing that?

Re: Radius and blocked line of sight on a grid.

Posted: Wed Sep 30, 2015 7:27 pm
by DeltaF1
There are some really good articles on this, that I can't seem to find again >.<

Basically you raycast from the player to find the squares affected by the breath, but there's some other stuff you can do to get rid of irregularities, like flood filling tiny patches where the player might have seen through a wall or something.

Here are some of the articles I found with a cursory Google search, but I'll post here if I find the ones I was thinking of.
http://www.adammil.net/blog/v125_Roguel ... ithms.html
http://www.roguebasin.com/index.php?tit ... dowcasting

Re: Radius and blocked line of sight on a grid.

Posted: Wed Sep 30, 2015 9:12 pm
by Sharkinmytea
Thanks, with the information you gave me, i searched a little bit more and found exactly what I needed there:viewtopic.php?f=5&p=159707