Lately, I have been working on a custom physics engine for simulating how parts behave in mediums such as air and water. It was quite hard to get it right, since I had to deal with problems like numerical instability, time synchronization and unit conversion (porting kilograms and meters to Roblox and vica versa). Eventually, I managed to solve these with some help from the forum and friends. I managed to put my calculations to the test by spawning a part with a density of 0.997 in the water (my water has a density of 997 kg*m^-3). It was supposed to float in the water, since it had the exact same density and it did.
After accomplishing some succesful simulations, I thought about what I wanted to do with them. So I decided to add infinite water using skinned meshes. My plan is to open source my sea on GitHub at some point in time, since a lot of people are trying to make a sea using skinned meshes. There are some tutorials on making a sea using these meshes, but they do not show you how to exceed 2048 studs (which is the maximum size of a MeshPart).
For now, I decided to release a showcase to share it with people. So here it is: Medium Physics Showcase (Open Source) - Roblox. The spawnable boats do not have GUI support, so these are the controls:
Hold Q/E - Sails
Hold W/E - Propellers
Hold A/D - Rudder
The arrows indicate the forces that act upon a part, where:
This is impressive, well done. I especially like the physically simulated waves, even if theyāre just sine waves for now.
When you do open source this it will be a huge help for me and a whole lot of people. I currently still rely on terrain water for large oceans and it looks nice and has good physics but the resource usage is ridiculous.
Tip: try the sail boat instead of the motor boat if you want to see the physics in action. The wind direction is paralel to the waves direction (yes you actually have to āsailā your way forward).
I would love to have this open-sourced, been searching for a solution for client and server sync & float physics and couldnt find it anywhere. This looks amazing!
I want to start off by saying that this resource is a godsend and has been a massive help to my projects.
I have run into an issue and itās proving to be a bit of a pain in the back.
I have noticed that the further away from the center of the world you are, the less consistent and refined the waves are. Basically, they look more ājaggedā the further you go out.
Itās worth noting that I have performed some modifications to the source code, ie; changing values to make a less dramatic water. I have also removed all of the physics related kit that comes installed so that it is very much just the skinned mesh water. However, the problem is consistent with the original.
I am aware of that. Chunks that have a different level of detail do not overlap perfectly, which causes them to look jagged at times.
I later found out that you can scale MeshParts past 2048 studs. This means that as a solution, you can make a circlular skinned mesh with a high level of detail in the center and a lower one towards the border. Then you can update the bones like the current system does. This way, you get rid of the chunks and therefore the jagged-looking effect.
So basically the solution is:
Make a circular skinned mesh with a high resolution in the middle that lowers towards the border (for performance)
Load it into Roblox Studio
You can use the same script (and modify it), since it is made to work with any skinned mesh
Adjust the script to displace the bones further away from the center (in order to scale the mesh past the 2048 studs limit)
EDIT: I found out that textures deform depending on the triangle size that they are rendered on. So having a mesh that consists of triangles of different sizes will result in visibly altered textures. Therefore, I recommend to copy the methods that are used to make this sea instead if you want to go for great aesthetics.
Can you send me the place file? Iām trying to edit the place but I canāt. Iām having a hard time figuring out the size of the wave from where the player is
Iāve been experimenting around with the look of the ocean to try and make it feel more āoceanyā. I recently discovered that itās possible to add texture scrolling to skinned meshes and I have been hellbent on trying to figure it out. I have so far only managed to get it working in one plane.
After much poking around I canāt find anywhere to implement this and given my general lack of knowledge on code in general, I donāt know how to add a separate script to handle it for me.
-- ("texture" is just a placeholder variable for a texture in the plane)
for X = 1, 3000 do
wait()
texture.StudsPerTileU += 1
texture.StudsPerTileV += 1
end
I want to run this simple UVoffset scrolling loop in every chunk model. How and where do you think I could best implement this?
Iām really sorry for bumping this, but I just canāt find a way to add physics to my own objects. They are just objects, not actual boats, like trash and stuff