Since the introduction of skinned mesh deformation and having further been inspired by tyridge77 's post I started working on my own skinned mesh ocean system.
Over the course of 2 years, on and off, I have continued to improve and refine this system, hoping to turn it into a passion project.
Today, I am excited to share with you the various physics-based interactions with Wind, Sea, and Sail that I’ve developed!
Of the entire system I have a few things I want to showcase specifically here!
Procedural Skinned Mesh Ocean System
“ShipAlign” Character Handling
Real-Time Physics Wind Based Sails
Ship Buoyancy Simulation
The Endless Horizon!
NPC Handling
There are a lot of attachments so I separated them into categories for your convenience.
More Attachments
Procedural Skinned Mesh Ocean System!
Real-Time Physics Wind Based Sails
Sails are also skinned meshes! By using parabolic equations, we can offset these bones based on the wind. We can also use these bones to raise and lower the sails!
Note: Both the waves and the sail displacements are computed in parallel to maintain under 1ms a frame in total
"ShipAlign" Character Handling
Something I hated experiencing was not standing correctly on the deck of the ship. It took some time but with a lot of CFrame operations I was able to correct the stance of characters and their cameras accordingly.
(Before ShipAlign)
(After ShipAlign)
NPC Handling on ships
Using the same system above, ShipAlign, I was able to let NPCs pathfind onboard a dynamic ship in order to perform tasks for the player!
Ship Buoyancy Simulation
You might have seen the spheres and blocks inside the featured galleon; these are actually used to calculate the displaced volume and apply an equal force to raise the volume upwards!
It’s a little hard to showcase the buoyancy exactly, but look at it go up that wave! (Also, weight distribution is a pain, don’t judge me!)
The Endless Horizon!
Utilizing a combination of atmospheric effects, and multiple levels of detail for the water, the water smoothly transitions into the atmosphere!
Hey! This simulation is impressive and I don’t have words to express my fascination, I can’t make myself with physics haha. Keep up the good work and wish you luck!
Yo, im trying to make something similair using vectorforces.
Firstly, is that similair to your strategy? could you give some insight on your bouyancy mechanics?
secondly, are you replicated the waves clientside? Im doing the tiling method for infinite oceans that causes no lag, but i feel like it make a slight disconnect between server and client which bothers me
wait, second question. you are using bones to deform the mesh right??? cuz if roblox added vertex manipulation that would be AMAZING but i havent seen it
There actually IS vertex manipulation. Though im unsure if it useable in a live game or not. I plan to switch over to that so I can add dynamic level of detail to the wave resolutions.
Currently, yes, I am using bones to deform the mesh ocean.
The server doesn’t know where the waves are, but instead uses a planar equation and the position of bones (which are always arranged in a predictable grid) in order to find the height of the waves at any position in the worl.d.
First, with buoyancy, the entire ship is made massless except for a large yellow box who’s density is modified in order to achieve a certain weight for the ship. Secondly, the ship uses vector forces located at the cylindrical spheres to apply force equal to the amount of displaced volume of water (who’s density can be modified).
Also as for disconnect versus client and server, Ive never had this issue. Ive always used workspace:GetServerTimeNow().
I do recommend though, making sure your height lookup functions take into account the spacing between bones. As unless you have an ocean of infinite bone resolution, the spacing between them is a straight line unlike what is seen in a Gerstner wave, though you could also modify the equation itself to take this into account. This could be the reasoning behind the slight disconnect between client and server (X,Z displacement not being taken into account in height lookups)
This is just the ocean and sailing system I may make a post about our for-honor like fast-paced dueling system, Dynamic NPC system, or cannon system. But those posts are a WIP
really? could you link some docs on that? i just spend 20 minutes looking and i see nothing on that. that would be really cool if so cuz u could make some seriously cool waves.
My water is also intangible. By “volume of water” im referring to the amount of volume of the ship that is submerged, which is equal to the amount of water displaced
Oh wow, this is brillint im going to remake me ocean around this later lol. One new question: i figured out the whole boyant sphere based engine thing, the problem is that if i font lock its orientation using a bodygyro, it starts bouncing around like crazy. Im curious, fo you use a bodygyro to orientate the boat to the waves, or did i do something wrong?
Nope. The boat is self balancing due to the buoyant forces located around the ship. If one side dips too low below the waves then a stronger force is applied to push it backup.
Not to nitpick, but… isn’t the first one actually more realistic? You naturally orient yourself to stand “straight up” on a boat or ship… The character with ShipAlign enabled would be constantly falling over.