Is the situation you are suggesting something players could create in the game? I did hop in to try and figure out how to create one of these rope storms. While I was unable to create something as intense as your clip, I did find something that I think is exacerbating the issue: allowing the players to change ropes’ Restitution
.
The whole point of setting the Restitution
of a RopeConstraint
to 0
is to tell the constraint that the rope’s defined length is the absolute limit, and any circumstance that results in that not being the case should be corrected by a force that will achieve that goal immediately, which works fairly well in lower-force environments. When the Restitution
is set to anything else, you’re adding elasticity to the equation and effectively telling the constraint that the length is the goal but not the upper limit. How any of this is implemented is beyond me in terms of both the engine construction and the physics principles at play, but I digress. All-in-all, it means that the constraints are not actively enforcing length at nonzero Restitution
values.
Clamping the length via code achieves the results of Restitution = 0
, particularly at higher forces, but it won’t do anything to mitigate the forces of different Restitution
values. I found with my builds that Restitution = 1
vehicles produced much less stable assemblies (ropes curling and bouncing around) versus Restitution = 0
assemblies, which were stable for the most part albeit overwhelmed by the centripetal force of the swinging ropes.
Disabling this feature will give you as the developer more control over the environment, but this does move the issue from less of a technical one into more of a design one: is the freedom to change a RopeConstraint
’s Restitution
worth the impact it has?
Even if you don’t choose to change this feature, you could still add coded clamps in, but they’ll need to be a little more forgiving, otherwise you’ve effectively disabled the feature anyway.
Also, looking at the construction in game, you’d likely need to implement the system in a way where every Stepped
event, you limit each rope assembly’s angular and linear velocities, and every Heartbeat
you clamp the positions, and both of these processes start with assemblies closest to the main assembly and move their way outwards. I think you may be able to get results by applying reactionary impulses at rope attachment points, and you would likely need to transform all your calculations to be relative to the main assembly’s velocities, but we’re probably well over my head at this point, to be honest.