Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Mon Sep 25, 2017 10:32 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Suspension size
PostPosted: Mon Feb 02, 2015 9:54 pm 
Offline

Joined: Fri Nov 22, 2013 2:56 am
Posts: 16
Hi,

i followed a car model from kinghill/mania drive in my project ( corp+balancier+4 wheels+4 suspension elements)
My corp is only about 0.3 lenght. When i press F1 i can see wireframes and i noticed my suspension is bigger then spheres.
I launched mania drive to compare ( using t key) and suspension size seems ok there - far smaller than wheel element.
I suspect some of the unexpected car behavior is the effect of this incorrect model.
How to fix this ?


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Fri Feb 06, 2015 11:24 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Hi,

"Debug rendering" of ODE joints use a fixed size sphere radius of 0.05 and does not reflects any physical property of the joint itself. If the radius of your wheel is smaller than 0.05, it's perfectly normal that the joint is bigger.

You'll have to search for other hints to find the source of the bad behavior of the car ! :) (It's a very hard work, it took me days and days to get it right for ManiaDrive, for instance). Be very careful about the mass and position of the pendulum, it's the main element responsible of the center of gravity of the car and of the way it handles inertia in the curves. Wheels mass is very important too, obviously (and then suspension and wheel parameters).

Try to start with working values (replicate the ManiaDrive or KingHill car, for instance) and adjust slowly each parameter one by one until you reach the behavior and car you want. Just a tip ;)


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Sat Feb 07, 2015 3:28 pm 
Offline

Joined: Fri Nov 22, 2013 2:56 am
Posts: 16
I started off from kinghill2.c
I decided to scale up to mania_drive like dimensions
While trialing i had many weird moments e.g. at the start of kinghill, you fall to the ground, right? Imagine my car somehow got through the ground and kept falling. I thought it was due to joints.
Nevertheless it's a lot of fun, toying with racing bolid model :D
Atm i focus on downforce. I tried applying more mass to wheels and balancier but ... i guess ... downforce in opposite to mass doesnt affect centrifugal force, and perhaps that's why my bolid felt like loaded lorry on a fast turn :mrgreen:
By pendulum you mean 'balancier' element from mania_drive or sth else ?


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Sat Feb 07, 2015 6:15 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
bitrider wrote:
I started off from kinghill2.c
While trialing i had many weird moments e.g. at the start of kinghill, you fall to the ground, right? Imagine my car somehow got through the ground and kept falling. I thought it was due to joints.


Well, it sounds to me more related to the spawn position of the car, no ? Bad joints between wheels and body will simply make the car fall apart, not through the ground. Or maybe your tweaking contact points too ?

bitrider wrote:
Atm i focus on downforce. I tried applying more mass to wheels and balancier [...] opposite to mass [...]


Mmm... downforce, as the name stands, is pushing the car down as the air flow increase with speed. Does not seems opposite to mass ;) (I would apply it to the car body, not wheels or pendulum). Or are you talking about another force ? (drag resistance ?)

bitrider wrote:
By pendulum you mean 'balancier' element from mania_drive or sth else ?


Yes. "Balancier" is a french word, I was too lazy to search for a translation at that time, it seems :)


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Thu Feb 12, 2015 2:06 am 
Offline

Joined: Fri Nov 22, 2013 2:56 am
Posts: 16
Your tips were helpful, thx 8)

By now my bolid feels more or less like a dirt track racer :P
I gave mu a value of 0.7 and slip 1.2
Otherwise my car keeps flipping

Inside function display from kinghill2 i put the code:
Code:
            dReal downforce = 20.0*((speedwheel*speedwheel)/1600);
            raydium_ode_object_addforce_name_3f("corps", 0, 0, -downforce);


But unfortunately this doesn't affect my driving experience.
Maybe i should adjust the values.
As i said i try to use values similar to mania_drive in general.


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Thu Feb 12, 2015 8:45 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Two things I see about your downforce code :

1 - You try to apply your force to "corps" and it sounds OK to me, but you are using raydium_ode_object_addforce_name_3f(). Car's "corps" is an element, not an object. The function raydium_ode_element_addforce_name_3f() should be used here, I think

2 - Where (in your code) do you apply this force ? It should be done independently of the framerate. The best place to do that is perhaps a raydium_ode_StepCallback function. Take a look at the very bottom of test6.c, it registers a step() function.


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Sun Mar 01, 2015 12:22 am 
Offline

Joined: Fri Nov 22, 2013 2:56 am
Posts: 16
In the meantime i stumbled upon another problem.
I have a flat surface as a ground. I need to put barriers to keep the bolid within the track.
I made two extruded closed curves.
Converted to meshes.
I'm trying to place them and set up correctly.
My code so far:
Code:
b=raydium_ode_object_create("BARRIER");
//b=raydium_ode_object_find("GLOBAL");
//raydium_ode_object_colliding(b,1);
raydium_ode_object_box_add("innerbarrier",b,0.02,RAYDIUM_ODE_AUTODETECT,0,0,RAYDIUM_ODE_STANDARD ,TYPE_BARRIER,"innerbarrier.tri");
raydium_ode_element_material_name("innerbarrier",RAYDIUM_ODE_MATERIAL_HARD);
raydium_ode_element_slip_name("innerbarrier",RAYDIUM_ODE_SLIP_ICE);
raydium_ode_element_move_name_3f("innerbarrier",0.0,0.0,0.0);
raydium_ode_object_move_3f("BARRIER",0.0,0.0,-2.0);



(I introduced TYPE_BARRIER with value 99)
So if i set innerbarrier to STATIC the car goes through.
If i set to STANDARD it falls from the sky and keeps actiong weird.
If i export it together with the ground tri, it has a default friction and bolid's wheels keep climbing on it instead of bumping;

I just want it to act like in real life.


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Sun Mar 01, 2015 2:50 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
If these barriers aren't supposed to move, even under deep impacts, STATIC looks good (makes the simulation more stable, and faster).
If the car goes through theses elements, make sure that raydium_ode_CollideCallback and raydium_ode_ObjectNearCollide are aware of your new TYPE_BARRIER.

A better option could be to make these barriers part of the ground mesh itself. The physic shape would fit 100% the visual one (not just a box), it's fast, and you don't have to care about all this nearcollide/collide setup. But you must find a way to do this by yourself. ManiaDrive "concatenates" 3D models to create the ground, for instance (see mni_generate() I think).


Top
 Profile  
 
 Post subject: Re: Suspension size
PostPosted: Wed Mar 11, 2015 12:28 am 
Offline

Joined: Fri Nov 22, 2013 2:56 am
Posts: 16
I moved back to exporting all the race track into single world tri file.
But before solving the problem i played around a bit trying to make use of extruded curve ( which is a surface) without a success.
After a strong hit into the barriers the wheels always went through and corps was always left on the other side.
It was somehow funny. It looked like a train with wheels underneath the rails. But it was nothing like a racing bolid i'm after ( after all :wink: )
The cure came from the blender model. I simply "solidified" the mesh from the extruded curve.
Two of them ( barriers left and right) to be precise. By factor 0.1.

Now i made a progress and need to find a way to secure every online player with a different bolid livery.
Also on todo list: define starting (respawn) positions. And display server time on the clients.

:)

Let me check if i will make it before the 2015 Formula 1 season starts :mrgreen:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group