RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
991 stars 175 forks source link

Fixed huge FPS drop when nodes move far away from vehicle #3069

Closed ohlidalp closed 9 months ago

ohlidalp commented 12 months ago

Fixed #3058 - caused by 539a1b24f50bad880611f245c76b634dbde1ad84

Solution: instead of considering the whole bounding box when evaluating eventboxes, only consider a bounding box around collision cab nodes. It makes more sense physically and also eliminates surprises, as loose cab nodes would be easily visible.

ohlidalp commented 12 months ago

Converting to draft because more issues got reported on Discord: https://discord.com/channels/136544456244461568/189904947649708032/1127748999286362132

I tackled the right problem - overstretched bounding box. I just need to go even smarter about it. I already did an experiment once to detect any detached parts: https://github.com/RigsOfRods/rigs-of-rods/commit/ead8411f88b60dd650a63cf1fdb2e1ff5c088964

CuriousMike56 commented 10 months ago

Good news: the main problem is fixed: RoR_2023-09-03_16-37-27 Bad news: I discovered another scenario. Simply driving far enough away will eventually cause the same issue: image Resetting to spawn doesn't stop it. Easier to reproduce on other terrains such as the Community Map. Oddly enough I haven't been able to reproduce using a plane: image

ohlidalp commented 10 months ago

Oops, I forgot to reset the new cabnode-boundingbox so it grew indefinitely. Fixed.

The plane probably doesn't have any collision cabs on it so it's completely excluded from the eventbox triggering.