I have an object which uses mp_potential_step() to maintain a path to a goal while avoiding solid objects.
I want to have many instances of this object in a room at one time, but I also want these instances to avoid each other too.
Otherwise, they all bunch together and it looks rubbish,
So how would you do this?
Set up a collision event with itself?
Maybe you can just check the distances and directions of the other instances or say just the instances within a certain range and move in a direction other than toward them until you find a spot from which you can map a path. You could check the vector in the direction of travel and current speed to determine if they're likely to collide and change direction to avoid it and recalculate again. Then once you have a non colliding vector you can calculate your path to your goal again. Of course once you are forced to move off your present path again to avoid a collision you'll have to start all over.
There are some functions to tell you this kind of info. Look up vector, direction and distance in the help it will take you to the right functions. I don't know them off the top of my head.
You could create a temporary invisible object to check to see if it collides with anything in a particular part of the grid and set the path/direction when it doesn't. Of course since the other instances are also doing that it can change any time so you have to keep checking.
distance_to_object(), distance_to_point(), point_direction(), lenghtdir_x/y(), dot_product(),point_distance() can be useful to help make the decision of what to do. I think the easiest thing is to just have each object run independently but your code will have to be smart enough not to get the objects stuck, especially if there are many of them.