supertuxkart / stk-code

The code base of supertuxkart
Other
4.36k stars 1.03k forks source link

Physics engine really struggles with some types of collisions #5034

Open kimden opened 2 months ago

kimden commented 2 months ago

Description

Some collisions with or without movable objects, such as those described below, trigger big processing time in the physics part (and as a result - impossibility to play in some cases like (1)).

Profiler usually shows that either Physics or World::Update (physics) take huge time, and in some case Rewind takes much time (but that's probably just a consequence of fps being too small). Screenshot from 2024-03-17 17-00-45

Full profiler behaviour video is accessible here (warning: youtube + voices + not all the video might be useful)

Steps to reproduce 1

  1. Pick addon_blackhill-mansion
  2. Right after the starting line, one player should find Tux on the left side and the pumpkin to the right of him, and navigate the kart between them
  3. No matter where the other karts are located, all of them will get fps dropped to seconds per frame instead

Steps to reproduce 2

  1. Pick addon_subsea
  2. Go to the left path, there are cylindrical things ni the underwater terrain part
  3. Push one or more cylinders into the southwestern part of the track (where there's a hole), using zippers
  4. Try to drop cylinders into the hole so that they get stuck with a yellow object with hands there. If it failed, repeat 2-4 with another cylinder.
  5. Observe very strange collisions and big fps drop

Configuration

STK release version: latest git 1a8dbbd

STK Source (PPA, distribution package, official binary, etc.): github

Additional information

stdout.log contains many lines of type

Rewind [warn   ] RewindManager: Missing local state at ticks 103215640564654640454350

which is logical because of too small fps. I don't see other warns or errors. If a log is really needed, I can reproduce without any problems. (Same goes for profiler report, I can make a new one, just the one I have is a bit messy because it contains several games I suppose)