space-station-14 icon indicating copy to clipboard operation
space-station-14 copied to clipboard

Fluid spread refactor

Open Ygg01 opened this issue 2 years ago • 2 comments

The Great Puddle Refactor

Oh boy. It's a big one.

What I did:

  • Fix #9942 by using a different spread of a pattern only 4 cardinal vs 8 (cardinal + diagonal)
  • Replace usage of some Obsolete calls
  • Change way fluid spread works
  • Removed data from FluidSpreaderComps and put tied them to the map
  • Added FluidDebugOverlay

Screenshots Content Client_gzx5zi2g8x

Changelog :cl:

  • fix: Fluids no longer leak through micropores in concrete
  • fix: Fluids now spill slowly, rather than quantum tunneling to optimal size

Ygg01 avatar Oct 14 '22 00:10 Ygg01

Just curious, how come the fluids spread out so slowly now? Ideaguying here but what if there's a lot of liquid, it would travel pretty quickly right? Like maybe it could scale based on how much liquid there is in the puddle? (higher number, faster spread)

HoofedEar avatar Oct 14 '22 04:10 HoofedEar

Just curious, how come the fluids spread out so slowly now? Ideaguying here but what if there's a lot of liquid, it would travel pretty quickly right?

Spread can be tweaked on the system level (make all fluids spread a bit slower/faster), but changing spread based on the previous volume is getting deep in the weeds IMO.

Weeds here stand for https://mikeash.com/pyblog/fluid-simulation-for-dummies.html. Basically store oldVolume and velocity (see it in action here). Just keep in mind we'd need to modify that algo to account for our representation not being sparse and solid objects in "fluid".

Ygg01 avatar Oct 14 '22 07:10 Ygg01

After trying the puddle overlay for myself - I love it! It's going to make a lot of things much easier to debug. Great work!

I replicated the setup from #9942 below, but it doesn't seem like the spread-around-corners bug has been fixed? I don't know if the below is intended.

Edit: Yep nevermind lmao we're good

https://user-images.githubusercontent.com/97707302/197095470-8fdb5141-bb31-4b9d-8197-8ac5c60a5de3.mp4

Willhelm53 avatar Oct 21 '22 02:10 Willhelm53

I replicated the setup from #9942 below, but it doesn't seem like the spread-around-corners bug has been fixed? I don't know if the below is intended. temp.mp4

You are demoing intended behavior. Look at what ACJM posted as error. The problem was x could leak through below wall config (# is wall).

###
#xx#
###

Ygg01 avatar Oct 25 '22 01:10 Ygg01

Will deal with the other stuff later.

metalgearsloth avatar Nov 15 '22 11:11 metalgearsloth