Space Engineers

Space Engineers

DAS - Driver Assisting System
This topic has been locked
Need help with suspension for a slow, heavy truck.
I'm putting this here because it's too long for the comments section:


Thanks for this script. Ackerman steering is something I've been dreaming of. However, I'm a little confused by the settings for everything. Is there any way of changing this script to do less, or maybe help me to understand the settings better so I can get it to do what I want?

I want to keep the Ackerman steering and the automatic damping (and the ability to change max speed and suspension height through commands). I need those features, and the way I can set them up in the script config is fine.

For the current vehicle I'm working on (heavy truck) I'm not so keen on the other features. I don't think I need any of the gyro/thruster/camera features. My biggest problem is the way the script seems to always want the power so high. Also, I really don't understand what the script is doing to friction (to be honest, I don't understand scripts at all, which is why I need help).

I usually have the wheel power set from around 3 to 6 (in the terminal), only adding more if it won't go uphill. That seems about right for a truck (It's not a sports car: it shouldn't charge away and wheelspin. It should take a while to get to top speed - which is around 80kmh). For friction: if your script is changing each wheel individually to stop sudden bites and rollovers, I guess that's useful. But it seems as if it's dropping the friction right down at higher speeds, which is not so useful for me (it starts to feel like a drift car, not a truck).

I keep the suspension strength around 6-8 (in terminal). This means it's always hanging on the suspension a little because of the weight, which feels more realistic to me. I can set this manually (statically) in your script, but I don't know how to have automatic adjustment and still keep this level. The script seems to like the strength around 50. "6" gave me a suspension strength of 5. "-6" gave me strength of around 50.



Is the gyro/thruster/camera stuff taking up cycles if I'm not using it? Is there a way to disable it? Do I need to?

Is there a way to get automatic control of suspension strength, while still keeping it around 6, as opposed to around 50?

What is the script doing with friction? How do I configure it? Can I turn it off? What will that affect?



I appreciate any help you can give, but I understand if you're too busy or just don't want to get into tailoring scripts for individual needs. Thanks again for the script. It's great. I'm just not sure how to get the most out of it.

Any thoughts?



**edit**

After trying the Tesla and the scuttler, I think I understand the gyroscope thing a bit more. I've tried cars with gyroscopes before, but they all handled terribly. Yours seem to handle better and actually feel like a car, not a plane with wheels. I'm still interested in any advice about the suspension settings, and if there is a way/need to disable features I'm not using
Last edited by Cardboard Overlord; 15 Oct, 2017 @ 2:23pm
< >
Showing 1-2 of 2 comments
Wanderer_308  [developer] 17 Oct, 2017 @ 1:43am 
No problem. I can find some spare time to answer, and i don't have many subscribers to ignore you. To the business.

When you set negative strength value in script it activates automatic strength calculation, if you set equal or above zero script just set it as-is. When you set it to ‘6’ you see ‘5’ probably because of rounding error, click on strength slider in terminal while holding Ctrl to see exact value. Now, if you want automatic mode and yet you not satisfied with high strength value (which i chose so the wheel will be pushed down to 90% of suspension travel length) you can fiddle with lines
if(suspension.Obj.BlockDefinition.SubtypeName.Contains("5x5")) strenght /= 18.5; else strenght /= 15.0;
these divisors (18.5 and 15.0) is proportion gains, you can change it. Higher gain here will lead to less strength in result. Can't tell you exact numbers, it’s a matter of guess and try.

Gyroscopes as you noticed serves as turn helpers, and align your rover in midair, if you jump on some hills etc. Also gyros may flip you back if find yourself up side down somehow. However for precise work it really needs camera, because when your vehicle on hill then obviously it's at some angle to horizon, and without camera script will not know are you standing on hill or just falling from cliff or something else bad happening and will try to align you. So script will tip your sides or even may flip your over. In your case of truck i think it's tall and too heavy to put it back on wheels if it flipped, and probably you will not go so fast that truck will jump on hills. So try it without gyros, then try it with gyros, find what behaves better. Just note that if you will use gyros then having a camera is recommended.

Thrusters. There two subsystems that work these thrusters. First is ‘Fall Dampening System’, and operate with upward thrusters. It will engage these thrusters when you falling too fast, though it’s not cap falling velocity itself, it just slow you down at very close to surface. Other subsystem that control right, left, forward, and backward thrusters is ‘Smart Dampeners Override’. It will fire these thrusters only to negate velocity, but will not let you use it for acceleration. Also side thrusters will minify drift. In your case forward and backward thrusters seems not needed, but side ones may be useful. Oh yeah, and fall dampening thing also use camera for more precise height calculation and artificial obstacles detection, such stations, but not need it as badly as for gyros.

Currently even if you don’t have gyros or thrusters this stuff will still eat some cycles but not so much. And nothing to worry about, unless you run dozen of DAS trucks simultaneously. And I will fix it in next version.

Torque aka power. It initial value is 5, but when you press W or S it will ramp up by 2.5 every tick. Game uses 60 ticks per second. So torque (power) will rise from 5 to 100 in 0.6 seconds. So there shouldn’t be a hard kick at movement start. Also torque lowers when speed increases. So 100 is only reachable if you not moving. Brakes on or you ram into wall. This works as automatic gear box, more torque at low speed, less torque at high speed. It helps climb hills: you start climb, speed lowers, torque rise, until values naturally balance each other. I think the only thing you may want to change is ramp up/down rate value, it’s in lines
if(CurrentInput.Z == 0) TorqueRampUpDown = Math.Max(TorqueRampUpDown - 2.5, 5); else TorqueRampUpDown = Math.Min(TorqueRampUpDown + 2.5, 100.0);
I actually wasn’t intending to make it tweakble. But I can’t stop you, you know.

Friction. Is most important part. As you correctly said script gives you more friction at lower speed, and less at high speed, same way as torque. IRL there are different types of friction, for example friction of stationary body, and friction of sliding, and friction of rolling, and third is less then second, and second is less then first. But SE handles with only one, just friction; at least it’s what I observe. So when wheel bumps up and then go back and touch surface it can result in propulsion kick, making driving with high friction on high speed unstable. So I lower this friction. You can tweak minimal friction value that will be at maximum setted velocity with MinFriction variable.
Furthermore friction lowers even more per wheel basis, depending on its sideward velocity. When wheel moves sideward, it as you said, bit surface with all friction it have, and since it can’t rotate in this direction vehicle impulse (velocity and mass) transforms into angular momentum, result – roll over. Such sideward movement could be result of stiff turn, or surface decline. In case of surface decline it’s a gravity trying to push you sideway, wheel bit surface and you roll over. So my script detects this sideways movement and drop friction very low, so instead of flipping you drift. Unfortunately it’s only choice between flipping and drifting, and i suppose second is way better than first. Note though that this friction drop happens not on all wheels. I will try to explain on example:
/=\ this is a car 0|[ ]|0 -> and it slide to the right | # | and friction will be dropped only on right front and right back wheels, 0|___|0 -> so they will slide, but left front and left back will have their friction related to speed value, so they will bit surface, but occurring angular momentum will be negated with reaction of the support.
Right wheels here act as such support. So yes vehicle is pretty drifty, but not totally like skids, since opposite side wheels still have friction and they will stop vehicle at some point, but at least it will not flip. And as I mentioned sideward thrusters can minify this drift. Friction part of script is like core part, definitely not recommend to disable it in any way, you can change MinFriction that correspond friction at top speed, but again not recommend to fiddle with lower (drop) value, which calculated in line:
lowerFrictionCap = Math.Pow(MathHelperD.PiOver2 - CenterMassToWheelsBaseAngle, 3.5) * s;

Well, I think I answered all you asked. Pretty damn much letters. A WALL of text. Thumb pic justify itself.
Last edited by Wanderer_308; 17 Oct, 2017 @ 3:51am
Wow! Thank you so much. As I said, I don't really understand scripting, certainly not enough to understand a script by reading it. But these tips will help me to play with the right bits and see what happens. Thank you again for such a detailed reply, and for explaining all the different functions. I will play around with it and see what I can do. :)

And thanks again for such a game-changing script.
< >
Showing 1-2 of 2 comments
Per page: 1530 50