space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.71k stars 3.4k forks source link

Scram implant transform code needs rewriting #25031

Open metalgearsloth opened 9 months ago

metalgearsloth commented 9 months ago
  1. Bandaiding a position check with spamming attempts is not good as it's just going to be needlessly expensive and have a high chance of failure for no reason. It's just tries20 relying on RNG.
  2. Additionally spamming TryFindGridAt is also going to be expensive.
  3. https://github.com/space-wizards/space-station-14/pull/25030 was added but that's just trying to mask another problem (and also every single other content call to setworldposition would also need bandaiding).

The easy solution is querying grids in range then picking a random tile and BFS from there.

  1. I am going to fix separately.
Ilya246 commented 9 months ago

it's copied and modified anomaly spawn code so you might want to look at that too, it's also supposed to be able to teleport you into space off shuttles

koteq commented 9 months ago

and also every single other content call to setworldposition would also need bandaiding

Take a look at all the AttachToGridOrMap calls. Does it rings any bandaidish bells? Smells kinda fishy that it often goes together with SetPosition that should be capable of addressing parenting issues on its own.

PS: I like your desire to fix issues at their roots, but not allowing bandaid solutions or even reverting one is kinda meh. From the look of it, you (the maintainers) aren't capable of fixing all the issues the right way timely, making bandaids a necessary tradeoff until the fix is here.