occasional jitter of dynamic object

Post Reply
zyzyandzyzy
Posts: 9
Joined: Mon Aug 27, 2012 8:10 am

occasional jitter of dynamic object

Post by zyzyandzyzy »

Hello all,

I'm making a quite standard racing game, and I'm facing this jitter problem I don't really know why, thun I cannot fix it.
The game runs quite well in most time, however occasionally the racing objects have small jitter through the game.

By "occasional", I mean it seems depends on the startup, after I start the game, if everything runs smooth, then it will be good all the time, but if it's jittering, then no matter what I do (e.g. delete the rigid object and create it again), the problem remains.

Can anyone help on this?

Thanks,
-Yi
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: occasional jitter of dynamic object

Post by MaxDZ8 »

I am investigating a similar problem right now. My current speculation is the ground they slide on might have small imperfections, thus causing them to hang on those. I'll hopefully be able to fix this in a couple of days, maybe the solution will give you some ideas.

Do you have this issue when on ground or also when flying?
zyzyandzyzy
Posts: 9
Joined: Mon Aug 27, 2012 8:10 am

Re: occasional jitter of dynamic object

Post by zyzyandzyzy »

MaxDZ8 wrote:I am investigating a similar problem right now. My current speculation is the ground they slide on might have small imperfections, thus causing them to hang on those. I'll hopefully be able to fix this in a couple of days, maybe the solution will give you some ideas.

Do you have this issue when on ground or also when flying?
No I don't think my problem roots from ground. Actually I don't even have a ground at all.
I disable the velocity factor on y axis. And I disable the angular factor on x and z axis.

Any other thoughts?
zyzyandzyzy
Posts: 9
Joined: Mon Aug 27, 2012 8:10 am

Re: occasional jitter of dynamic object

Post by zyzyandzyzy »

No one?
Please, I'm dying here :cry:
zarlox
Posts: 31
Joined: Tue Apr 26, 2011 5:52 pm

Re: occasional jitter of dynamic object

Post by zarlox »

I have a similar problem on my raycast vehicle test. The chassis is floating in the air but jitter sometimes (little hickups) while the rest of the scene is smooth.

I do not know what causes it. I wonder if it could be caused by single-precision usage. Maybe testing with double precision might be worth it.
zyzyandzyzy
Posts: 9
Joined: Mon Aug 27, 2012 8:10 am

Re: occasional jitter of dynamic object

Post by zyzyandzyzy »

zarlox wrote:I have a similar problem on my raycast vehicle test. The chassis is floating in the air but jitter sometimes (little hickups) while the rest of the scene is smooth.

I do not know what causes it. I wonder if it could be caused by single-precision usage. Maybe testing with double precision might be worth it.
I tried double precision, doesn't work out :(
zarlox
Posts: 31
Joined: Tue Apr 26, 2011 5:52 pm

Re: occasional jitter of dynamic object

Post by zarlox »

Just by curiosity,

What is your simulation step rate and substep settings?
Where do you update the jittering body? Pre-Tick, Post-Tick, UpdateAction()?
zyzyandzyzy
Posts: 9
Joined: Mon Aug 27, 2012 8:10 am

Re: occasional jitter of dynamic object

Post by zyzyandzyzy »

zarlox wrote:Just by curiosity,

What is your simulation step rate and substep settings?
Where do you update the jittering body? Pre-Tick, Post-Tick, UpdateAction()?
1. My simulation step rate is around 30 fps, my game is on ios and that's the best I can do. My substep setting is fixed rating at 60fps, and max sub step is 1.
2. When do I update the jitter body? I use impulse to make my object move. And I use OgreBullet as the bridge between bullet and ogre, which I believe use straight Motion to get transform from bullet.

Any idea where can causes the jitter?

Thanks,
-zy
zyzyandzyzy
Posts: 9
Joined: Mon Aug 27, 2012 8:10 am

Re: occasional jitter of dynamic object

Post by zyzyandzyzy »

zyzyandzyzy wrote:Hello all,

I'm making a quite standard racing game, and I'm facing this jitter problem I don't really know why, thun I cannot fix it.
The game runs quite well in most time, however occasionally the racing objects have small jitter through the game.

By "occasional", I mean it seems depends on the startup, after I start the game, if everything runs smooth, then it will be good all the time, but if it's jittering, then no matter what I do (e.g. delete the rigid object and create it again), the problem remains.

Can anyone help on this?

Thanks,
-Yi
OK, I may have found a solution, I move the stepSimulation of bullet to frameEnded event, and put all logical update to frameStarted event, that looks promising up to now. I will keep updating if I find jitter comes back.
zarlox
Posts: 31
Joined: Tue Apr 26, 2011 5:52 pm

Re: occasional jitter of dynamic object

Post by zarlox »

Good point.

I am also using Ogre for the rendering but i do my updates and call StepSimulation() in the FrameRenderingQueued() so right after the previous frame data is sent to the GPU.

However, you say that StepSimulation is in FrameEnded() while you updates your objects and apply forces in frameStarted? That would mean you do not use the stepSimulation() constant step update rate? I think you should try to keep the forces update in the simulation tick callback as much as possible.

I'll try calling my stepSimulation in frameEnded() to see if it reduce the jitter for me too.

Thanks
zyzyandzyzy
Posts: 9
Joined: Mon Aug 27, 2012 8:10 am

Re: occasional jitter of dynamic object

Post by zyzyandzyzy »

zarlox wrote:Good point.

I am also using Ogre for the rendering but i do my updates and call StepSimulation() in the FrameRenderingQueued() so right after the previous frame data is sent to the GPU.

However, you say that StepSimulation is in FrameEnded() while you updates your objects and apply forces in frameStarted? That would mean you do not use the stepSimulation() constant step update rate? I think you should try to keep the forces update in the simulation tick callback as much as possible.

I'll try calling my stepSimulation in frameEnded() to see if it reduce the jitter for me too.

Thanks
Finally, I think I know the reason of jitter, Ogre uses a set to store all the frame listeners, which means the calling order is not static. That explains why the jitter depends on the startup, I have created my own frame listener manager to control the calling order myself, that should resolve everything.
Thank you, all.
Post Reply