manuel.gysin Posted April 3, 2013 Share Posted April 3, 2013 Hello I have the following problem and currently missing any idea how to solve it: If the player has >=30 FPS actor velocity is right and the player moves with the right speed. If the player has <30 FPS actor velocity is slower (this scales 1:1 with FPS, less FPS, less velocity) The player is an logical character class with actor and skinner for animation handling. I think it is related with the animation speed dropping when FPS are below 30. Did someone experience the same? What are possible solutions? Thanks and Greets Manuel Link to comment
brian.firfer Posted April 4, 2013 Share Posted April 4, 2013 engine.app.getIFps() engine.game.getIFps() engine.physics.getIFps() These values can be used to scale things depending on which function you are in render/update/flush. That said, one would think that the default player movement would be kept in synch with physics fps and not effected by lagged rendering? Anyone know if the code for the default keyhander is available? I had to override and artificially stop default functionality when it was doing things different then we wanted. Link to comment
manuel.gysin Posted April 4, 2013 Author Share Posted April 4, 2013 Hi I'm aware of the *getIFps but how I want to use them to adjust the velocity? Scaling the velocity by IFps sounds horrible. Greets Manuel Link to comment
manuel.gysin Posted April 4, 2013 Author Share Posted April 4, 2013 After trying around 4 hours: Player::setVelocityvoid setVelocity(vec3 velocity) DescriptionSets a player's velocity. The default is vec3(0,0,0). Notice In case of PlayerActor, this function is valid only when the player is not simulated physically (setPhysical() is set to 0). If it is, moving PlayerActor is done via accessing its body. The PlayerActor has setPhysical to 1. So I can't set this value. (That's good so far) "If it is, moving PlayerActor is done via accessing its body." What does this exactly means? In the code I did a: engine.game.setIFps ( 1.0 / 30.0f ); Our animations are based on this scale. Actor are configured with these values: actor.setMaxVelocity(4.5); actor.setMinVelocity(0.5); IFps are affecting the following things in the character update code: // This is not relevant actor.setCollisionHeight(Math::linearTransformationNumber(actor.getCollisionHeight(),height_crouch,velocity_crouch * _ifps)); actor.setCollisionHeight(Math::linearTransformationNumber(actor.getCollisionHeight(),height_idle,velocity_crouch * _ifps)); // This seems relevant skinner_mesh.update(_ifps); IFPS are read with: localPlayer.updateLocal ( engine.app.getIFps() ); What I observed: Client 1: 20 FPS, very slow in movement Client 2: 30 FPS, middle movement Client 3: 50 FPS, faster then client 2 Client 4: 100 FPS, run as fast as the light! Client 5: 10 FPS, horribly slow movement How this can be? The values even drop under minVelocity. IFPS outputs: GAME 0.0200407 APP 0.0333333 PHYS 0.0166667 There is no difference between using game.getIFps, app.getIFps and physics.getIFps. Low frames = slow velocity of actor, High frames = fast velocity. With the old character system (XML-Animation tree) I could not reproduce this problem. I think it has to be related with the Skinner/Schemer system. Link to comment
pascal.winistoerfer Posted April 22, 2013 Share Posted April 22, 2013 Manguste, can you look into this? Would be great if we find a solution for this. Have a nice day Link to comment
frustum Posted June 24, 2013 Share Posted June 24, 2013 Please try to increase the physics simulation budget. engine.physics.setBudget(1.0f / 10.0f); Link to comment
manuel.gysin Posted July 17, 2013 Author Share Posted July 17, 2013 Please try to increase the physics simulation budget. engine.physics.setBudget(1.0f / 10.0f); Hello Frustum I've adjusted physics simulation budget without any changes in the behavior of slow movement, I tried too some extreme values but without an effect. Any more ideas to hunt this bug down? It's very annoying. Greets Manuel Link to comment
Recommended Posts