godot icon indicating copy to clipboard operation
godot copied to clipboard

move_and_slide can not set delta

Open yythlj opened this issue 1 year ago • 4 comments

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 avatar Apr 22 '24 04:04 yythlj

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

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 avatar Apr 22 '24 07:04 yythlj

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

AThousandShips avatar Apr 22 '24 08:04 AThousandShips

See #84665

KoBeWi avatar Apr 22 '24 08:04 KoBeWi

@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.

yythlj avatar Apr 23 '24 09:04 yythlj