space-station-14
space-station-14 copied to clipboard
Fluid spread refactor
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
Changelog :cl:
- fix: Fluids no longer leak through micropores in concrete
- fix: Fluids now spill slowly, rather than quantum tunneling to optimal size
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)
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".
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
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#
###
Will deal with the other stuff later.