Hello! So, sparing long stories and non-sequiturs, I've come across an issue that I can't quite seem to fix. Upon entering a scene/map that my engine renders over or around 1000 FPS my player character moves extremely choppy, as do all other actors present. This changes slightly if I play around with stepSimulation values - choppy, extremely slow but constant movement, weird angular values - and setting them to higher values simply just lowers the FPS to the point where it acts as expected which is also undesirable. My main loop is set up ala Gaffers timestep/what was boilerplated on the wiki.
Code: Select all
get current time
pass delta time to stepSimulation
scene events(things like running timers/callbacks, locking rigid bodies to mesh bones etc.)
dt-game tick (set to 8)
scene update (movement, ai decisions, setting states/animations)
I'm using Lua for my actors and have made a bit of the Bullet functions available to it via LuaBridge, so I'm calling the relevant functions directly. As for how I'm doing movement, every actor has an assigned rigid body; some have additional rigid bodies for things like hitboxes etc. I use setLinearVelocity for whichever actor is moving, and have it set immediately to the actors maximum movement speed for now. I've read setLinearVelocity begins to function oddly at higher/lower frame rates; swapping to applyImpulse and applyForce both did not achieve the desired movement effect and also had the same problems at higher frame rates. I'm kind of at a loss - the only thing I can think of is the collision callback is clearing forces quicker than they can be reapplied but with the mediawiki down I've been having trouble verifying if that was mentioned on the old articles, or if that's indeed what occurs (and as such if there's a better callback setup than what was given on the wiki.) Thanks so much!
EDIT: Forgot to mention I'm using the 2.87 release of Bullet!