How to mark water plane as unwalkable

HomeForumsA* Pathfinding ProjectSupportHow to mark water plane as unwalkable

This topic has 2 voices, contains 2 replies, and was last updated by  Aron Granberg 102 days ago.

Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
Author Posts
February 5, 2012 at 19:58 #1423

Kent

What’s the best way to mark all nodes under the water plane as unwalkable? I’ve been thinking of:

1. Tried to get bounds to only include nodes with a certain y position, for use with UpdateGraphs, but it always includes the ground level nodes.
2. Change GridGenerator.cs to allow me to either modify nodes on creation or post-process the grid.
3. Loop over them after scan and modify setWalkability on every node where y < waterPlane.y and do a UpdateGraphs

I'm using a single GridGraph to cover an island surrounded by water.

February 5, 2012 at 22:09 #1424

Kent

Update, this is what we did:

In Start(), a subclassed GraphUpdateObject runs Apply on every node to mark it as unwalkable if below the water level. It doesn’t show visibly until StartPath() is called though.

February 6, 2012 at 09:18 #1427

Aron Granberg

Hi Kent

That’s a good method. It doesn’t show until StartPath is called because it will wait in a queue, or well, it does sometimes calculate directly, the logic behind it is a bit complicated. I will always be done before the next path is calculated anyway.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: How to mark water plane as unwalkable
Your information:






<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>