IPB

Welcome Guest ( Log In | Register )

> Fix Your Timestep!, Unstable Physics & Smooth Animation
abaraba
post Oct 1 2008, 08:41 AM
Post #1


Advanced Member
***

Group: Members
Posts: 53
Joined: 5-September 08
Member No.: 6,226



in case you've been using some implementation of simulation stepping function based on, or similar to what is described in this article:
"Fix Your Timestep!"
http://www.gaffer.org/game-physics/fix-your-timestep

..then, you might be interested in 2nd opinion on these matters,
actually, after completing intensive research there was a realization that it turns out almost "everyone" is using some version of this algorithm with interpolation, including popular Physics engines, libraries and commercial console and PC games

..anyway, there is "a paper" on this,
and some 'bonus material' that actually turns this tech. paper into an Allegory Novella and couple of more other things.. how wonderful!


TITLE: Three Bugs With One Stone.. allegory continues
(RealTime Allegory Novel, Technical Paper and Chronological account of an Algorithm discovery)
http://www.geocities.com/ze_aks/myBooK/Thr...thOneStone.html

Chapters:
I) Genesis, anecdote
II) Divina Commedia, abysm spirale
III) Seraphim snd Nephilim, the chronicles
IV) Aspidochelone, physiologus
V) ..alegoria continua

..among other themes,
book most obviously and most practically addresses these issues:
QUOTE
---------------------------------------------------------------------
Common bugs in Havok, PhysX, Bullet, ODE, Ogre, Newton.. SOLVED!

Bug 1.) Few subSteps: "Moon gravity effects"
bUg 2.) A lot of subSteps: "Spiraling to death"
buG 3.) Interpolation VS. Temporal Distribution


Common mistakes and bugs related to fixedTimeStepping - UNCOVERED

a.) Design-Time Planning and Recognition of Hardware Min. Sys. Requirements
b.) "Scaling the World": Gravity, Mass, Size and Hidden Effects of fixedTimeStepping
c.) Jitter, Wobbles, Choppiness and Slowdowns: Unstable Physics & Smooth Animation
---------------------------------------------------------------------
Quick Overview: www.geocities.com/ze_aks/test/sampleTest.html
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
Ylisar
post Oct 2 2008, 02:11 PM
Post #2


Advanced Member
***

Group: Members
Posts: 48
Joined: 10-September 08
Member No.: 6,274



QUOTE (abaraba @ Oct 2 2008, 01:59 PM) *
>>"I've spent a few minutes reverse engineering.."

hahaha, what are you talking about, algorithm is 3-5 lines of code


Oh rly?

QUOTE (abaraba site)
+++"Half-solution A"
//----------------------------------------------------------------------
//-------------------------- *** 1st algo - scaling the TIME "inside"
static btClock realTime;
double simDT, anmDT, STEP;
double secCnt, deltaTime = 0.0;
int cnt, FPS, SPS, fpsTensor= 60;
int btDiscreteDynamicsWorld::stepSimulation(btScalar timeStep, int maxSubSteps, btScalar fixedTimeStep)
{
deltaTime= double(realTime.getTimeMicroseconds())*0.000001f;
if(deltaTime > 0.75) deltaTime= 0; STEP= fixedTimeStep;
m_localTime+= deltaTime; realTime.reset(); FPS++;
saveKinematicState(fixedTimeStep); applyGravity();
anmDT= deltaTime - simDT; if(cnt > 0) simDT/= cnt; cnt= 0;
while( m_localTime >= fixedTimeStep )
{
cnt++; SPS++; internalSingleStepSimulation(fixedTimeStep);
m_localTime-= (simDT >= STEP)? simDT+(STEP*anmDT*fpsTensor) : STEP;
}
synchronizeMotionStates(); clearForces();
simDT= double(realTime.getTimeMicroseconds())*0.000001f;
return cnt;
}


+++"Full-solution A" (simplistic accumulator)
//----------------------------------------------------------------------
//-------------------------- *** 2nd algo - capping the TIME "outside"
int btDiscreteDynamicsWorld::stepSimulation(
btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep)
{
m_localTime+= (timeStep < fixedTimeStep*2)? timeStep : fixedTimeStep*2;
saveKinematicState(fixedTimeStep); applyGravity(); maxSubSteps= 0;
while( m_localTime >= fixedTimeStep )
{
internalSingleStepSimulation(fixedTimeStep);
m_localTime-= fixedTimeStep; maxSubSteps++;
}
synchronizeMotionStates(); clearForces();
return maxSubSteps;
}
//--------------------------------------------------------------------------------
//================================================================================


Anyway, send me a pm or something if you want some explanations Dunge, I'll probably exit the discussion with the clown.
Go to the top of the page
 
+Quote Post

Posts in this topic
- abaraba   Fix Your Timestep!   Oct 1 2008, 08:41 AM
- - Ylisar   Haven't you already spouted this on every remo...   Oct 1 2008, 09:34 AM
- - jezham   abaraba, focus your energy on knocking up some sor...   Oct 1 2008, 12:11 PM
- - abaraba   Ylisar, >>"Haven't you already spo...   Oct 1 2008, 03:42 PM
- - jezham   QUOTE (abaraba @ Oct 1 2008, 04:42 PM) yo...   Oct 1 2008, 05:15 PM
- - abaraba   >>"Lol obviously we're all inferior...   Oct 2 2008, 01:31 AM
- - Dunge   Ok this guy obviously have some issues and no reas...   Oct 2 2008, 05:23 AM
- - abaraba   >>"The subject is something very badly ...   Oct 2 2008, 07:13 AM
|- - Dunge   Your ways of insulting and getting aggressive on p...   Oct 2 2008, 08:30 AM
- - Ylisar   First of all the source on his page is both badly ...   Oct 2 2008, 08:33 AM
- - abaraba   Ylisar, nonsense, you contradict yourself in alm...   Oct 2 2008, 10:15 AM
- - Ylisar   QUOTE (abaraba @ Oct 2 2008, 11:15 AM) Yl...   Oct 2 2008, 11:12 AM
- - Dunge   I was about to say the same thing, there's a b...   Oct 2 2008, 12:50 PM
- - abaraba   Ylisar, Dunge >>"It actually don't...   Oct 2 2008, 12:59 PM
|- - jezham   QUOTE (abaraba @ Oct 2 2008, 01:59 PM) CO...   Oct 4 2008, 11:56 PM
- - Dunge   Wow this guy is unbelievable. You never had much h...   Oct 2 2008, 01:06 PM
- - abaraba   >>"Unfortunately you didn't explain...   Oct 2 2008, 01:28 PM
|- - Dunge   QUOTE (abaraba @ Oct 2 2008, 09:28 AM) ...   Oct 2 2008, 01:43 PM
- - Ylisar   QUOTE (Dunge @ Oct 2 2008, 01:50 PM) I wa...   Oct 2 2008, 02:03 PM
- - abaraba   >>"The || sentence I said you quoted wa...   Oct 2 2008, 02:03 PM
- - abaraba   Ylisar, >>"Everything which Gaffer wri...   Oct 2 2008, 02:10 PM
|- - Quan   And thanks all of you for the long thread Quarrel...   Oct 8 2008, 08:27 AM
- - Ylisar   QUOTE (abaraba @ Oct 2 2008, 01:59 PM) ...   Oct 2 2008, 02:11 PM
|- - abaraba   >>"I'll probably exit the discussio...   Oct 2 2008, 02:19 PM
- - Dunge   Ylisar much obliged, that was a perfect reply. Thi...   Oct 2 2008, 02:28 PM
- - abaraba   Dunge, >>"Sorry for my last post, but ...   Oct 2 2008, 02:41 PM
|- - Nigel @ NVIDIA   QUOTE (abaraba @ Oct 2 2008, 08:41 AM) TH...   Oct 2 2008, 02:45 PM
- - abaraba   Nigel @ NVIDIA, how wonderful! have you noti...   Oct 2 2008, 02:55 PM
|- - Nigel @ NVIDIA   QUOTE (abaraba @ Oct 2 2008, 08:55 AM) do...   Oct 2 2008, 07:43 PM
- - Ylisar   QUOTE (Dunge @ Oct 2 2008, 03:28 PM) Ylis...   Oct 2 2008, 03:11 PM
- - abaraba   Nigel @ NVIDIA, do you see now what am i talking ...   Oct 2 2008, 03:31 PM
- - Ylisar   Ye, I wouldn't mind if the things which doesn...   Oct 2 2008, 03:37 PM
- - chillypacman   This thread should have just died when the content...   Oct 2 2008, 03:41 PM
- - abaraba   Ylisar, you remember what i told you before? ...   Oct 2 2008, 03:56 PM
- - abaraba   Nigel @ NVIDIA, >"do you agree?" ...   Oct 3 2008, 01:55 AM
|- - Nigel @ NVIDIA   QUOTE (abaraba @ Oct 2 2008, 07:55 PM) th...   Oct 3 2008, 11:31 PM
- - makiolo   SMITH: Why Mr. Anderson?... Why?... Why do you do ...   Oct 3 2008, 09:07 AM
- - abaraba   makiolo, - hey, thats perfect! i wish i sta...   Oct 3 2008, 09:57 AM
- - abaraba   makiolo, ok, i really thought about it and even t...   Oct 3 2008, 12:41 PM
- - abaraba   >>"Nobody is obligated to endlessly deb...   Oct 4 2008, 05:00 AM
- - abaraba   jezham, >>"So thank you abaraba for br...   Oct 5 2008, 03:54 AM
- - abaraba   so, thank You jezham ! - you made the "f...   Oct 5 2008, 08:06 AM
- - jezham   QUOTE so.. to answer your question - of course...   Oct 5 2008, 05:40 PM
- - abaraba   >>"A smaller time step (0.01) certainly...   Oct 5 2008, 11:20 PM
- - jezham   Why you might want to behave a little (just a litt...   Oct 6 2008, 03:30 AM
- - abaraba   hi, yes, i agree ..there is plenty of stuff to di...   Oct 8 2008, 09:47 AM
- - abaraba   hey Dunge.. are you still there? do you remember...   Oct 11 2008, 07:48 AM
- - abaraba   let me just remind that this applies to *any* simu...   Oct 11 2008, 12:26 PM
- - abaraba   KEYWORDS: Constraint Algorithm, Iterative Solver, ...   Oct 13 2008, 10:40 AM
- - chillypacman   QUOTE - Wikipedia and every other info on the Inte...   Oct 13 2008, 11:53 AM
- - abaraba   >>"Can you prove Wikipedia is false or ...   Oct 13 2008, 01:11 PM
- - chillypacman   QUOTE in short - i proved it, what part of my proo...   Oct 13 2008, 01:50 PM
- - abaraba   - ok, that is an argument.. kind of ;-) yes, it ...   Oct 13 2008, 02:18 PM
- - Ylisar   QUOTE (abaraba @ Oct 13 2008, 03:18 PM) b...   Oct 13 2008, 10:15 PM
- - abaraba   Ylisar, >>"Yes you are. You don't ...   Oct 13 2008, 11:14 PM
- - abaraba   to whom it may concern... +++ i believe i found th...   Oct 15 2008, 06:13 AM
- - jezham   Hi again abaraba I have an issue with "accum...   Oct 15 2008, 08:00 PM
- - abaraba   >>"All was fine until I attempted to ma...   Oct 15 2008, 09:15 PM
- - jezham   Yes I was just explaining the reason for my slow ...   Oct 15 2008, 09:38 PM
- - abaraba   >>"I realize the algorithm wasn't t...   Oct 15 2008, 10:26 PM
- - jezham   Wasn't shouting, sorry for misunderstanding. ...   Oct 16 2008, 01:04 AM
- - abaraba   >>" Was just pointing out that when the...   Oct 16 2008, 02:19 AM
|- - Tomaz   QUOTE (abaraba @ Oct 16 2008, 04:19 AM) y...   Oct 16 2008, 08:42 AM
- - Dark Kilauea   I'm just going to make a note, as futile as it...   Oct 16 2008, 02:52 AM
- - jezham   Of course I am not surprised at slow down under lo...   Oct 16 2008, 03:42 AM
- - abaraba   jezham, >>"fixed time step of 0.01 and...   Oct 16 2008, 11:33 AM
- - Ylisar   To the people actually using this drivel I would j...   Oct 16 2008, 11:48 AM
- - abaraba   >>"To the people actually using this dr...   Oct 16 2008, 09:18 PM
- - Kevin Bjorke   Please keep it civil or I'm closing the thread...   Oct 16 2008, 09:46 PM
|- - Nigel @ NVIDIA   Yes, indeed. Do some deep breathing. Go outside a...   Oct 16 2008, 09:55 PM
- - abaraba   thank you Nigel, i see you understood how importa...   Oct 16 2008, 10:11 PM
- - Ylisar   Okay, I'll actually pick it to pieces and actu...   Oct 17 2008, 12:13 PM
- - abaraba   this is no physics forum Yilsar, good luck...   Oct 17 2008, 10:21 PM
|- - Quan   QUOTE (abaraba @ Oct 18 2008, 06:21 AM) t...   Oct 20 2008, 08:38 AM
- - abaraba   "NUMERICAL INTEGRATION": Interpolation, ...   Oct 21 2008, 01:09 AM
- - abaraba   The Ultimate Question of Life, Universe and Everyt...   Oct 21 2008, 01:48 AM
- - abaraba   ..i had a plan to chew this bubblegum and kick som...   Oct 27 2008, 08:28 PM
- - abaraba   --- ALWAYS REMEMBER --- - "All it will take...   Oct 28 2008, 10:44 PM
- - Ylisar   http://en.wikipedia.org/wiki/Delusional_disorder   Oct 29 2008, 04:56 PM
- - abaraba   Ylisar you are still here and still making a foo...   Oct 29 2008, 11:30 PM
- - jezham   What on Earth happened here lol. Anyway, in an at...   Oct 31 2008, 11:12 PM
- - abaraba   sorry for the absence, i was busy competing with G...   Dec 28 2008, 05:28 AM
- - abaraba   Jezuhem, >>"Simple solution was to on...   Dec 29 2008, 01:20 AM
- - jezham   tbh abaraba, I had a bug with polling the game con...   Jan 1 2009, 06:10 PM
- - abaraba   it is interesting i could not find many particle-p...   Jan 8 2009, 02:32 AM


Reply to this topicStart new topic
7 User(s) are reading this topic (7 Guests and 0 Anonymous Users)
0 Members:

 



RSS Copyright © 2008 NVIDIA® Corporation.  Terms of Use | Legal Info | Privacy Policy Time is now: 9th February 2010 - 07:37 PM