Skip to main content
Share Your Experience: Take the 2024 Developer Survey
3 votes

Fix my Flow Field pathfinding

I had a similar problem this week, so I thought I'd post what I did. Dijkstra's algorithm is inherently discrete, so it will always give you directions that tend to funnel everyone into the same few ...
Rory Driscoll's user avatar
2 votes

Movement system for thousands of entities

Myself, I'd solve this with a combination of flow field pathfinding and local avoidance. First, the flow field: for each army, initialize a graph of map locations spanning the army and their goals (...
DMGregory's user avatar
  • 135k
2 votes

How to prevent cube intersecting with other objects when moved around with mouse?

I can think of three different approaches to your problem. One involves using an object silhouette or shape as a preview of where it's going to be placed; another is a real-time positioning of the ...
liggiorgio's user avatar
  • 4,831
1 vote

Ensure a path always exists between moving objects

Note: I am not looking for any type of cooked solution, just some references to existing algorithms, implementations,... to look into by myself. A noteworthy algorithm here is Velocity_obstacle. Its ...
Mangata's user avatar
  • 2,571
1 vote

Collision avoidance not only AI wrong

I found out logical mistake, I should do the sum of angles as totalAngle and then divide it by the count of angles so I get ...
durisvk10's user avatar
  • 243
1 vote

How to make one box Collider 2D go through another in Unity?

You should use Pyhsics2D.IgnoreCollision() since Box Collider 2D inherits from Collider2D, not Collider. Found more info here, check this one out.
Tolga Şen's user avatar
1 vote

Unit collision avoidance for RTS

You are on the right track. I have re-implemented collision avoidance for my RTS taking Recast as example. General approach is quite simple: Each agent (that's how they call units in collision-...
Kromster's user avatar
  • 10.7k
1 vote

given the position and velocity of an object how can I detect possible Collision?

The dot product has two nice properties for collision avoidance. The dot product is closely related to the cosine of the angle between two vectors. The dot product of a unit vector A and a second ...
Felsir's user avatar
  • 4,067
1 vote

3D collision avoidance: finding the updated velocity vector (outside the "collision-velocities" cones)

I don't think there's an efficient way of solving the problem exactly, but here's how I'd try to tackle it. First, I'd use bounding volumes around each object, instead of the objects themselves. Each ...
Gato's user avatar
  • 301
1 vote

Wall sliding in JavaScript; works, but gets stuck at corners

You're not handling line endpoints correctly. Consider only a single line segment. The collision of a circle at the endpoint of a single line segment should be rounded, right? Like, if you trace out ...
John Haggerty's user avatar
1 vote

Intersecting ORCA lines finding non-optimal solution for fast units

Okay, I've found the problem, and it was written in the original paper, which I missed among all other papers apperantly… I mean, there were tons of papers about it, that, for some reason I never ...
Acey's user avatar
  • 11
1 vote

How to prevent collisions between instantiated prefabs

I ended up using the suggestion of @allnodcoms to use layers. I queue up a full generation to be simulated on 16 separate layers using a SimulationManager. Although ...
Koby 27's user avatar
  • 141
1 vote

Collision detection and solution causes teleportation on corners

I found solution. First of all I made collision detection function for readability, then I made collision for each axis apart. ...
over_stack's user avatar
1 vote

Dodge different type of obstacles

I made it :D Using A* with time dimension. Creating the obstacle paths just one time, on cast. Then i simply do A* and on neighbor check i check for the time the spot would have as well, if a spot is ...
LuaNoob's user avatar
  • 161
1 vote

Enemies overlapping

This is a very common problem in AI pathfinding, and you generally have three possible solutions: Accept the overlap. But this is far from ideal. Queue your enemies. Detect a collision, and stop the ...
Ian Young's user avatar
  • 2,649
1 vote

Vector field collision avoidance

So yeah... I solved my problem... I was normalizing the vector from the enemies before adding it with the original direction, and this creates a step too big between "no collision" and "collision".
STK Oscar's user avatar
  • 145
1 vote

How would I go about implementing a collision avoidance check, avoiding moving objects from multiple directions?

The first thing to do with any large collision sets is elimination. Range check in itself is a good start but another check is simply a direction check. Is the direction the asteroid in this case ...
ErnieDingo's user avatar
  • 1,150

Only top scored, non community-wiki answers of a minimum length are eligible