SpiderPig Posted March 23, 2019 Share Posted March 23, 2019 Is there a minimum FPS a game should run at to have smooth physics? Mine is hitting 40 to 50 FPS at the moment and physics is very jumpy. It is even worse in debug mode when fps gets as low as 10. It's not just lag between frames - physics actually goes haywire. I'm wondering if it is a result of low FPS or somthing else in my code. Quote Link to comment Share on other sites More sharing options...
Thirsty Panther Posted March 23, 2019 Share Posted March 23, 2019 Check this post from Josh for common bottlenecks. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted March 23, 2019 Share Posted March 23, 2019 Without really knowing what you are doing, I am guessing that your physics shapes are probably very high-polygon. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted March 24, 2019 Author Share Posted March 24, 2019 After a bit of testing I think the low FPS is due to multiple things. 1 to 2 million triangles and up to 300 - 400 batches. There is also an algorithm that runs every so often and can eat up to 10ms which drops the frame rate quickly (I think this sudden drop is causing the jerking movements). The physics shape I'm using is 360 polys - too much? #canwaitforturbo Quote Link to comment Share on other sites More sharing options...
Josh Posted March 24, 2019 Share Posted March 24, 2019 360 polys for a physics shape if it is all in one place (not a big building or something) is probably going to slow you down. The number of batches is probably the bottleneck here. New engine is very very good at handling those. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted March 24, 2019 Author Share Posted March 24, 2019 I'll reduce the poly count and see how that helps then. Quote The number of batches is probably the bottleneck here. Is a batch a group of entities that fall within the frustum? Quote New engine is very very good at handling those. You tease me - I'm thinking about moving over to Turbo now but am worried there might not be enough features yet to make the transition seamless. Like I know there is no 2D drawing yet... and some commands are missing... Quote Link to comment Share on other sites More sharing options...
Josh Posted March 24, 2019 Share Posted March 24, 2019 A batch is a group of instanced models that are visible to the camera. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted March 24, 2019 Author Share Posted March 24, 2019 I solved the jittering of the physics object, it was simple. I was setting the cameras pivot to the heads position each frame instead of parenting it to the head bone (doing that caused the camera to rotate with the bone - which was kinda what I wanted except the bone had weird rotations on top of how it was animated) auto _headPos = frameManager->GetBonePosition(bones.head, true); cameraPivot->SetPosition(_headPos, true); So I just parented the camera's pivot the player entity instead. Problem-o solved. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.