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

Puddle Visuals: ECS/Refactor and fixes

Open Willhelm53 opened this issue 2 years ago • 8 comments

About the PR

This PR removes PuddleVisualizer in favor of PuddleVisualizerSystem and PuddleVisualizerComponent (all Client-side). Generally makes my code for wet floor sparkle effects less janky.

The below screenshot summarizes my design doc with the state of this PR in red. Some things may need to be bikeshedded (such as, should sparkles always convey slipperiness for the average player's benefit?), but the important thing is that I am now the Puddle Visuals Understander, and it's easy for us to bend this system to our will! image

Fixes #9049 Fixes #11823 Fixes #6526 (arguably this was fixed by others earlier though)

Screenshots

https://user-images.githubusercontent.com/97707302/196008843-c17608dd-e038-45cb-b801-15d53f1fac26.mp4

Changelog

:cl:

  • fix: Fixed tomato and vomit splats losing their color/sprite.
  • fix: Fixed wet floor sparkles getting stuck on one animation frame.
  • tweak: Wet floor sparkles are now slightly more opaque and stay invisible for less of their animation cycle.

Willhelm53 avatar Oct 15 '22 21:10 Willhelm53

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 15 '22 21:10 github-actions[bot]

This PR also replaces my old one, #6848

Willhelm53 avatar Oct 15 '22 21:10 Willhelm53

No more Marge Conflict image

Willhelm53 avatar Oct 15 '22 21:10 Willhelm53

Seeking help on the ubuntu checks failing! This is the same thing that killed my momentum on previous PR months ago 😩

Willhelm53 avatar Oct 15 '22 22:10 Willhelm53

image image

these are the errors

mirrorcult avatar Oct 15 '22 22:10 mirrorcult

Checks passed but somehow it was just by commenting out the logger warning... image This solution obviously sucks so I'm going to tweak a little more based on #8203 which I just noticed.

Willhelm53 avatar Oct 15 '22 23:10 Willhelm53

All good now and ready for prelim review. To be clear - the logger warning for missing sprites is still intact and not causing problems. For some reason, the logger warning I added for my own system's PuddleVisuals data transfer (e.g. volumeScale, solutionColor) was causing exceptions to be thrown in the tester. This was true whether logger.warning or logger.debug was used.

Since it's for my own system's new data transfer, I'm fine with not having that logger warning. So I just removed it. I suspect this is the same thing causing me problems way back in #6848, because at the time I had bundled my PuddleVisuals data checks within the existing logger warning for missing sprites.

Seeking feedback now, because the only other thing I plan to add for this PR is a check similar to what I've done for isEvaporating but for isSlippery: Evaluate the state within Server puddle system, and transfer to Client puddle system for use in determining wet floor sparkle effects.

Willhelm53 avatar Oct 16 '22 00:10 Willhelm53

Out of draft, and updated PR description! ✨

Willhelm53 avatar Oct 16 '22 07:10 Willhelm53

Somewhat related to the currently-open #11908 but we change different areas. Should be relatively easy to resolve any merge conflicts between the two.

Willhelm53 avatar Oct 17 '22 16:10 Willhelm53

After polling in the discord, I'm going to revert my latest commit which made sparkles depend on slippery. Will update that later today along with the PR description.

Willhelm53 avatar Oct 19 '22 18:10 Willhelm53

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 08 '22 20:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 15 '22 11:11 github-actions[bot]

It seems my changes broke this.

Ygg01 avatar Nov 15 '22 19:11 Ygg01

All good @Ygg01 - I was expecting your changes in #11908 to cause some merge conflicts. Just haven't been able to get into fixing them until now. I'm gonna test this PR some more on local to make sure it's all smoothed out, then this one should be ready for review.

Willhelm53 avatar Dec 12 '22 21:12 Willhelm53

Marked as draft because something broke the "sparkle animation freezes on a single frame" bug again. I had previously fixed this with a sprite.LayerSetAutoAnimated(0, true); and now I intend to go over it again with a fine-toothed comb.

Willhelm53 avatar Dec 12 '22 22:12 Willhelm53

Ready for review.

Willhelm53 avatar Dec 13 '22 03:12 Willhelm53

One thing I still wanna do is incorporate @ElectroJr's comment (via Discord) about making the sparkles rsi into a spritespecifier on the component (currently it's just hardcoded in the system which I agree is a bit jank).

Please hold off on merging until I make this small change. And I'd welcome additional review because (for me at least) this was a pretty substantial refactor 😄

Willhelm53 avatar Dec 15 '22 18:12 Willhelm53

oh and now that this one is merged there's another thing I can try to make cleaner (previously had to flip AutoAnimated off and back on again).

Willhelm53 avatar Dec 15 '22 19:12 Willhelm53

I wonder, can this PR help to make puddle more look like a puddle and not like splats - when visually all liquids on floor connected into one big puddle and can change depends on reagent amount ?

Jackrost avatar Dec 17 '22 22:12 Jackrost

I wonder, can this PR help to make puddle more look like a puddle and not like splats - when visually all liquids on floor connected into one big puddle and can change depends on reagent amount ?

Will it make it easier to implement? yes, because not dealing with old code is helpful does this change puddles visually? no, its just code cleanup

AJCM-git avatar Dec 17 '22 22:12 AJCM-git

Will it make it easier to implement? yes, because not dealing with old code is helpful does this change puddles visually? no, its just code cleanup

For future implementation of course

Jackrost avatar Dec 17 '22 22:12 Jackrost