R0J0hound wrote:The player doesn't utilize the solid behavior, it's only used for the line of sight.It could be re-worked to utilize astar so the shortest distance is used every time, but it would have to be astar done from scratch, since it wouldn't be grid based.

If smaller objects are passed through you could roll your own LOS with events with that in mind, or probably more appropriate implement some kind of collision response to push objects out of each other. Avoiding moving objects can be done by looking at where the objects will be a little in the future and if they are colliding adjust the current angle of motion so it won't.

Hmm, I have no idea how "looking in to the future" could be done. :/ Maybe something simpler: how would you go about making characters not bump in to each other with just pathfinding? Also any suggestions how to keep formation when possible?

At any given moment a object has a position (x,y) and a velocity (vx,vy). Using a formula like rate*time=distance, you can guess what an object's position in the future will be: (x+vx*t, y+vy*t), where t is the number of seconds in the future. If the object's velocity does not change then the guess will be 100% correct.So checking in the future just means to move the objects to where they will be, check for overlaps, and then move them back.

For formations each object has it's own goal, which is pretty straightforward.

Collision response is what will allow units to not walk over each other or not walk over the walls.For units this is done by finding the distance between each pair of units and just move each away from each other if they are two close.For units against walls you find the distance to each side of the wall and use the closest side to push away from. This distance calculation is the distance from a line to a point, which is different from the distance from a point to a point.

R0J0hound wrote:At any given moment a object has a position (x,y) and a velocity (vx,vy). Using a formula like rate*time=distance, you can guess what an object's position in the future will be: (x+vx*t, y+vy*t), where t is the number of seconds in the future. If the object's velocity does not change then the guess will be 100% correct.So checking in the future just means to move the objects to where they will be, check for overlaps, and then move them back.

For formations each object has it's own goal, which is pretty straightforward.

Collision response is what will allow units to not walk over each other or not walk over the walls.For units this is done by finding the distance between each pair of units and just move each away from each other if they are two close.For units against walls you find the distance to each side of the wall and use the closest side to push away from. This distance calculation is the distance from a line to a point, which is different from the distance from a point to a point.

Thank you so much for all your help. I ultimately decided I will go with pathfinding. Since setting rotation to very high number got rid of that annoying delay, I wander if your technique of units not stepping in to each other would work with pathfinding too?