• Register
Development Update - Water Mechanics

Technical and design aspects of designing water mechanics for Relativity.

Posted by on

Hey guys, been a while since the last update. Today, I will be discussing one of the new mechanics I'm working on: water. In Relativity, water is going to play a very important role in the puzzles. And because it's a puzzle game, I need the behavior of water to be very predictable. If a stream falls off here and hits something, the player needs to know exactly which direction it will go. So, to make water fit within the context of the world, it will need to be very constrained and follow a very specific set of rules

Here's a rough draft of the water system so far:

From a technical standpoint, each 'block' of water is a separate game object, and is a child of the previous segment. This means that if changes happen higher up in the water hierarchy, all subsequent water would be affected, which is what one would expect. Each segment also does raycasting in a variety of directions to determine which direction it should head in, and if there's anything beneath it. If nothing is beneath it, then it will fall downwards until it hits something.

From a design standpoint, I'm still trying to work out the rules of the water's behavior. I'm planning on introducing the L-Shaped blocks later in the game that lets the player bend streams of water.

Below is my thought process for deciding how water should behave in Relativity. Please excuse the crudeness of the drawings. These are all from a top-down perspective.When you place the L-shaped block this way, you bend the water stream to the left (the water's left). The arrows indicate the direction of the water.

And when you place the L-shaped block the other way, you bend the water stream to the right (the water's right).

These are the basic starting rules.

So then, what happens when water approaches a block like this (perhaps 2 normal blocks placed side by side)?

There are three options.

1) water splits and continue in their new directions:

This seems logical enough, if not a tad bit unrealistic. However, the problem here is that it renders the L-shaped blocks useless. Why choose one direction, when you can basically get 2? It also makes the puzzles way to easy, since you don't really need to think of how to redirect the stream, you can just keep splitting it bidrectionally until you've got the stream you need.

2) water splits, but then continues in original direction:

Ok, so then water happens after the block? Do the streams re-merge into one?

or continue as two separate and independent streams?

The problem with keeping the 2 separate streams is that one of the streams is pretty much useless. It doesn't add anything to the puzzle, since the other stream is going in the same direction and is right beside it.The problem with water re-merging is, what if I have a much wider obstacle, which can be formed by players putting multiple regular blocks in a row.If it's really wide, it would look weird for water to continue in the original direction:

This seems more natural, but I'm back to my original problem of creating bidirectional streams and making the puzzle solving to easy:

This leads me to the final option:

3) stopping the stream:

It's not the most realistic option. However, it solves a lot of the problems with the earlier options. For one, it's really predictable. You know if you don't have an L-Shaped block lined up correctly, the water will just stop. Also, it doesn't allow the player to create bidirectional streams. So, I think this is the option I'm going to go with.What do you guys think? Of course, this doesn't handle all the cases. For example, what if the block is shifted and only touches half the stream? I haven't worked this out now, but these are just the basics of the water behavior rules.

Wat, Water, now that was un-expected, cant wait to see it in action!