RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.03k stars 178 forks source link

dynamic setbeams #1351

Open fidoj opened 7 years ago

fidoj commented 7 years ago

this is a discussion for a request, based on dynamic setbeams that uses a in file enabler, that are set on loading. my argument is spring and damp values of materials changes based on the physical dimensions of the part, its not a fixed variable. for instance a 5cm (2cmx2cmx5cm) long aluminum bar will not bend and it will resist all motion with very high damp rates. where as a 30cm bar (2cmx2cmx30cm) with have much lower residences in both spring and damp.

ohlidalp commented 7 years ago

If I understand correctly, you're suggesting that:

That makes sense in theory, but with RoR, it's a big experiment. I'm worried RoR would will quirky this way and beams/trucks would require extra manual adjustments.

fidoj commented 7 years ago

in an ideal simulation we would be working with both hard body and soft body physics. ror is soft body only, and it does it well, an advancement in light of recent competitions, and problems with stability as we progress, developing ror beyond the mathematical test bed, it was designed as, into a universal open source vehicle simulator, means we need to have some dynamic aspects, right now it takes days tuning set beams, i think as lifter said to me a Boolean curve applied to the set beams that changes spring and damp on a ratio based on length, were as all mod creators now have to painstakingly separate sections, and beams to set setbeams, with some advanced fore thought that could be handled. processed as a pre-sim level definition on each beam, we could possibly make beam instability on any vehicle a thing of the past. this would enable old mods to work on new versions, without needing to be updated. if we work with what is good already and add a mode for setbeams that scales based on length of beam.

ohlidalp commented 7 years ago

Allright, a Bezier-curve-based calculation sounds good.

Since both you+Lifter are modders and I'm not, I want you to tell me exactly what you want the truckfile to look like. This is my current idea:

; Creates a named preset which can be assigned to beams
; Define a bezier curve which maps { beam length -> spring/damp/ others (strength?) }
; Usage: add_beam_dynamic_preset NAME
create_beam_dynamic_preset Aluminium
        ; length    spring   damp
           0.1      10       1
           0.2      20       2
           0.3      30       3

; ----------------------------------------------

beams
     ; ... beams beams beams ...

     set_beam_dynamic_preset Aluminium
     ; ... beams beams beams ...