Jump to content

  • Log In with Google      Sign In   
  • Create Account

SuperV1234

Member Since 26 Jun 2011
Offline Last Active Today, 06:52 AM
-----

Posts I've Made

In Topic: Grid pathfinding with a lot of entities

12 June 2012 - 01:55 PM


The top-left pathmap is a breadth-first search for one of the enemies (in red).
The bottom-left one is a breadth-first search for the other enemy.
The pathmap on the top-right is the sum of the two searches.

Is this what you meant?

That's not right. It's possible to do with just a single search; you just have to seed the open-list with all the enemies, what you've done there is to do many searches with an open-list seeded with just 1 entity each time. It's a variant of breadth-first search called Dijkstra's Algorithm.


I'm very sorry, but I'm still not getting it :/

Let's say I have 100 enemies and 100 friendlies.
You're telling me that I can find the best possible path from every enemy to every friendly (and viceversa) with only two breadth-first searches?

Where do I have to start the searches at?

In Topic: Grid pathfinding with a lot of entities

12 June 2012 - 01:38 PM

Posted Image

This is a quick mockup I did.

The top-left pathmap is a breadth-first search for one of the enemies (in red).
The bottom-left one is a breadth-first search for the other enemy.
The pathmap on the top-right is the sum of the two searches.

Is this what you meant?

I see some problems with this, though... the paths created are not correct, there are many equal numbers and that could lead to strange behavior.
Also, considering I can have 200+ entities in a single room, this means I would have to run 200 breadth-first searches and sum all of them togheter.

Sounds slow..

In Topic: Grid pathfinding with a lot of entities

12 June 2012 - 01:09 PM

So I should have a pathmap for friendly units and a pathmap for enemy units? And to check distances, I should run a breadth-first search from every tile, every turn? Wouldn't that be slow?

PARTNERS