-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move_and_slide()
should not implement delta on its own
#1192
Comments
@Shadowblitz16 Thank you for the suggestion. The
I'm not sure what you mean, but
Dividing the velocity by Finally, there is a lot of work planned for updating the physics interface in Godot 4, including changing |
@madmiraal you are misunderstanding this. He's suggesting that |
@madmiraal jonbonazza is correct. |
@madmiraal please reopen this. |
@Calinou can you or one of the godot devs reopen this? |
@Calinou Thankyou very much ♡ |
On a related note: it seems odd that |
I would prefer not as it allows more control over our own game's physics |
move_and_slide()
should not implement delta on its own
@Sslaxx This will be harmonized in Godot 4, delta will (probably) be applied on both methods. @Shadowblitz16 Could you please describe in detail why you need to set a custom delta? I understand those who wants to not pass a delta, but not to set a custom value instead. I'm curious on that. As it was said, |
@fabriceci delta is unpredictable and when trying to emulate a existing game's physics (for example nes games) you don't want to have that stuff. I would be fine if delta was scaled so that movement was the same speed with or without it, but its not. delta when applied slows the movement down because its multiplied by far less then 1.0 |
@Shadowblitz16 Are you calling At the moment there are two possibilities: The best way to achieve constant speed in physics is to use the second approach, physics calls in The only case I see where you would need a custom delta is if you want to call |
Not sure but the effect needs to seem frame rate dependent, even if its not. (aka same speed) I just know when following this.. using move_and_slide vs manually incrementing position makes things move at extremely different speeds. |
I'm not sure if you mean that it should be frame rate dependent or not, it's an important detail. |
@pouleyKetchoupp no I don't have that project anymore.
This is what I did, and I couldn't get it to work, mainly because godot has no way to do collision checking without physics or delta time. |
@Shadowblitz16 I'd like to help find a solution to your problem, but you need to do your part as well to provide clear information. I'm not going to do the research for you or add a feature without confirming it's useful first. What we need from you is: Then we will be able to answer these questions before we implement the new feature:
You state in your proposal that you tried and had some issues with the character flying off screen, but there's no way to check if there's a simple bug to fix in the script in order to achieve what you're intending.
Unless what you want is physics motion dependent on the framerate (which would cause heavy jittering when the framerate is not constant) I'm not sure what you're asking for is the right solution to your problem at this point, but that still needs to be confirmed. |
@pouleyKetchoupp I don't have the project anymore and I don't have time to recreate it right now. |
@Shadowblitz16 I'm not sure to understand what you mean. Would you like delta time to be 1 when running at 60 FPS? Delta time is the time spent in seconds since the last tick, it's not a scale. In practice, what happens is simple: Now if you want to try and implement framerate-dependent velocity, you can do a simple test by calling
This will cancel out the application of I'm going to close this ticket again for now, but feel free to comment with an example project if you have time to get back to this project in the future and we'll re-open the discussion. |
@pouleyKetchoupp @Calinou |
Please continue the discussion in #2821 (which is what's needed for rollback). |
I posted #2821 and agree it's related but I think this issue should be reopened as a separate proposal Here is an example use-case unrelated to #2821 that illustrates the problem of naively applying a single physics/render frame delta as the current
Ideally I think Edit: found related articles: |
I suggest opening a new proposal, since this proposal was rejected in its current form (it was about removing automatic delta behavior entirely from |
Describe the project you are working on:
Zelda 2 recreation game
Describe the problem or limitation you are having in your project:
I have documentation on zelda2 physics based in the NES's original 60 fps.
the move_and_slide function of KinematicBody2D implements delta time on its own making the values I use far too slow.
I tried dividing by delta before passing but that doesn't work either and makes my player fly off screen
I also tried doing move_and_collide but due to the zelda2 physics of applying gravity every frame regardless if I am on the ground or not makes the player unable to move on the x axis
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
just remove the delta time implementation and have us multiply it ourselves
this makes code not only clearer but make it much more flexible for different types of games
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
just remove the delta time multiplication from the move_and_slide function
If this enhancement will not be used often, can it be worked around with a few lines of script?:
it would certainly be used by me and any other person trying to recreate a beloved game
Is there a reason why this should be core and not an add-on in the asset library?:
its already in it just needs to be separated
The text was updated successfully, but these errors were encountered: