3
\$\begingroup\$

Collaborative Diffusion (CD) takes a lot of the work that A* does and combines (writes) it cheaply for multiple agents to read cheaply. This is because the majority of CD's processing works via a simple CA / diffusion approach that produces a single shared map for every agent to use on a given game update. Agents then perform hill-climbing within that space, which is also very cheap.

The primary downside is that the data structure created by CD must apply for all agents; that is, each agent's subjective view of the environment is identical; A* OTOH needs a path calculation per agent, each frame. In spite of this, the relatively low cost associated with CD would seem to make it, on average, a far more suitable approach than A*, even when we must create unique views for agents (comments / experience on this are welcome).

EDIT Consider the following example using Collaborative Diffusion:

Two armies are on a battlefield, each army emitting a uniform scent. They charge (climb the scent gradient), and as the two lines clash, each agent takes on the first, closest enemy agent on the opposing line. This happens because on each approach step for each unit, it checks whether it's yet adjacent to an enemy; if so it locks on / attacks indiscriminately. This is much freer than specific targeting, which is where A* would seem to be a better choice.

Am I correct in these assumptions? Are there other downsides to CD as opposed to [insert your flavour of] A*, for selecting ANY target between large groups?

\$\endgroup\$
  • \$\begingroup\$ You mean, aside from CD only being useful if every agent is trying to reach the same destination? \$\endgroup\$ – Trevor Powell Jun 3 '15 at 10:38
  • 1
    \$\begingroup\$ You can create a single A* view and calculate multiple paths on it for all your units instead of creating a view for each of them, just saying. \$\endgroup\$ – Alexandre Desbiens Jun 3 '15 at 13:07
  • \$\begingroup\$ Yes, I agree with that, and in your case, you don't need to calculate precise paths, so A* would be a waste of resources. I was just pointing an error about the part on A* in your question. \$\endgroup\$ – Alexandre Desbiens Jun 3 '15 at 13:11
2
\$\begingroup\$

In the words of one Icefox here,

Collaborative diffusion using agents and an anti-object is useful for when you are not trying to find a path from a specific node to another specific node.

...Confirming my suspicions as given in the question's example situation. The meaning being that when you need a member of one group to find any member of another group, ASAP (a battlefield is the perfect example) then Collaborative Diffusion is a good choice; OTOH for specific targeting, prefer A*.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Can you elaborate please, what does it mean in examples? \$\endgroup\$ – Kromster Jun 3 '15 at 13:53
  • \$\begingroup\$ @KromStern Read the EDIT already in my question. To understand "scent" you should look up how Collaborative Diffusion works, if you don't already know. \$\endgroup\$ – Engineer Jun 3 '15 at 14:53
  • \$\begingroup\$ Still it seems that the answer is much too vague - "X is useful when you are not doing Y" P.S. I did not downvote. \$\endgroup\$ – Kromster Jun 5 '15 at 17:02
  • \$\begingroup\$ @KromStern Added detail to answer, and another answer on SO that may help your understanding. I was after all answering my own question! :) \$\endgroup\$ – Engineer Jun 6 '15 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.