Jump to content

Vehicle with a good stability!


Gilmer
 Share

Recommended Posts

Hi guys,

Here I'm again with physics problem. I'm trying make a stability movement by vehicle, but I dont having success. I can't set the variables to suspension lenght, spring constant, spring damper and vehicle mass.

 

The problem is that the car stay very light, and if have something in the road, like stones, trunks, etc...the car is overturned. But if I adjust to a mass more heavy, the vehicle looks like "stucks" or "pasted" in the road, anyway, I can't find some good setting for this.

 

I searched in old threads, and I found a topic that other guy, haved the same problem:

 

This is not first time that we have problem with physics in LW, we are with one year of work in this project, have just more somethings to do, and fix, but this things, are disturbing us to continue, and we can't lost 1 year of hard work.

 

So, my question is, now that we are in last months to finish the project, but we are having this problems, I need to know some solution to finalize this, because sincerely, our team bought the LW looking more in the graphics (that's awesome!), and vehicle system. But when we started to use, and really test the vehicle system, left to be desired.

 

We need a feedback, for a update date about LW 3 or how we can continue with this...

We did everything that we need like GUI system, audio 3d usint thyrd libs and other things, but this physics system that's disturbing us.

Link to comment
Share on other sites

The vehicle body has to encompass the tires so you don't get collisions like that. Because your tire spring points are exposed, it is possible for a rock to appear right under them, very close to the spring origin, causing a very strong reaction from the springs.

 

Untitled.png

 

 

Link to comment
Share on other sites

Hi gilmer and Vital

yes the problem is still there, if you stick with Lumooja (well done) draw you can't create a RC buggy like i wanted,

 

BUT :

 

i saw a very great "tractor" simulation sometimes ago and there was great physic apparently, and the wheels overstepped the body.

 

I did a well hull which emcompassed all the car wheels but without success, the physics still degenerates the second video is one of the hull transformation.

No for me, cars need some more love here, tutorials, exemples etc.... viperscout was locked so no chance to find the way to go (observing the skull)...

plus the ground bug for ATI who raised , not good moment for me....

AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11

Link to comment
Share on other sites

Yes, of course what lack here more infos about vehicles. In wiki, in vehicle page, dont have none example about it. Because make a vehicle, export, link with tires is easy, now to stabilize and do a good settings for this, don't have nothing talking about. As diedir talked, the viperscout is the only reference to help us, but is locked.

 

I've exported it in anyway, but still dont was sucess. I make the wheels under in car, like admin talked, but still have the physics problem.

 

wi53et.jpg

 

 

Moreover, the own viperscout is like a paper in sometimes, just to driver in "desert_highway.sbx" is good, but if put in a race game, together with more 5 cars ie, the stability is horrible, everytime the car are flipped, flown and etc...

 

We are very worried about it.

Link to comment
Share on other sites

I tested vehicles several times - since i know that you guys had/have issues with your implementation and i am in need of ai controlled vehicles myself ... but i only have the monster truck to "test" and the only issue i had ( to date ) was the overturn of the monster truck. The "overturn" issue got "fixed" by adding

object.model:SetMassCenter( Vec3(0, -0.5, 0) )

in the vehicle_monstertruck.lua script itself.

Beside that i will controll some of the physic behavior within the collision function i guess e.g.

function object:Collision(entity,position,normal,force,speed)
end

and thats the only advice i can give ( being a physic noob ) - dont let physics handle your game dynamics alone. Let that to chaos theory.

If you take an older race game by sample - they used to zero out all physics behavior as soon as a obstacle got hit. There might have been some spring movement but forces where "pushed back" afaik.

Iam a physics noob though and i have no idea how a setup for a motorcycle would look like but i guess there simply need to be some invisible pivots, bodys, springs, joints attached to the "playermodel" to controll its behavior.

 

I would like to see more of this - to get a better idea myself. I posted this month ago but again - this might just have to do with forces similar to magnetism ... if one thinks about ai controlled opponents it really is handled like a donkey is following a carrot. ( setting a antiforce on coliision i mean )

 

cant be of much better help here tho. ;o)

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

yes the problem is still there, if you stick with Lumooja (well done) draw you can't create a RC buggy like i wanted,

That image was posted by me using the admin account.

 

Of course the wheels in your model have nothing to do with the actual location of the tire ray cast, so make sure that is inside the physics body of the chassis.

 

You posted another video showing vehicles with very high spring constants, causing them to jump all over. Those spring values are very important and vary based on mass and spring length. Adjust those values until you get something that is loose enough to not jump around, but tight enough to hold the chassis up.

 

Beyond that, I suggest posting a demo so we can see the behavior for ourselves.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

So Josh, I was changed the values after you talked. I tryied a several values and dont have success.

Anyway, I'm posting other video, and the models used on the video.

 

 

 

Link to models:

http://unidev.com.br/temp/models.rar

 

 

The spring values, are on the lua script. The spring damper are high, because tests, that I was making.

What's happening when the car pass above the fence, is the same thing thats happen when pass over a stone, trunks..etc..

I put a fence and not a stone, because the stone model is a purchased model, and we can't publish de .max source.

 

Thanks guys..

Link to comment
Share on other sites

Looks like one phy object ( the car ) tries to penetrate the other ( fence ) and that the tires are too small.

For the first issue i would oversize and simplify the fence phy ( put it in a box if its just used as fence ) and might even send a message to the car that

a. the car breaks the fence or

b. the car has to reset all its forces with the "object:Collision" function.

 

The second one i would say one can easily hang in mid air ( gameplay wise ) and that the tires from the monster truck do seam to help giving enough air between chassi and street so the car does not get stuck between two rocks :) - at least i would say remodel the tires with a higher polycount ... but josh might know better if higher polycount on the phy model is any good.

 

Dont know if this can help but here are my defaut values

 

local suspensionlength  =0.30
local springconstant      =70.0
local springdamper        =150.0
---

object.model.buoyant = 0
object.model:SetKey("collisiontype",COLLISION_CHARACTER)
object.model:SetKey("mass",2.5)
object.model:SetMassCenter( Vec3(0, -0.5, 0) )

 

PS: If one drives over an allready broken-down fence the fence should be of no collision type.

 

hth

AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3

zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5

 

adv_banner-april2012_720x150_tex01.png

 

Xxploration FPS in progress ...

Link to comment
Share on other sites

I can't do a demo now cause i'm far from that , all i do is testing and the multiple tests i did conclued by:

 

very low suspensionlength =0.1

high springconstant =280.0

very high springdamper =800.0

mass of 2.8

 

and before 2.43 all was right (except the physic stuttering=>needed to reboot pc to resolve), the vh reacted exactly as i wanted (like rc buggy that i drove for long time):

very low chassis

no bumpy at all

absorbing all the road defaults with ease

turning tight

 

no the tweakings are very close to be realistic but currently physics is not accurate.

AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11

Link to comment
Share on other sites

Whats the value you have to tweak to make the vehicle slow down and stop when no power is being supplied to the wheels. I find my vehicles just seem to keep on rolling forever.

intel i5 2500k, ram 16gb, nvidia Geforce GTX570, asus xonar sound card. Windows 7 64 bit

Link to comment
Share on other sites

I've not been into Leadwerks very long, but it could be a units thing. Everything seems to be to a generic scale, although the player controller is setup for metres, height being 1.75(m) commonly used and gravity set to 20units instead of 9.81 for greater effect (9.81m/s/s), so it seems we are working in metres, the accuracy in the editor is only to 2 decimal places, so to the nearst centimetre for placement (which is not accurate for my projects, meaning I may have to use the controller with height of 175, not sure yet?). The physics may be returning a force based on a scale that is not proportional to the modeled scale, or accuracy?

It may be worth testing with the same models at a larger scale & mass? Just a thought...Josh, can we have mm accuracy in the editor or better still 10ths of millimetres please :)

Link to comment
Share on other sites

@Kronos

personaly i put this ::

speed = math.abs(carobject.model:GetVelocity(0).z)

chassis:SetForce(Vec3(0,-300+speed,0)) 

it is not the best solution i guess but it works as i need.

 

@Dozz

i never suspected the scale but perhaps i need to try your thoughts.

 

for now i am stuck with conversion from obj to gmf which is no easy for a vehicle, need to export obj hierarchy,...

AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11

Link to comment
Share on other sites

very low suspensionlength =0.1

high springconstant =280.0

very high springdamper =800.0

mass of 2.8

Those values are really high.

 

Change lines 190-193 to this:

	local pivot
local suspensionlength=0.2
local springconstant=20.0
local springdamper=150.0

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Thanks Josh, I tested this values.

Really now are more stable than was before.

 

But still in sometimes the car have a strange behavior. I recorded a other video, you can see better more near the end of video. If I run in straight road, without very stones or elevations, it's working fine, but when have more curves, and need to take some jumps, like a real rally, dont occurs..

 

 

 

The FPS is low cause the Fraps record..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...