Skip to content
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 can not set delta #90998

Open
yythlj opened this issue Apr 22, 2024 · 5 comments
Open

move_and_slide can not set delta #90998

yythlj opened this issue Apr 22, 2024 · 5 comments

Comments

@yythlj
Copy link

yythlj commented Apr 22, 2024

Tested versions

godot 4.2

System information

win10 fps30,physics pre frame 30.

Issue description

1.move_and_slide can not set delta.so how a server mode program to move for special delta.the move and colide has some bug on 3d(like not set is_on_floor, slide not stop, and so more).
2.when charcaterbody3d near the wall.move and slide slow the fps very much.(30->1).and it preform 30fps if not near wall

as server mode.the best way is,in a timer to delta call process and physicsprocess.
different world3d may use different starttime to avoid same time busy.
but some function like move_and_slide.animation tree.trainsition request and so on, use the next process or the next engine delta.it is uncontrolable

Steps to reproduce

move_and_slide can not set delta.so how a server mode program to move for special delta.the move and colide has some bug on 3d.

Minimal reproduction project (MRP)

move_and_slide can not set delta.so how a server mode program to move for special delta.the move and colide has some bug on 3d.

@yythlj

This comment was marked as duplicate.

@AThousandShips
Copy link
Member

The delta is provided by the engine, you can't modify it yourself, you shouldn't call the process functions yourself, this isn't supported

@KoBeWi
Copy link
Member

KoBeWi commented Apr 22, 2024

See #84665

@yythlj
Copy link
Author

yythlj commented Apr 23, 2024

@KoBeWi

Another serious issue mentioned above is that I used 30 windows, each independently calculating its own world3d.And run on the headless mode. Each window contains only a simple scene (using simple shapes like CSGbox, with no more than 10 boxes combined), and 4 boxes are used as boundaries to prevent falling. Each scene has 6 characterbody objects (with simple capsuleshape).
image

image

image

In each frame, 6 players are moving. When there is no collision with the walls, the frame rate stays stable at 30fps and the players move steadily forward. However, when they reach a wall corner (between the two intersecting walls), the fps drops to single digits, such as 3, 2, or even lower than 1. If I remove the move_and_slide function calls and directly use setposition, the fps returns to normal.

I think it would be necessary to provide a new move_and_slide function that allows setting delta and different movement modes (such as using raycasts to check a few points for collision detection). This would be beneficial for servers running in headless mode where higher performance is required.

Another idea that comes to mind is why doesn't Godot provide a method similar to pre-baking (e.g., navigation baking) where collision information for each position in the scene is pre-calculated? This way, before using move_and_slide, one could directly obtain the information to eliminate the vector direction causing the collision, thereby improving efficiency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@KoBeWi @yythlj @AThousandShips and others