Space Engineers

Space Engineers

807 ratings
DAS - Driver Assisting System
9
6
14
7
3
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
99.970 KB
24 Jul, 2017 @ 6:50pm
4 Aug, 2019 @ 2:22pm
27 Change Notes ( view )

Subscribe to download
DAS - Driver Assisting System

Description
Description

DAS - Driver Assisting System - is a script focused on making suspension wheels based vehicles more controllable and more reliable. The script continuously processes vehicle speed, heading direction, orientation, altitude, and tweak suspensions, thrusters, and gyroscopes.

DAS subsystems

Traction Control Subsystem
TCS is a core subsystem which takes care of all suspension wheel's settings. This includes wheels on subgrids. TCS coroutines provide these functionalities:
  • Friction balancing. The script will provide maximum friction when a vehicle drives straight, and reduce it on turns. Additionally, the script detects when a vehicle starts to drift and rebalance friction across the wheels in a way that wheels don't bit surface and drift itself became more predictable. On braking, friction rebalances in a way that mutual drag point of all wheels stay behind the CoM (Center Of Masses), so the vehicle would not be turned around 180 degrees.
  • Torque adjusting. The script will ramp up and down torque to provide a smooth drive start. Maximum allowed acceleration could be changed in script settings. Script simulate electronic differential, and when the vehicle steer torque on inner wheels get reduced. The script also relays user control to wheels on subgrids, so pressing W or S wheels also apply propulsion override to these wheels.
  • Strength calculation. The script will calculate and apply the exact amount of strength each wheel needs depending on vehicle mass, local gravity magnitude, wheel size, and wheel position in the vehicle. Also, TCS has it's own Air Shok functionality. The script will boost strength on wheels when the vehicle falls, but then quickly restore original value once fall is over. This way vehicle will not bounce from the ground that much as with vanilla air shocks.
  • Speed limit variety. TCS offers analog control over speed. I.e. joysticks and alike controllers you can drive at any fraction of set speed limit (130 km/h by default). Also by pressing C key script will boost the speed limit to the maximum.
  • Adaptive steering & Ackermann steering. The Script implements Ackermann steering scheme. By this scheme maximum steer angle on each wheel recalculated, so all wheels follow it's own circular arc, and centers of turning of all wheels are in one place, forming one turning axel. By default, this main turning axel passes through the CoM. This could be changed in script settings. Also, TCS reduces steer angle depending on vehicle lateral speed. This reducement is harsher then vanilla one, but it's derived from the centrifugal force occurring from turning, therefore it more robust at preventing roll-overs. Adaptive steering could be turned off in script settings, also it temporarily turns off when pressing Spacebar+W(or S)+A(or D).
  • Hill Descent Control. When HDC is active script will use wheels propulsion override to decelerate if lateral velocity exceeds the speed limit. Could be useful when going own the hills.
  • Half-braking. The script will disengage brakes on rear wheels if pressed Spacebar+W or Spacebar+S.
  • Wheel adding. If suspension lost its wheel script will re-add it automatically.

Gyro Stabilisation & Assisting
GSA takes control over gyroscopes of a vehicle. The orientation of gyroscopes in a vehicle doesn't matter. Following functionality provided by GSA:
  • Aligning to the gravity vector, or surface curve. Surface curve evaluation requires a downward camera(s). In midair fall GSA will slightly tilt vehicle up to preact for landing.
  • Assistance in turns. When A or D key pressed script will apply appropriate turn force in gyros.
  • Auto-turtleflip. In the case of rover flip upside down GSA with use of advanced gyro manipulation algorithm will apply maximum torque to bring the rover upright.

Smart Dampeners Override
SDO will take control over all thrusters that faced forward, backward and sideward. The script will truncate user input to this thrusters, so main propulsion source would be wheels, and thrusters will serve as speed dampeners, and/or speed boosters.
  • For a speed boost and additional acceleration C+W or C+S.
  • Velocity dampening function may be switched on/off as you turn on/off vanilla dampening with Z key.

Fall Dampening System
FDS will take control over upward thrusters. Following functionalities provided by this subsystem:
  • Fall dampening. Its main purpose is to engage these thrusters when vehicle falling by any reason. For more precise altitude evaluation downward camera(s) required.
  • Thrust truncation. When vanilla dampeners are on thrusters will not provide thrust, so the rover will not hover over the ground. Also if jump jets disabled in the script pressing Spacebar will not fire these thrusters.
  • Jump jets. If jump jets enabled in script pressing Space key will engage upward thrusters.

Lights handling
A small cherry on top of a DAS cake. A lot of things controlled by this script, so I decided, why not put a little bit more. The script can handle lights as stoplights and turn lights.

Features

Autopilot
DAS has built-in autopilot system working with suspension wheels. A user can set itinerary waypoints in the Remote Control block, and then toggle DAS autopilot on. Autopilot parameters:
  • Accuracy. This parameter determines how close to waypoint vehicle should be to consider this waypoint is reached.
  • Wait time. Autopilot can wait a given amount of time in each waypoint before driving to the next one. Handbrakes will be engaged while the autopilot is waiting.
  • Drive mode. There are three drive modes: One Way - autopilot will drive from waypoints A to B, C, D... etc, and once the last waypoint reached autopilot will be turned off, and handbrakes will be engaged; Patrol - autopilot will drive from waypoint A to B, C, D..., and once the last waypoint reached autopilot will drive in reverse itinerary, i.e. D, C, B, A, then again revers; Circle - autopilot will drive from waypoint A to B, C, D..., and once the last waypoint reached autopilot will drive to waypoint A, then B, C, D... etc.
The autopilot has its own speed limit, which could be changed at script settings, and when it's active will engage HDC function of TCS.
Important note: the autopilot does not have any collision detection features, and if there is any obstacle on the way to waypoint autopilot will ram it without any hesitation.

Cruise Control
DAS has a built-in Cruise Control system. CC once turned on it will keep lateral velocity and travel direction that was on the moment of engagement. A user can correct velocity and travel direction with WASD and Spacebar keys without disengaging CC.

Automatic handbrakes
Will engage hand brakes when there is no one in the cockpit/control seat. Can be toggled in the script.

Back-up beeper
Remember these heavy lifter cars that making a beeping sound when driving backward? Now you can do it too! Well, not exactly the same way, because the game doesn't have this particular sound, but still you can place a sound block, choose the sound of your taste and script will play this sound when you driving backward.

Standby mode
The script watches for connector blocks state, and if vehicle connected to something via such connector it will suspend all its subroutines. Once disconnected script ill run itself again.
Note though, if you running something like mobile base with connectors designated to carry smaller vehicles then you need to add a 'DAS_IGNORE' keyword to connector's Custom Data, so the script will not halt itself unintentionally.
Popular Discussions View All (28)
125
1
1 Sep @ 1:55pm
PINNED: Script setup
Wanderer_308
85
23 Sep @ 4:14pm
Feature/Improvement Suggestions
Rubezagel
11
13 Sep, 2024 @ 7:42pm
Suspension strentgth offset
Into
1,220 Comments
Wanderer_308  [author] 29 Sep @ 5:46pm 
There are several definitions of function "public void ReleaseControl()" in each subsystem. There are setters for wheels/thrusters/lights/etc parameters for when the script is turned off. Just edit numbers there, or delete the stuff altogether.
Koinzell || Souza 29 Sep @ 6:35am 
First of all, awesome work on the script, cant use ground vehicles without it anymore lol
is there a way to change the defaults that the wheels go back to when you use the "startstop" argument ? i'm trying to implement a side crawling steering functionality to a vehicle and obviously the script overrides all changes made to the suspensions. i'm trying the approach of turning the script "off" and setting all changes to the suspension using a timerblock but sudenly getting 100% power in the wheels is.... dangerous to say the least. ive took a look at the code but could not find any value that could be changed. ( "pokemon joke here").
Wanderer_308  [author] 15 Sep @ 5:53pm 
Then use the first option I gave you.
Syphond 15 Sep @ 5:34pm 
this is nothing to do with subgrids atm. The cockpit seat is in front of the wheels so it treats all wheels as rear.
Syphond 15 Sep @ 5:33pm 
I was looking to make the forward most wheels not brake, i tried to turn off braking, but the script turns it back on immediately.
Wanderer_308  [author] 15 Sep @ 5:24pm 
No, there is no such tag, unfortunately. But you can edit the script to stop it from handling braking. If you don't use wheels on subgrid the easiest way to disable it to delete the line:
if(!BrStMachine.MoveNext())BrStMachine=UpdateBrakes();

If though you need brakes on subgrids then you need to find and delete these lines from braking subroutine:
foreach(var suspension in WheelSuspensions)
{
if(suspension.Obj.IsAttached)
{
if(suspension.WheelPositionAgainstCoM.Z>0&&UserInput.WS!=0&&!RC.HandBrake)
suspension.Obj.Brake=false;
else
suspension.Obj.Brake=true;
}
}
if(BrakesSkipCycles>0) yield return true;
Syphond 15 Sep @ 2:49pm 
Is there any way to change how braking works. I have a bunch of rovers that have the front wheels are behind the cockpit/seat. I really enjoy how rovers drive but braking is rather dangerous with these designs. Is there a possibility of being able to set a no braking tag in the custom data to tell the script to not use the wheels with this for braking?
Wanderer_308  [author] 5 Sep @ 12:08pm 
@FantazeR Yes it can. It combines stop lights and reverse lights onto one, changing lights settings.
Blunder Munchkin 5 Sep @ 9:32am 
I've been using this mod for a few days now and I've got to say it's AMAZING! I have been very bad at managing my suspension settings and this just does it perfectly. Plus adding new wheels is a breeze! I can't emphasize enough how much I like this mod. Thanks for creating it!
FantazeR 10 Jul @ 7:24pm 
can this script activate reverse lights?