FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.73k stars 403 forks source link

More accurate yellow crush depth warnings on map connections #13993

Closed SomeRandomNoobKekeke closed 4 months ago

SomeRandomNoobKekeke commented 4 months ago

Previous logic:

if subCrushDepth < Level.Top then it's Red
if subCrushDepth < Level.Bottom then it's Yellow
if subCrushDepth > Level.Bottom then it's fine

Even if crush depth is 1m below Level.Top warning will be Yellow But, outposts aren't on Level.Top, they are somewhere in the level If start is below crush depth you will just implode If end is below crush depth then you won't be able to dock and will have to swim back

So i suggest marking connections with Red warning if start or end outposts are below crush depth

Notes

This estimate is accurate up to 20m. I suspect that something somewhere is rounded to Level.GridCellSize

Warning text is also a bit confusing It says "route starts at", so i would expect starting outpost to be at that depth, but in fact it's LevelData.InitialDepth I can make it show outpost depth, but it will be a bit inconsistent What if you are far away from that route? Which outpost depth should i show? Random? Leftmost? It might get flipped once you get there

20240524090842_1

SomeRandomNoobKekeke commented 4 months ago

v1.5.0.0 (today's unstable)

I guess this PR is outdated then barodev