This project has moved. For the latest updates, please go here.

Line of sight

May 24, 2013 at 1:00 AM
Is there a line of sight function in the utility?

Or alternatively, a simple line function that provides a list of hexes in a straight line between a source hex and a destination hex?

Thanks,

Paul
Coordinator
May 24, 2013 at 1:43 AM
No, not as such. However it would be just a simplification of the shadow-casting process used in generating field-of-views, so could be created pretty quickly.
Coordinator
May 24, 2013 at 1:49 AM
How would you see dealing with a line that goes right down a hexgrid-seam? Include both hexes, a "indeterminate* one, a specific one, or both?
May 24, 2013 at 2:37 AM
I think it's a "handle consistently" issue.

In my determination, the center point is the determining factor of a hex being either in view or in shadow.

In shadow casting, if the ray crosses the center point the hex is either in shadow or in view. I believe that it should be in shadow, but I could easily be convinced that it's in view.

I'd rather consider it a boolean - it's either visible or not - but never both.

Paul


Coordinator
May 24, 2013 at 3:47 AM
Should both hexes be included then? Would some sort of weight be assigned to hexes at each given distance out, as to how fire-effect should be distributed between them?
May 24, 2013 at 12:07 PM
I went through the various scenarios that I could think of where I would use a line of sight algorithm. It turns out that more often than not, I would prefer that both hexes be included.

I wouldn't worry about including any other details on the list (like weighting). Those types of values can be applied as required. In most cases, I'm looking for a line of sight and not a fire-effect situation.

Thanks,

Paul


Coordinator
May 26, 2013 at 7:01 PM
@Paul: I am not ignoring this request; I have been working on adding Jump-Paths (for lack of a better term) to the A-* algorithm, using a road-map of (pre-defined) major intersections.. This lead me to realize that it mattes that path finding currently calculates and returns the paths backwards (goal-to-start). Once I unwind that issue, his one is next for me to look at.
May 26, 2013 at 7:04 PM
No worries, but thanks for the update.

I'm neck deep in combat AI. Right now I'm ignoring line of sight issues and marking everybody as "always visible".

Thanks,

Paul