citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.41k stars 2.01k forks source link

[BUG] vehicle tornado problem #2559

Open BugCode1 opened 1 month ago

BugCode1 commented 1 month ago

What happened?

Sometimes, for various reasons, the entities attached to a ped come out of no-collision mode. When the player gets into a vehicle, due to the collisions between these entities, the car can behave erratically and collide with the ground and air like a tornado.

Additionally, if an entity with collision is attached to you, you can move vehicles like a deflated ball.

Expected result

It is a good idea to ensure that the collision of all entities attached to a ped is removed when entering vehicles, or that there is no collision at all between the entities attached to the ped and the vehicles, to prevent issues like this from occurring.

Reproduction steps

  1. attach a entity with collision to your self
  2. https://github.com/citizenfx/fivem/assets/26005436/f87d9486-6f38-4c4a-9967-3f3840aaa08a

Importancy

There's a workaround

Area(s)

FiveM

Specific version(s)

All Versions

Additional information

No response

AvarianKnight commented 1 month ago

Hmm, we used to have this issue all the time but fixed it by disabling collisions on all spawned objects.

This also isn't a FiveM Bug (nor a bug in general).

BugCode1 commented 1 month ago

Yes, in fact, this alone is not considered a bug.

However, when you attach an entity without collision to a ped, due to some unknown events over time, this entity regains collision. Additionally, some cheaters create this problem by attaching a small object with collision inside their own body.

Actually, I think the presence of collision between the entities attached to a ped and a vehicle is completely redundant and it is better to remove it from the FiveM side.

CeebDev commented 1 month ago

The "tornado" was something iirc when you attach a entity and switch routing bucket

BugCode1 commented 1 month ago

This could be one of the possible scenarios, but it is not the only one. There are other possibilities as well.

Considering that I have seen this problem in servers that have not used Routing Bucket also we have had this problem since the early days of FiveM (before the existence of Routing Bucket).

One of the cases that creates this problem with a very rare chance (due to bad network or desync servers with +128 players) is teleporting, which suddenly restores all collisions of the attached objects.

jellyton255 commented 1 month ago

Interestingly, this issue has become significantly more frequent recently for seemingly no reason, just a month ago this issue was very rare and now it's a daily occurrence, we haven't added anything recently that would be attaching more objects to players either.

tens0rfl0w commented 1 month ago

This 'bug' exists for multiple years now -> https://forum.cfx.re/t/1636310

There are two different problems here:

(The same happens if the routing bucket of the target player is switched, as this also invokes ClearClientFromWorldGrid)

Flushing CPhysicalAttachNodeData when an entity is migrating is maybe an option here as this can only happen if the parent-entity doesn't exist anymore.

Randolio commented 1 month ago

Had this happen to a player who was idle, switched on his engine and then starting spinning https://medal.tv/games/gta-v/clips/i0gjaScWwZgeC6ap_/d1337IzrZ5CR?invite=cr-MSxIaUMsNjYzNDYyNjIs