Reciprocal Velocity Obstacles

I want to create a script that can replicate reciprocal velocity obstacles, though I cannot figure out how this would be done on Roblox. I attempted to look on different forums and ask different people just to end up with 0 progress.

Here is an example of what I mean:

1 Like

Hi! I haven’t really thought the specifics, but I will share you my vision in terms of structuring to get somewhat of a desirable result:

  1. To get the camera angle and view, I would use viewport frames.
  2. Make the cylinder parts (or your agents)
  3. The main part: Each agent will need a velocity vector AND some methodology for preventing collisions. This can be done by making another part that is transparent but is its “vision”. Next you need to script it so that if the agent sees another agent, it moves away from it (you can do a reverse movement, I think this is the simplest).

With that I believe this should cover most cases, the only issue I can imagine are the agents boxing in one agent, which you can solve in a couple ways:

  1. You have it so that a couple agents do a rotation movement, this should decrease the probability of an agent being boxed in

  2. Or you can decrease their velocity, it should reduce the probability inherently

Now lets add some detail into the script:

  1. We can make adjustments to their velocity on sight, as well as change their angle as well.

  2. You can make the final frame of your video by simple making small invisible spheres be the “endpoints” and have it so that if a cylinder touches a sphere, then it goes to it. Or perhaps much simpler is to use pathfinding service, the choice is up to you.

I do apologize it for being so vague! Let me know if you want a more specific outline.

2 Likes

why do you think this is scripted verses and animation?

3 Likes

Of course animation would be the simplest method (a very good point, did not think about it!), however what if the author wanted different outcomes, perhaps an element of randomness? But now giving some thought, animating would be the easiest way to achieve said outcome.

1 Like

This was taken from an older simulation that produced this video, there is a part 2 that involves hundreds of agents at once.

This could work but I don’t know how to implement this.

After watching the video, just do a top down camera, have npcs as the cylinder’s, then each npc has a way point, then they get told to move to the way point, but are ‘let go’ sequential (to have a slight delay for npcs 1 - 9 ) then when they reach their way point the stop…

would be pretty easy…

1 Like