25-01-2021, 08:58 AM
(This post was last modified: 25-01-2021, 09:02 AM by josemendez.)
Hi there!
There's a basic reason why this won't work, and it applies to all physics engines. Physics engines, as any other software, have to somehow discretize quantities for the computer to be able to work with them. In a physics engine, this discretization is both spatial and temporal. Obi discretizes ropes into particles, and Unity discretizes time into time steps.
Yours is probably a worst case scenario for any physics engine: a very thin object (the arrow) accurately colliding against a very thin, very tense string, that then gets projected forward at extremely high speeds. You will need incredibly fine spatial and temporal resolution for this to work. At that point, you will have a hard time justifying the amount of computational resources spent on this, specially for a game. Needless to say, this isn't how bows are simulated in games. Oftentimes tensing the bow is just an animation, when you release the arrow, a projectile is spawned at a given speed. No actual simulation of any kind involved for the bow itself.
This would most likely exacerbate the problem. By using more particles you're improving spatial resolution, but worsening temporal resolution. Smaller objects need finer temporal resolution for accurate collision detection to take place. This is why tunneling typically happens more often with small/thin objects. (If you're unsure what tunneling is, we have a video on the subject:https://www.youtube.com/watch?v=ms0Z35GY6pk&list=PLnCR8_XCOgrZL8gNxeuGJSrMUXHdJMXKn)
If you still want to try this, your best weapon are substeps (found in the ObiFixedUpdater component). Start at 10 substeps, which will typically yield a timestep of 0.02/10 = 0.002 seconds (where 0.02 is Unity's default timestep size). That should give you enough temporal resolution to start. The effect substeps/iterations have on the simulation is explained here: http://obi.virtualmethodstudio.com/tutor...gence.html
Then, increase rope resolution at maximum (1) and reduce thickness to a reasonably small value. Both settings are found in the rope blueprint. If you feel like the rope becomes too stretchy when the amount of particles in it increases, it means you need to use even more substeps.
Let me know if I can be of further help. cheers!
There's a basic reason why this won't work, and it applies to all physics engines. Physics engines, as any other software, have to somehow discretize quantities for the computer to be able to work with them. In a physics engine, this discretization is both spatial and temporal. Obi discretizes ropes into particles, and Unity discretizes time into time steps.
Yours is probably a worst case scenario for any physics engine: a very thin object (the arrow) accurately colliding against a very thin, very tense string, that then gets projected forward at extremely high speeds. You will need incredibly fine spatial and temporal resolution for this to work. At that point, you will have a hard time justifying the amount of computational resources spent on this, specially for a game. Needless to say, this isn't how bows are simulated in games. Oftentimes tensing the bow is just an animation, when you release the arrow, a projectile is spawned at a given speed. No actual simulation of any kind involved for the bow itself.
Quote:I have reduced the thickness to get smaller particles, however, this did not help much.
This would most likely exacerbate the problem. By using more particles you're improving spatial resolution, but worsening temporal resolution. Smaller objects need finer temporal resolution for accurate collision detection to take place. This is why tunneling typically happens more often with small/thin objects. (If you're unsure what tunneling is, we have a video on the subject:https://www.youtube.com/watch?v=ms0Z35GY6pk&list=PLnCR8_XCOgrZL8gNxeuGJSrMUXHdJMXKn)
If you still want to try this, your best weapon are substeps (found in the ObiFixedUpdater component). Start at 10 substeps, which will typically yield a timestep of 0.02/10 = 0.002 seconds (where 0.02 is Unity's default timestep size). That should give you enough temporal resolution to start. The effect substeps/iterations have on the simulation is explained here: http://obi.virtualmethodstudio.com/tutor...gence.html
Then, increase rope resolution at maximum (1) and reduce thickness to a reasonably small value. Both settings are found in the rope blueprint. If you feel like the rope becomes too stretchy when the amount of particles in it increases, it means you need to use even more substeps.
Let me know if I can be of further help. cheers!