Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 05:41
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, AndrewAMD), 1,278 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Reminder: ph_setautodisable #44185
04/12/05 22:36
04/12/05 22:36
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline OP
Expert
Marco_Grubert  Offline OP
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Just a little reminder that you have the function ph_setautodisable in your physics toolbox and if you have not been using it you might want to do so in the future. What this function does is it checks whether objects have been mostly at rest in the past few frames and if so disables them until they are moved or part of a collision. Without auto disabling physics entities are never completely at rest and require frequent processing (=CPU time) ! Even if a physics entity appears to be resting on the ground what is happening is that it sinks into the ground due to gravity then gets pushed out a bit (maybe 0.001 quants), then sinks in again, etc. Often times you will get a collision every 3 frames this way which could be avoided by suspending the entity a fraction of a quant above the ground.

At engine startup auto-disabling is automatically activated with the following values: ph_setautodisable(0.01, 0.008, 10, 0.1);
This means that entities get suspended when within the past 10 physics frames or 0.1 seconds (whichever is longer) they have
a) have not moved faster than 0.01 quants per sec and
b) have not rotated faster than 0.008 rad per sec

In some cases these values are too optimistic since spheres can easily pick up angular velocity on slightly sloped terrain. On the other hand a box straddling the edge of another box might move very slowly before it eventually falls down. For this reason it's a good idea to change the values in game and see how objects react to them- if they get stuck in weird positions the maximum values were too big or the timeframe too short. For the other extreme, no autodisabling at all, you should monitor PH_NUM_CONTACTS and make sure that it equals 0 whenever there is no apparent movement and no phent_ instructions are being executed.

Re: Reminder: ph_setautodisable [Re: Marco_Grubert] #44186
04/18/05 22:39
04/18/05 22:39
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Hi Marco,

Could you make these and other similar reminders as stickys so they are at the top of the list and we don't end up forgetting?


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