ID:159686
 
What is the best way to handle it? I would like for groups of up to 20 units to be easily movable.

Currently I'm using a click-to-walk system, but here's the problem.

If I use walk_to(), then I either have to:

1. Set minimum distance before stopping to something high, which I would not like to do.

2. Allow the units to "dance" around each other until commanded to move again.

If I use walk_towards(), then units get stuck when trying to walk through dense objects.

Right now, I'm using walk_to(), but I have it so that if one unit reaches the destination first, all of the other units stop. It's not such a good idea either, because if one unit is close, all of the other units will stop almost automatically.

So what's the best way to handle this? I'm completely lost on what to do.
You can have a Move() override in the untis' parent type(s) which check for a dense mob type in its get_step() and stop (and then attack if you want), otherwise step() to the side. It's a funky way of doing pathfinding, but it should work. Note how I said step(), and not walk(). step() doesn't cancel out any already running walk().
When a turf is Entered()/Exited() set its density to 1/0; this will force mobs to path find around it.
mob/Bump(O)
for(var/turf/T in range(1,O))
if(!T.density&&get_dir(usr,O)==get_dir(usr,T)&&!locate(/NPC) in T)
walk_to(usr,T,1,03)
..()

Thanks for the ideas.

How would this work? So far I haven't had any problems with it.
In response to Mizukouken Ketsu
Mizukouken Ketsu wrote:
You can have a Move() override in the untis' parent type(s) which check for a dense mob type in its get_step() and stop (and then attack if you want), otherwise step() to the side. It's a funky way of doing pathfinding, but it should work. Note how I said step(), and not walk(). step() doesn't cancel out any already running walk().

Took your advice and just got it working. Thanks!