Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to handle water?

I want to make my world as explorable as possible, and part of that is allowing the player into water.

For shallow or waist high water that's fine. Some splashing sound effects, water droplet animations, and the ability to walk in shallow water or wade in slightly deeper water.

But what happens when you get deeper than that?

I have a few options:

1. Swim

The player can swim in deep water up to any depth, moving through it roughly as if it's land. The issue with this is that there has to be a point where the player can't travel any more and that leads to a fourth wall breaking invisible barrier.

2. Drown

The player gradually gets given Damage over Time status effects as they get deeper into water, until they eventually drown. So you travel briefly through deep water but only for small actions.

3. Underwater Maps

Let the player go fully under water and explore the world beneath. Map this as if it's a normal map, do a water overlay, and as the player steps into the water this overlay becomes slightly transparent revealing more of the map.

4. Don't let the player in at all

Simply don't allow the player into deep water.



Another consideration is pathfinding and a faux 3D world.

If the player can enter deep water, I want them to be able to jump, dive, even fall off cliffs and platforms into it. This gives an extra dimension to jumping puzzles and some realism to the world.

The issue with this is pathfinding. If you can walk over voids but wouldn't necessarily want to, how does the pathfinding system know this?

I don't want to remove click-to-move because I want full phone compatibility, but click-to-move would break with such a system.

One solution would be to remove "falling" altogether and have it so that you have to move to a cliff edge, then continue to click on the water to jump in. Or, have a jump command (double tap?) and have that command able to fall. That would be a jump in the direction you're facing only and can fail.

Anyway, here's a very quick example of option 3, but I'm not happy with the water effect at all.

DPk3Hqg.jpg


Once "water" is a defined thing I hope to have such things as water droplets when it rains.
 

Jason

Awesome Bro

I'd go with the drowning option, let the player swim wherever they like, but give them a stamina bar, and once it runs out they'll drown, or if you're using terrain tags or whatever, could have the screen fade to black and teleport them back to the last land they stood on. If you make this as another skill or something, you could increase stamina per level, but never have it go high enough to let the player reach the end of the map.
 
I think option 4.

You may think this is an invisible wall, effectively it is, but it can be communicated with a darker patch of water. The Pokemon GBA games did this (although they had a visible rock-barrier too) and Zelda ALTTP has this before you get the Zora flippers.

You actually do get shelves in the ocean where the depth suddenly drops; I almost drowned because of one when I was a young child. Just communicate that "this is deep water, you can't go any further" so the player knows there's a boundary to their world. They need to get a boat or a ship if they want to go further ;)

Maybe make it feel a bit more organic by having the player be able to reach this deep water, but the game will pull them back into the shallow water automatically. I think that's the solution I'd go with. So they wade in shallow water, swim in deeper water, but cannot proceed in very deep (dark) water.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top