How to develop a "mock" fluid simulation?

Hey everyone,

So let me first explain what I’m trying to achieve, and then what I tried. There is a sorting game where you need to match your colored liquids between bottles. Game idea is not super important right now, and I easily can code the algorithm for that. I am doing this project because it looks simple to code (except this problem) and I wanted to see if this is really simple or not. Also, I can always learn something. So basically, not commercial.

But the problem I have is that illustrating the liquid animations in those bottles. It is pretty hard for me to explain, so please take a look at this 1-min video

The gameplay I refer to - Magic Sort!

As you see, fluid does not predent as a super realistic fluid. So, this is what I want actually, because when I look at fluid tutorials in 2D (like CodeMonkey’s here: CodeMonkey’s Liquid Tutorial, I see few problems about implementing this in my project:

  • First, this would be a problem because I want this game to be fast-playable. Meaning that, of course this game is not hypercasual, but still, I want the “fluid transfer” between bottles as fast as possible.
  • Secondly, he is using a technique where a game object is copied over and over, and I don’t think it is healthy for mobile gaming that’s resource intensive.
  • Finally, also due to Reason2, the fluid willnot stabilize its upper part precisely horizontal, meaning that there will be little waves before fluid calms down, which contradicts what I want in Reason1.

Therefore, can you please help me or suggest some resources about this? I’m really interested in this part, other than that, this is probably a stack implementation, where each bottle has its own stack etc. However, this part is really confusing for me. Thanks in advance.

i’d probably try using sprites,
have 3 pieces, bottom, center (the one that is filled) and top

top piece can have different animated sprites for variation,
center part is scaled or filled (like in slider/image),
bottom part could be separate or from 9 slice sprite with center…
and some particles/sprite sheet anims for splashes.

image

1 Like