question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What would be the right settings to run at 30FPS?

See original GitHub issue

Hi all!

I started to develop a small game with CannonJS. The game has to work on the server side (NodeJS) and Cannon is light enough for that purpose. The physics engine should run at 30FPS.

I noticed that CannonJS had not been maintained for a few years, so i decided today to migrate to Cannon-es because the project is more alive. I had to adapt my code to use the ES6 module with NodeJS. However, i have the same problems i had with CannonJS.

My decor is made with boxes and ramps (a custom shape). My charactere is made with a set of a wheel,a cylinder and a HingeConstraint.

My problem is that my character remains blocked/stuck in my decor especially during a jump. I will tend to think that this is due to a bad setting for 30FPS but i don’t enough know the physic engine to know which parameters to adapt (there are so many!). I took the parameters that i found as an example for CannonJS (i tried to change some parameters but without success). Maybe it’s due to a limitation of the physic engine?

 var world = new CANNON.World();
    world.quatNormalizeSkip = 0;
    world.quatNormalizeFast = false;
    world.defaultContactMaterial.contactEquationStiffness = 1e9;
    world.defaultContactMaterial.contactEquationRelaxation = 4;
    var solver = new CANNON.GSSolver();
    solver.iterations = 7;
    solver.tolerance =0.1;
    world.solver = new CANNON.SplitSolver(solver);
    world.gravity.set(0,-40,0); 
    world.broadphase = new CANNON.NaiveBroadphase();
    world.broadphase.useBoundingBoxes = true;
    var fixedTimeStep = 1.0 / 30.0; // seconds
    var maxSubSteps = 3;

A screenshot of the problem: Capture d’écran_2020-07-01_19-07-36

What would be the right settings to run at 30FPS?

I created a small online demonstration to show the problem: https://littleworldofsatoshi.com/testRamp

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anemolcommented, Jul 3, 2020

Thanks for your help.

0reactions
marcofugarocommented, Jul 3, 2020

In your specific case, you just have to make the ball bigger. This helps not falling through the ground. You can visualize the babylon mesh smaller if you want, and achieve the same result.

https://i.imgur.com/NkjoYNh.mp4

It’s not a specific science, you just have to play around with it man.

I’d suggest you using stack overflow next time, there are more people that can help you there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frames Per Second: which is right for your stream?
At that bitrate and upload speed, you'd be best to use 30 fps to get a nice, clean, and stable video. You could...
Read more >
How To Properly Lock PC Frame Rate to 30 FPS to Prevent ...
The ultimate trick then to achieve perfect performance at 30 FPS is to limit both your frame rate cap and the refresh rate,...
Read more >
How to properly set 30FPS in PC games : r/pcgaming - Reddit
Setting the refresh rate in game to 30hz is always the best option because it accounts for the display timing. What you can...
Read more >
One Trick to BETTER B-Roll - Using 30fps? - YouTube
B-Roll can make or break your video. With this one, simple trick, you can add a new tool to the belt. Shooting in...
Read more >
24, 30 or 60 FPS? What's the Best FRAME RATE For VIDEO?
How to Use Shutter Speed, Aperture and ISO For Video ... Why this may be the best setting ever! ... Should You Shoot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found