Project Vehicle Handling Simulation in Orbiter2016

Wow it looks great. Can't wait to try it on the moon.

I did some towing attachment animation for a Jason Trailer. I basically detected the movement of the towing vessel and direction. If moving forward the attachment followed the direction with a delay. If backing up it reversed the rotation direction.
 
Last edited:
I can try with attachments, i don't know if it'll works, i'll see.
AFAIK, that's what it uses (attachments that is) so it does work.
 
Attachments would be great, because that way we could try to use it to ground manage any vessel.

Thinking about a mobile universal crawler / launchpad ....

For it to work like that we also need automatic detachment once the attached vessel applies trust.
 
Sometimes it sinks below the surface, but my feeling is that there's nothing to do about it

That's my feeling too, although it will get a lot better with a model that has more reasonable spacing to the ground. The essential issue is that there can be Z-level fights with the terrain mesh, and if the vessel mesh looses, all polygons "below" ground level don't get rendered, even if parts of them would be above ground level. Orbiters graphics engine seems to be very coarse that way (well, it's bloody DX7, after all...). This will be an issue with wheels, but rarely with the entire chasis if it has sensible suspension for what amounts to offroad terrain...

It seems to me that it follows very weel the hills, and the terrain in general, and even if you turn and change local orientation it adapts itself.

Almost too well... you'd expect really lousy traction on the moon, and long jumps when driving over hilltops at those speeds (low gravity is not very conductive to driving...).

But that goes together with this question from GattisPilot:

Will it roll down a hill it no force is applied?

Essentially, these things are part of an actual physics model for the vehicles, not of the basic implementation and integration into orbiter. Personally I would love to see stuff like this, but it's optional. UCGO didn't bother with it either. For a first prototype implementation, this looks great! Can't wait to give it a go.


Don't forget towing and pushing.

That's one of those things that sound easy enough, but open pandoras box of inverse kinematics when you try to put it into code. It would be cool to have, but to any developer I would recommend to leave it for last.
In fact, if you're planning to go this far, you might think about using a third party physics library, because you'll be coding your brain out your ears otherwise. SOmebody did experiments with using the actual bullet library for vehicle physics in orbiter a while back, and the results were very impressive. But Orbiter didn't yet have native terrain back then, so nothing really came of it.

EDIT: Uh oh, missed an entire page... :shifty:
 
Last edited:
Would turning off near clipping help ?
 
Would turning off near clipping help ?

No. I don't think so. There are landing pad at Brighton where you can land a DG and depending on the pad a part of the gear in "in" the mesh.

I am looking forward to it.:thumbup:
 
That's my feeling too, although it will get a lot better with a model that has more reasonable spacing to the ground. The essential issue is that there can be Z-level fights with the terrain mesh, and if the vessel mesh looses, all polygons "below" ground level don't get rendered, even if parts of them would be above ground level. Orbiters graphics engine seems to be very coarse that way (well, it's bloody DX7, after all...). This will be an issue with wheels, but rarely with the entire chasis if it has sensible suspension for what amounts to offroad terrain...
Yep, that's why I say that I'm very happy with the result

Almost too well... you'd expect really lousy traction on the moon, and long jumps when driving over hilltops at those speeds (low gravity is not very conductive to driving...).

But that goes together with this question from GattisPilot:

Essentially, these things are part of an actual physics model for the vehicles, not of the basic implementation and integration into orbiter. Personally I would love to see stuff like this, but it's optional. UCGO didn't bother with it either. For a first prototype implementation, this looks great! Can't wait to give it a go.

Yep exactly, for the time being I just want to have a safe way to create landed vessels, and to move them around, exploit it as they were cars since we are here, but not a complete physical simulation, I think it would be quite an overshoot for the moment.


That's one of those things that sound easy enough, but open pandoras box of inverse kinematics when you try to put it into code. It would be cool to have, but to any developer I would recommend to leave it for last.
In fact, if you're planning to go this far, you might think about using a third party physics library, because you'll be coding your brain out your ears otherwise. SOmebody did experiments with using the actual bullet library for vehicle physics in orbiter a while back, and the results were very impressive. But Orbiter didn't yet have native terrain back then, so nothing really came of it.
Exactly, if I'll add this, it will be simple and "dirty", no physics, just attachment and carry other vehicles around (it will be a mess anyway, because there is the need to fix an attachment point also on the towed vessel) otherwise I'll lose one month to do it, when the rest is just ready (except for Reverse, which I still have to add)
 
So, a small/big update:

I finally managed to understand the way to get and work with mesh groups coordinates. This means that i can finally find barycenter of a mesh easily (volume is much more complicated)

So the idea is to give the option for the user to just indicate the reference mesh group of the wheels and then the module will calculate its rotation axis by itself.

While here is maybe a marginal point, for other addons could be a really useful implementation.
 
So the idea is to give the option for the user to just indicate the reference mesh group of the wheels and then the module will calculate its rotation axis by itself.

It shouldn't be much of a problem for the add-on dev to specify the axis, really...
 
BrianJ did a good job of towing with the Pete 379 in the Corn ranch project. He may have something for you.
 
Yes. It would great if the towing physics from tl8's JBT B1200 could be added.

For my Truck and the Crawler for Kourou (spacecraft vehicles) I use the docking system. It works fine...

803441exepl.jpg
 
For my Truck and the Crawler for Kourou (spacecraft vehicles) I use the docking system. It works fine...

803441exepl.jpg
The problem is that the physics aren't correct. Just try turning and you'll get everything moving as it was rigid stick rather than the flexible joint system were expecting. That's all nice and good if you're supposed to be towing something that is supposed to be on rails but anything else and it breaks down.
 
Last edited:
The problem is that the physics aren't correct. Just try turning and you'll get everything moving as it was rigid stick rather than the flexible joint system were expecting. That's all nice and good if you're supposed to be towing something that is supposed to be on rails but anything else and it breaks down.

the module is almost ready, this towing-pushing is going to probably be the hardest part of all now.

My idea is the following:

- The module will provide an attachment point to use for towing or pushing.
- at the user input it will look for the closest vessel to it, it will scan all the available attachments, looking for a defined ID
- if the attachment id is found then the module will grab the child vessel and from then on tow it around, considering the attachment point as a flexible joint, therefore calculating the attachment rotation and everything. Not easy at all, but I'll try to make it.

It will be then responsability for the user to create relevant attachment points with proper ID and the proper position in the various vessels. That can be done also through the cfg file. It's true that I can make the module to create also the attachment in the other vessels, but then it will need to know where, in which direction, in which vessel... So I think it's fair this way

And let's hope that I can manage that towing joint :crystalball:
 
Reverse is going to be the really hard part...

well, if it gets crazy, I'll just code the towing. We're not voted to sacrifice here right :lol:
 
Ok, so here's the first pre-release.

The Formula 1 Ferrari example is included for fun!

There is still no doc, but it's super straightforward and explained in the cfg file.

The key of everything is it, the cfg file, located in the config/vessels folder, everything is set through it.

If you want to make your own vehicle, just duplicate the GeneralVehicle.cfg file into whatever you want it to name, and change whatever you want.

I paste the example cfg file also here, so you can have a quick look directly:
Code:
ClassName=GeneralVehicle
Module=GeneralVehicle

Empty_Mass = 1000			;[kg] empty mass (almost unused)
Mesh = F1\F1				; meshname
Cockpit_pos = 0.0 0.25 0.1	; [m m m] Position of the cockpit camera
Acceleration = 1.45			; [G] Acceleration factor expressed in Gs
Brake = 3					; [G] Deceleration factor expressed in Gs
Max_Speed = 300				; [km/h] Max Speed
Reverse_Max_Speed = 50		; [km/h] Max Speed in Reverse
Steering_Speed = 2  		; Steering wheel velocity factor
Max_Steering_Angle = 30  	; [DEG] Max steering of the front wheels per side
Height_From_Ground = 0.599 	; [m] height of the center of gravity from the ground
Always_Upright = FALSE   	;if set to TRUE vehicle will always remain parallel to the ideal ground, without following terrain's inclinations

;Mesh Groups - just specify using space between them

Rear_Right_Groups = 271 270 16 128 
Rear_Left_Groups = 121 21 265 267 8 9 12 
Front_Right_Groups = 264 262 15 123 5 6 7 162 263 23 167 173 169 174 163 164 168 166
Front_Left_Groups = 260 261 22 122 2 3 4 14 259 144 148 155 151 156 145 146 150 147
Steering_Wheel_Groups = 29 349 53 24 57 33 110 26 27 28 66 67 68 30 32 58 

;Front_Wheels_Diameter = 0.750766		;if not specified the module will try to calcualte it automatically
;Rear_Wheels_Diameter = 0.755238				;if not specified the module will try to calcualte it automatically

;Rotations info
;Rear_Axel_Pos = 0.0 -0.2426463 -2.121106   ;if not specified the rear right tyre group barycenter will be used
;Front_Axel_Pos = 0.7848695 -0.2371205 1.54079	;if not specified the front right tyre group barycenter will be used. The left will be considered symmetrical
;Steering_Axis = 0.6513898 0 1.542014		;axis for steering of the front tyres. Just specify the Front - Right tyre rotation, the Front left will be considered symmetrical if not specified the front right wheel groups barycenter will be used
;Steering_Wheel_Pos = 0 0 0.505				;if not specified the steering wheel group barycenter will be used
;Steering_Wheel_Axis = 0 0 -1				; if not specified 0 0 -1 is used

Camber = 3.25669767							;[DEG] camber angle of the front wheels, no  camber is implemented for rear wheels.

Towing/Pushing is NOT implemented yet.

Available for comments!

cheers guys :cheers:
 

Attachments

Last edited:
Small things forgotten: keys :lol:

Numpad8 to accelerate forward, Numpad2 to brake, Numpad 4 and 6 to turn, Numpad5 to center the steering. Once stopped ctrl+numpad2 sets the reverse.
 
Thanks. So I figured the keys are keypad 8/2 forward reverse and 4/6 steer, right? Is there a way to slow the steering?

Is there a way to gradually built speed. So that the gradually hit the 8 and not go full force?
Drives good though
 
Last edited:
Is there a way to slow the steering?

Sure, just put a lower value for "Steering_speed"

Is there a way to gradually built speed. So that the gradually hit the 8 and not go full force?

I'll add a "full_pedal_time" factor which will represent the time from the initial press of the numpad8 to the full power pedal. Something that will work like this: if the factor is 2, then you'll have to keep the button pressed for 2 seconds to get the full acceleration pedal.
 
Thanks.

I tried using another mesh with no wheel animations. It loaded ok. But when I went to accelerate a ctd.
Code:
ClassName=GeneralVehicle
Module=GeneralVehicle

Empty_Mass = 1000			;[kg] empty mass (almost unused)
Mesh = LER8				; meshname
Cockpit_pos = 0.0 0.25 0.1	; [m m m] Position of the cockpit camera
Acceleration = 1.45			; [G] Acceleration factor expressed in Gs
Brake = 3					; [G] Deceleration factor expressed in Gs
Max_Speed = 10				; [km/h] Max Speed
Reverse_Max_Speed = 50		; [km/h] Max Speed in Reverse
Steering_Speed = 1  		; Steering wheel velocity factor
Max_Steering_Angle = 30  	; [DEG] Max steering of the front wheels per side
Height_From_Ground = 0.599 	; [m] height of the center of gravity from the ground
Always_Upright = FALSE   	;if set to TRUE vehicle will always remain parallel to the ideal ground, without following terrain's inclinations

;Mesh Groups - just specify using space between them

;Rear_Right_Groups = 271 270 16 128 
;Rear_Left_Groups = 121 21 265 267 8 9 12 
;Front_Right_Groups = 264 262 15 123 5 6 7 162 263 23 167 173 169 174 163 164 168 166
;Front_Left_Groups = 260 261 22 122 2 3 4 14 259 144 148 155 151 156 145 146 150 147
;Steering_Wheel_Groups = 29 349 53 24 57 33 110 26 27 28 66 67 68 30 32 58 

;Front_Wheels_Diameter = 0.750766		;if not specified the module will try to calcualte it automatically
;Rear_Wheels_Diameter = 0.755238				;if not specified the module will try to calcualte it automatically

;Rotations info
;Rear_Axel_Pos = 0.0 -0.2426463 -2.121106   ;if not specified the rear right tyre group barycenter will be used
;Front_Axel_Pos = 0.7848695 -0.2371205 1.54079	;if not specified the front right tyre group barycenter will be used. The left will be considered symmetrical
;Steering_Axis = 0.6513898 0 1.542014		;axis for steering of the front tyres. Just specify the Front - Right tyre rotation, the Front left will be considered symmetrical if not specified the front right wheel groups barycenter will be used
;Steering_Wheel_Pos = 0 0 0.505				;if not specified the steering wheel group barycenter will be used
;Steering_Wheel_Axis = 0 0 -1				; if not specified 0 0 -1 is used

Camber = 3.25669767							;[DEG] camber angle of the front wheels, no  camber is implemented for rear wheels.
scn:
Code:
BEGIN_SHIPS
Ferrari:GeneralVehicle
  STATUS Landed Earth
  POS -80.6750675 28.5223246
  HEADING 13.47
  ALT 0.599
  AROT 58.858 -8.751 7.359
  AFCMODE 7
  NAVFREQ 0 0
END
LER:LERTEST
  STATUS Landed Earth
  POS -80.6758980 28.5227620
  HEADING 66.56
  ALT 0.599
  AROT 46.121 -60.997 17.073
  AFCMODE 7
  NAVFREQ 0 0
END
END_SHIPS
 
Back
Top