Institute of Computer Science
  1. Courses
  2. 2023/24 fall
  3. Computer Graphics (MTAT.03.015)
ET
Log in

Computer Graphics 2023/24 fall

  • Main
  • Lectures
  • Practices
  • Projects
  • Exam
  • Results
  • Links

Water Sort Puzzle With Glittery Shader

Alicia Sudlerd, Mihkel Roomet, Henrik Tamm

Repo
Itch.io
Presentation

Scan this to download and install Android build (Don't forget to double tap to check our shaders out!)

Overview


Water Sort Puzzle is a casual puzzle game popular on mobile platforms. The game presents the player with a number of containers (tubes, bottles, glasses, vases, etc.) filled with various colored liquids. The challenge is to pour the liquids back and forth between the bottles until each bottle contains a liquid of only one color. The game often starts off easy with just a few bottles and colors but can become challenging as more colors and bottles are introduced.

Goal

Sort the colors in such a way that each bottle is either empty or fully filled with liquid of one singular color.

Rules

  • You can only pour liquid from one bottle to another if the bottles' topmost colors match and there's enough space for the liquid that gets poured over
  • Each time you pour only the topmost color gets poured (the colors below it do not)
  • The game ends when each bottle has only one color in it

Strategies

  • Prioritizing moving the most restricted (trapped) colors first
  • Trying to create an empty bottle as soon as possible, as it can act as a buffer or temporary space to help with sorting
  • Planning moves ahead to ensure there is space for subsequent moves

Progression

  • Each new level increases in complexity, adding new bottles and/or colors
  • The player will have to keep thinking more and more steps ahead as the dynamics of the game keep evolving


Implementation


Level design

This is the initial idea for how to structure levels.

LevelbottlesColors
021
132
.........
nn+2n+1

Physics

The game does not require a complete physics engine but should provide a smooth and natural liquid-pouring effect.

  • The water surface should always be parallel to the floor
  • To master the visual experience, the water surface can have a curvy fluid animation applied to the edge of the water

Bottle design

When pouring, only the bottle rotates, the liquid inside does not. This is accomplished by using a shader and code to manipulate certain defined variables during the pouring animation.


Initial Progress

Nov 14

Features

  • Main menu
  • AI-generated logo, default cursor and pointer cursor
  • Credits panel (opens on clicking the logo in main menu)
  • 7 playable levels (progress is saved)
  • In-game pause menu (toggled with Esc)

All the UI buttons work. Pouring works as expected. Levels are sometimes impossible to beat (the colors are distributed randomly among the first bottles).

Next steps

  • Adding UI to indicate starting and completing levels
  • Displaying stream of liquid on pouring
  • Adding light and particle effects to the event where a bottle gets fully completed (fully filled with one color)
  • Adding an interesting watery background using a shader


More Progress

Dec 8

New Features

  • 10 playable levels, now mostly beatable
  • Pouring effect (line renderer)
  • Everything now scales to work on both mobile and desktop
  • Current level label
  • Level complete UI panel
  • Particles for bottle complete and level complete

An alternative shader for liquids in bottles is also mostly done, but it's yet to be added to the build.

Next steps

  • Adding an interesting watery background using a shader
  • Optimizing code to run faster on mobile
  • Adding wave effect on pouring
  • Adding more shaders to liquids in bottles


Final Progress

Jan 14

New Features

  • Watery background, with water color subtly changing each level
  • Four different shaders for the liquids — regular, metallic, glittery and crystalline. Choose a shader by pressing keys 1–4 or by double tapping if on mobile.
  • The game now checks for no more moves and displays a notification to restart when necessary
  • The bottles now look way better :)
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment