Download

Character jumps higher at 144 fps than at 60 fps- 2d side scroller

Hi there! I am a beginner developer using UE4 4.24.3 version. My 2d side scroller character behaves very weird ( I think it has something to do with frame independence). As fps improve my character jumps higher and higher. This would be an unfair advantage for those playing at 144fps. I’ve tried tweaking some sliders and boxes in the character blueprint but with no success. Same thing happens to my physics. When I play the game at 144 fps every physics actor is ‘heavier’ but when I cap it at 60 fps everything starts jumping around with the slightest touch. Is there anything I can do about it? Or perhaps I should cap the game at 60 fps?

Edit: I forgot to mention that my 2d side scroller character has jump max hold time enabled at 0.2 s

From what you’ve said, I’m assuming you’re moving your character using something on tick?

If you’re adding constant values to the location ( or rotation ) of your character like that, the speed of the movement will vary depending on frame rate ( ie hardware ).

If you want a constant movement speed independent of hardware, you need to multply your changes in location/rotation by ‘get world delta seconds’. Also once you factor that in, you will need to multiply by some constant to get the speed correct again, you just pick this number by eye.

Basically ‘get world delta seconds’ is the amount of time it took to render the last frame. It’s the delta that comes out of the EventTick event, that’s why it’s there, because it will be commonly used here.

You can sit and meditate deeply on it, as the frame takes longer to draw, because you’re multplying by delta, you character will move further, so people with slower hardware get the advantage they need. The same is true, in reverse, for faster frame rates.

Thank you for your reply!

My only problem is that I am using jump and stop jumping actions. How can I edit those? Is it another way of doing it (maybe some kind of velocity, add impulse…)?

And how about the physics? Everything seems lighter at low fps. How do I fix that?

See these posts about character and projectile movement:

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/57533-everything-is-tied-to-framerate-i-guess

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/3955-projectilemovement-physics-are-framerate-dependent

They were from quite a long time ago, maybe there’s an alternative now.

But they’re saying, if something is framerate dependent, you have to write it yourself and either use delta ( if it’s tick ), or change something in physics depending on delta.

I’d say if there is a recent fix, it probably is the second…

Thanks! I will definitely check them out and keep you updated!

Ok :slight_smile: - I think it’s only really crucial if it’s going to be multiplayer.

No, the game is gonna be a singleplayer story mode 2d side scroller. It’s more like a piece of art than a game I would say ( the soundtrack is also composed and played by me), like a story. However, if you would play it at 60 fps you couldn’t really jump on all the platforms and places a 144 fps player could. That’s the main issue!