Results 1 to 10 of 15

Thread: SMS Pathfinding code

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by phibermon View Post
    I hope that makes sense - the idea is to check as few cells as possible.
    I believe this approach is being used in game Prison Architect and until now I haven't really understood how it works. But thanks to your description I do now.

  2. #2
    Game specific optimization but interesting nerveless

  3. #3
    @phibermon that is a pretty good description - I could see how that system would be useful to improve AI in certain games/situations
    The views expressed on this programme are bloody good ones. - Fred Dagg

  4. #4
    Creatures IRL use actual pathfinding as the last resort to conserve brain power.
    Normally they rely on life-hacks like memorizing a route once found (even if it's not optimal), the right/left hand rule for going around obstacles and other such.

    For example: I had a dog once, many years ago. I was walking it, and it ran behind a wire mesh fence with a hole in it. Then followed me until she ran into a corner. Whoops.
    So what did she do seeing me going ahead? She whined, she ran back and forth along the fence several times (using right/left hand algorithm of obstacle avoidance). Then she looked at me one more time and I practically felt that click in her brain as she dashed hurriedly back to the hole.
    The question is: did she use A* or was it a modified breadcrumbs algorithm as she clearly knew the path I followed and her point of departure from that path?

  5. #5
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Quote Originally Posted by Chebmaster View Post
    Creatures IRL use actual pathfinding as the last resort to conserve brain power.
    Normally they rely on life-hacks like memorizing a route once found (even if it's not optimal), the right/left hand rule for going around obstacles and other such.

    For example: I had a dog once, many years ago. I was walking it, and it ran behind a wire mesh fence with a hole in it. Then followed me until she ran into a corner. Whoops.
    So what did she do seeing me going ahead? She whined, she ran back and forth along the fence several times (using right/left hand algorithm of obstacle avoidance). Then she looked at me one more time and I practically felt that click in her brain as she dashed hurriedly back to the hole.
    The question is: did she use A* or was it a modified breadcrumbs algorithm as she clearly knew the path I followed and her point of departure from that path?
    Ha that's a wonderful observation - I think the subject is better discussed on an evolutionary biology forum or some such place - even more incredible to my mind is the ability of birds to travel half way round the world to the same lake - or even more incredible is frogs returning to the pond from which they spawned in order to mate - I'd say breadcrumbs but a few years ago the garden at my old house was completely remodelled - new fences put up and a gate installed at the back of the garden.

    Next year I was outside and I noticed frogs hopping in from under the gate to get to the pond - a path that was previously completely blocked off by the topography of the garden - did they breadcrumb to the general vicinity and then left-right until they found a gap? did those frogs just happen to come from that direction and get lucky?
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  6. #6
    Quote Originally Posted by phibermon View Post
    Next year I was outside and I noticed frogs hopping in from under the gate to get to the pond - a path that was previously completely blocked off by the topography of the garden - did they breadcrumb to the general vicinity and then left-right until they found a gap? did those frogs just happen to come from that direction and get lucky?
    As far as frogs go. They have extremely powerful smelling capability. In fact it is so powerful that they can detect increased moisture in the air. So when wind blows over your pond the air is moisturized and then carried away. Frogs can then follow this trail of moisturized air back to your pond. And they can do this from a range of even up to 10 km or 6 miles.
    And frogs are not the only animals capable of this. My mom was born in a village which was founded about 300 years ago when during the drought season pigs (which also have very acute smell) wandered over 15 km (roughly 10 miles) to a fresh water spring which was the only natural spring that season that hasn't dried. In fact from the time of when this spring was discovered for the first tim and till today nobody has ever seen it dry up yet.

    Any way if you look at all the different way animals use for path-finding. Well let us just say that in your lifetime you probably won't be able to write algorithms that mimic most of them.
    Here are just some of the most amazing ways animals use for orientation and path-finding:
    1. Birds are known for being able to detect earth magnetic field and thus location of earths magnetic poles. This allows them to navigate great distances without much problems. But scientists are warning us that with all the electromagnetic interference we are causing we might be eventually causing them havoc in their navigation. And birds are not the only animals that have this ability. Many others have but are not so dependent on it like the birds are.
    2. Bees remember the path they took from their hive to the flower by simply remembering how long they flew in straight lien and when they turned and into which way. They also have a clever way of communicating this information to other bees through so called "bee dance".
    3. Ants always leave chemical trail behind them so they can always return back to the nest. Even ore by manipulating the chemical they use on this trail they are leaving specific message of what kind od destination does this path leaves to (food, danger, etc).

    Sorry for going a bit off-topic but for me this is interesting stuff especially when I see computers trying to mimic/simulate it.

  7. #7
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Quote Originally Posted by SilverWarior View Post
    As far as frogs go. They have extremely powerful smelling capability. In fact it is so powerful that they can detect increased moisture in the air. So when wind blows over your pond the air is moisturized and then carried away. Frogs can then follow this trail of moisturized air back to your pond. And they can do this from a range of even up to 10 km or 6 miles.
    And frogs are not the only animals capable of this. My mom was born in a village which was founded about 300 years ago when during the drought season pigs (which also have very acute smell) wandered over 15 km (roughly 10 miles) to a fresh water spring which was the only natural spring that season that hasn't dried. In fact from the time of when this spring was discovered for the first tim and till today nobody has ever seen it dry up yet.

    Any way if you look at all the different way animals use for path-finding. Well let us just say that in your lifetime you probably won't be able to write algorithms that mimic most of them.
    Here are just some of the most amazing ways animals use for orientation and path-finding:
    1. Birds are known for being able to detect earth magnetic field and thus location of earths magnetic poles. This allows them to navigate great distances without much problems. But scientists are warning us that with all the electromagnetic interference we are causing we might be eventually causing them havoc in their navigation. And birds are not the only animals that have this ability. Many others have but are not so dependent on it like the birds are.
    2. Bees remember the path they took from their hive to the flower by simply remembering how long they flew in straight lien and when they turned and into which way. They also have a clever way of communicating this information to other bees through so called "bee dance".
    3. Ants always leave chemical trail behind them so they can always return back to the nest. Even ore by manipulating the chemical they use on this trail they are leaving specific message of what kind od destination does this path leaves to (food, danger, etc).

    Sorry for going a bit off-topic but for me this is interesting stuff especially when I see computers trying to mimic/simulate it.
    Ahh! thanks for the info - I didn't know much of that. Oh well it's not off topic really - many great advancements in robotics and AI have come from mimicry of the animal kingdom. The 'flow field' biasing I described seems to my mind to be an analogue of ants leaving scents - perhaps there's something useful in the bee technique?

    For example instead of storing entire paths between points - you could just store the distance travelled by an entity between those two points - then when pathing to that point - compare the linear distance to the distance travelled and if it's greater than you know that there's obstacles between the start and end points. I don't know how that can be useful exactly - but perhaps store the distance travelled and a series of left/right indicators - then when the entity encounters an obstacle it pops a left/right off the stack and knows which way to turn.

    To my mind it would result in an effective path followed between two points across a static terrain but with far less memory used to store that path.

    it would also plug nicely into a steering algorithm. Just a thought experiment but an interesting one!
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •