Gerstner Wave testing with boats

Hello. Lately decided to try and have a knack at deforming meshes to simulate waves in Roblox because why not? This little project started with Perlin noise waves, however, Gerstner Waves caught my eye and well I couldn’t resist the challenge there.

After 4-5 days of work the project currently features:

  • Boats floating on the water and rock with the waves.

  • Waves look the same for players in a single server.

  • Boats are controlled by players, they spawn when a player joins or resets and de-spawn when the player leaves or resets.

  • Gerstner waves have 3 different waves that are combined - this took a while to make it work properly.

  • Heights, directions and lengths of the waves can be easily changed - currently they aren’t randomized but future versions will.

  • The water mesh moves to the players position along the X,Y axis after the player moves a certain amount of studs away from a defined location that also gets reset when this process happens.

  • Waves are more calm near the current and only island, this will be updated to handle multiple islands with varying sizes.

Media:



Waves near island:


Waves away from island:

Feedback if any would be greatly appreciated. Have a good day!

8 Likes

So awesome!
I’ve always kept the Terrain waves pretty minimal in my boat games so boats don’t really need to rock like your setup. Very nice work!

1 Like

Hello! I have to say this is amazing, I love the art style and functionality of the waves. However, I do have one question. How did you manage to make the waves near the island(s) to be smaller, while farther out in the ocean it becomes more rocky and violent. Any help would be appreciated, I have been working on my own system for awhile but can’t seem to figure this out!

2 Likes

When I update the waves I get the distance from the closest island and the bone that’s getting updated, this acts as an extra modifier for how steep the waves are

2 Likes

This is super cool! The motion looks incredibly convincing. Definitely a lot better than Roblox’s default water, which has waves that don’t do anything.

1 Like

This is really cool! I’m currently trying to do a similar kind of thing for hover vehicles. I have 4 points for each of the 4 corners and I want the hovercraft to rotate so that each of the 4 corners of the hovercraft match the 4 points. How would I calculate this?

1 Like

The current method I use to make my boats float is adding an upwards force to a point, the scale of the force mainly depending on how far under the water that point is. So really I just let the built in physics to rotate it for me.

2 Likes

Okay, thanks! But then how do you get the boat to rotate so that it is conforming to those points?

1 Like

I think you may have misunderstood what I tried to say, the points on my boat are actual instances under the boat (so they will rotate with the boat), I apply an impulse at each position of these instances depending on how far under the water that position, this lets the built in physics do the whole rotating for me.

4 Likes

Ahh! I see what you mean. So rather than basing the position of the boat off of the points, the boat is actually as if it where, tied to those points physically?

1 Like

Yes that is correct. There are other ways to position the boat but this in my opinion is probably the easiest way to do it.

2 Likes

by impulse do you mean an upward force? and also the boat rotates but how does it stay up

1 Like

This looks very good! Nice job on it!

1 Like