I am working on a chariot simulation. I have a blueprint, with a main body (chariot) and two other objects (ThrusterL & R) that are constrained to the main body. When Left Trigger is pressed it applies force to ThrusterL and the same on the right. The thruster objects pull the chariot well. You can turn by reducing or increasing thrust for each thruster independently.
It’s a little hard to get the chariot to get back to center. It wants to keep turning and it is very hard to balance the chariot to go straight again. It’s more frustrating than fun. So, I am trying to make some kind of dampening effect. I have messed with all the angular and linear dampeners in the physics objects to some positive result, but not enough. Most recently have been working on a MaxVelocity function to try and convert any sideways velocity to forward velocity. This attempt hasn’t yielded much result so far. I thought I should seek advice on how to tackle this problem.
I can share the project file, but I’m not sure if I can do that here. Thank you for you help!
Hi there, so this is something like pod race type of chariot seems. Not fully aware of your setup and what aspects you used but seems its simulated objects to start with.
So when you apply force to left or right, it applies linear force and cause of the setup possible applies angular force to overall setup, which enables you to turn as you want. However if there is no angular dampening on your physics objects this will continue spinning for a while (depending on the friction factors between object and ground surface).
I beleive increasing friction on physics materials also increasing angular dampening on your simulated physics should solve the issue.
Velocity clipping not going to solve issue fully since I assume this is simulated but its possible to reset angular forces more rapidly on the simulated objects. Dampening alone will not feel good so I suggest getting angular velocity and applying an additional force on the objects as counter direction. Could be even better if something decays over time.
CorrectiveTorqueZ = -AngularVelocityZ * StabilizationStrength
thats how i would do it atleast. Let us know if I got the question right.
1 Like
This was spot on! Yes, it’s legally not pod racing, lol. There is definitely a sweet spot for the default dampening options. I find making the Thrusters heavier than the Chariot helps a lot. I have the Chariot LD about 0.1; AD does nothing really. The Thrusters are 30x heavier than the Chariot; AD 0.8. The Linear Dampening for the Thrusters varies.
When you press the trigger on the gamepad it preforms ((TriggerValue) * -10)+10 to get the value of the Linear Dampening for the associated Thruster. This acts as a variable brake when releasing the trigger. This works great except when fully and instantly releasing the trigger. Then the Thruster slams back and pops the Chariot up. I am thinking I should work on a ramp down function.
The Corrective Torque you suggested shows a lot of promise. Ill have to work with it more tomorrow. Thank you for you’re help!
The counter torque should work nice for turning and interms of inputs I think its natural behaviour when input suddenly cut makes sense since the dampening and other forces are high on vehicle to trigger instability. That is expected in real life scenario too.
My suggestions on this are couple of knobs to play with.
- I am not sure you have input accumulator. In inputs you can assign accumulator or you can create one on tick as InputGravity interpolating from -x +x. This would give a nice gameplay effect too, make a bit harder for player to control. Imagine this is like a galleon ship, not easy to turn however the gravity should be something not frustrating in order not to butcher responsiveness of gameplay.
- I think while having an InputGravity, its absolute value can be a scalar to dynamically change the dampening, angular dampening even maybe the counter torque. That way the forces on the overall vehicle will be smoother decreasing any instability.
- Depending on the setup as you said there is 30x difference on masses, inertia tensor scales can be helpfull, especially I think on Z, having less inertia or completely closing inertia on the thrusters can effect positively the input and stability problem.
- For the overall center of mass, its good to override CoM to be somewhat low center of the vehicle since there is 30x difference , changing it can effect setup positively if the 1.2.3 doesn’t respond.
It’s a good question and something interesting, so It’s my pleasure to dig into it.
Let me know if it works on your side.
1 Like
Additionally not sure your setup is but with the new modular vehicle with some additions I made its pretty nice results (without them also acceptable) however here is a pod racer chariot made with similar two trusters, some springs and a custom joint for the cockpit.