Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 652 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 8 of 9 1 2 3 4 5 6 7 8 9
Re: some a6 physics questions #15471
05/02/03 07:12
05/02/03 07:12
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
how could i force the front wheels to stay parallel?

would the cylinder hull work better (less slip) for the wheels because it has more ground contact area than a sphere?

...maybe i should try to program a ESP system like some real cars have. [Smile]

Re: some a6 physics questions #15472
05/01/03 22:16
05/01/03 22:16
Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Phantom88 Offline
Expert
Phantom88  Offline
Expert

Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
I can't get your code to work, could you post your working code?

~Phantom88~


Programmer, Gamer ICQ #: 157485106 | Xfire: Phantom1988 | MSN: lauri_andler@hotmail.com | AIM: FinPhantom | YAHOO: FinPhantom
Re: some a6 physics questions #15473
05/01/03 22:21
05/01/03 22:21
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441

Re: some a6 physics questions #15474
05/02/03 03:35
05/02/03 03:35
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline
Member
Jason Bryant  Offline
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
I'm having trouble with the code below and the template camera system. Any advice as to what I need to do for modifications?

Thanks in advance,

Jason

Re: some a6 physics questions #15475
05/02/03 05:05
05/02/03 05:05

A
Anonymous
Unregistered
Anonymous
Unregistered
A



quote:
Originally posted by ventilator:
i still don't know what the spring/damper constant specifies?

Those two values are the same parameters as the ones set in ph_setcorrections.
quote:
Sets global correction factors for the physis simulation. ERP stands for Error Reduction Parameter and defines how quickly misaligned constraints get adjusted. Setting ERP to 0 will have constrained objects drift apart after some time because errors get not corrected. With ERP set to its maximum value any constrained objects that get forced into an unacceptable position/orientation will be corrected within a single frame. This however can cause overshooting and it is thus recommended to use smaller values instead. Constraint Force Mixing on the other hand determines how much a constraint is allowed to be violated. Setting CFM to 0 results in very stiff joints (this will lead to errors though- do not do it). Setting CFM to its maximum value makes constrained objects act as though limited by rubber bands
If you want spring-like connections you can set the CFM value to something a little above 0.1, or the ERP value to a little less than 0.9. Try setting a keyboard shortcut for changing these values, as getting them just right takes a lot of trial and error.

Here's a formula for converting spring/damper coefficients (s, d) to ERP/CFM values corrected for the time value (I prefer using trial and error, though ;] )
CFM= 1/ (time*s+d)
ERP= time*s * CFM

quote:
if i want to have shocks / suspension, do i have to use an additional slider constraint for each wheel? and how would i set this constrain up so that it works like a spring? just set a motor for the slider which is active all the time?
You could soften up the wheel constraint by altering CFM/ERP, or use a slider attached to the wheel. Try setting the slider motor to a desired velocity of 0, with some margin in its max/min limits. If this does not work then use the technique described below: query the slider position and apply a positive/negative motor velocity depending on whether the position is <0 or >0. Make sure to time-correct this value or else you will have a "lowrider" if the framerate drops and the slider overshoots. [Wink]

quote:
how could i force the front wheels to stay parallel?
a) Well, in real cars, you have a beam connected to both wheels. So one idea would be to attach a limited/motorized slider to the front end of the front wheels.
b) The other way is to query the axis1 orientation of both front wheels (phcon_getposition) and then apply motor values (scaled by time) in order to rotate them to the desired position. Both methods have their advantages and disadvantages, please try both to see which gives you best performance and stability.
I just realized that the manual only refers to axis2 motors for PH_WHEEL. It should read:
quote:
Motor1: Set desired angular velocity around axis1 and the maximum torque allowed to achieve this velocity, e.g. (10, 50,0) will set a desired angular velocity of 10 Hz and a maximum torque of 50,000 Nm
Motor2: Set desired angular velocity around axis2 and the maximum torque allowed to achieve this velocity, e.g. (10, 50,0) will set a desired angular velocity of 10 Hz and a maximum torque of 50,000 Nm

quote:
would the cylinder hull work better (less slip) for the wheels because it has more ground contact area than a sphere?
The physics engine is not using surface patches, so in a way there is no "area". Instead, contact points are used, which in the case of spheres result in a single contact point underneath its center. Cylinders would yield more accurate collision results in that a number of contact points will be generated along the top and bottom cylinder caps. However, each contact adds an inequality(read: slow) constraint to the system. If these contacts differ only slightly you will probably run into problems of bouncing. (This is why PH_POLY collision often causes bouncing- a number of redundant contacts are created along the colliding edges. I am working on a fix for that right now). I have not tried creating a car with cylinders because they don't collide with level geometry. Cylinders or boxes are always slower than spheres, but they might yield better stability. Again, I urge you to try it out and see what works best for you.

Re: some a6 physics questions #15476
05/02/03 20:20
05/02/03 20:20
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
thanks for the answers!

i tried to adjust the spring/damper parameters now. it works pretty well but the car wouldn't pass the elktest yet! [Smile]

quote:
b) The other way is to query the axis1 orientation of both front wheels (phcon_getposition) and then apply motor values (scaled by time) in order to rotate them to the desired position.
i thought motor values get time corrected automatically because the units are based on seconds (Hz, quants / second)?

<edit>i think i understand now. time correction is only necessary if you use motors for corrections like keeping the front wheels parallel...</edit>

...
@jason: i updated the script below. you don't need the templates with it. control the camera with the right mouse button and the scrollwheel. try to adjust the sc and dc variables for different spring / damper settings. currently i use 4WD because i think there is less slip during acceleration then... i will work on the front wheels next because they still don't stay parallel...

Re: some a6 physics questions #15477
05/02/03 21:22
05/02/03 21:22
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
is it possible to apply more than one constraint to an entity?

Re: some a6 physics questions #15478
05/02/03 22:22
05/02/03 22:22
Joined: Oct 2002
Posts: 120
India
G
greyplasma Offline
Member
greyplasma  Offline
Member
G

Joined: Oct 2002
Posts: 120
India


Re: some a6 physics questions #15479
05/02/03 22:26
05/02/03 22:26
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
hm.. i don't know... but try again because i just altered the code...

Re: some a6 physics questions #15480
05/02/03 22:35
05/02/03 22:35
Joined: Sep 2001
Posts: 237
Maine, USA
J
Jason Bryant Offline
Member
Jason Bryant  Offline
Member
J

Joined: Sep 2001
Posts: 237
Maine, USA
@ventilator: Thank you for providing this script. It is very helpful!

Jason

Page 8 of 9 1 2 3 4 5 6 7 8 9

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1