Cool sea mesh, optimized and everything

  1. Optimized, and infinite on the horizon

that is running with 300 studs of render distance and this processor:

image

(I won’t translate it, but you know the drill)

And bruh look at this graph, he’s begging for help, yet it’s running the sea mesh, with maximum graphics, on ~27ms. In edit mode with nothing running, it’s 15ms to 17ms (even in an empty baseplate).

As for RAM, it’s taking 1.3 GB but that’s probably because the planes that are not being animated (distance from the camera > 300 studs) have their full geometry, I couldn’t get render fidelity to automatic, so I just left it like that.

I don’t know if Roblox Studio is throwing all the work on my GPU (it’s a little bit better than my CPU), but even if that’s the case mine is with 5ms on the video, worse GPUs can take up to 20 or 30ms and FPS should be alright.

I only tested this on my PC, but I think most devices will perform reasonably, as the render distance can be lowered or increased.

  1. Wave height lookup function, which I used to make this toolbox boat float for showcase:

As you can see it moves and rotates, my approach to make this work was using only constraints to rotate and move the boat, this way I can make one vector value parented to the ship control its “move direction” (an offset summed to the primary part’s CFrame every X frames), and one int value control its “orientation increment y” that does the same thing as the move direction, but its multiplied and only on Y.

finalCFrame *= CFrame.Angles(0, boatModel.PrimaryPart.orientationIncrementY.Value, 0)

local moveDirection = boatModel.PrimaryPart.moveDirection.Value
local part = boatModel.PrimaryPart.desiredPosition
	
part.CFrame = finalCFrame + moveDirection

“desiredPosition” refers to the invisible part that the constraints (align position and align orientation) are trying to align the primary part with

As for rotating X and Z, I used this approach explained by robro786. (it’s getting old :skull:, but math doesn’t go ou of date)

Another benefit of using constraints is that physics can interact with the boat, it’s not an anchored block changing position every frame, stuff that collide with it can move it around.

  1. Synced between all clients

(Sorry for the quality, the game bar has a better one but doesn’t record multiple windows, I had to use OBS)

The clocks are synced with an error of ~0.1 seconds, but that doesn’t visually affect the waves.

As for the boat movement it’s also synced between all clients, even though the movement is handled locally, because the network ownership of the boat is on the client.

The constraints start acting crazy if I don’t set the network ownership of the boat to one of the clients (probably because the “desiredPosition” is handled locally, the constraints trying to follow it and while they are on the server doesn’t turn out good), but it’s completely fixed by setting the network ownership to the client.

All this was created with a local plugin I made for myself, you just open it, configure your waves, and save it, then configure all boats you want to sync with them, I’m planning to release it to the creator store but my country is not supported yet, and I don’t want to make it free on the creator store (on GitHub maybe, but not on the creator store as people who buy will have the advantage of automatic updates).

Currently it uses Gerstner waves.

I think I’ll be the first to distribute a project like this on Roblox, people act like it’s the secret crabby patty formula. If anyone wants it, it’s a matter of time until I release this somewhere

Thank you for reading.

By the way, I created this out of frustration with how Roblox hides terrain water properties from us, :heart: :heart_eyes: ****@# :heart_eyes: terrain water >: (. That’s also why I want to distribute it somewhere, to make it another version of terrain water, a better one.

Edit: forgot to mention, I got the blender node configuration of the texture in a post by @apenzijncoolenleuk1, just removed the seams from it and uploaded to Roblox, it’s not mine.

29 Likes

Sorry for the poorly written text, I was in a rush.

Here’s what I want mainly as feedback:

  1. How much do you think this plugin is worth, and how much would you pay for it?

  2. Do you like the project? Does it look good? What features could I add?

2 Likes

This looks sick! How did you make this ? With editable meshes ? And also, can you swim in that water ?

2 Likes

The water texture looks good :wink:.

What is the network recv like for the floating boats? I remember having trouble with that. Should only be an issue if you’re planning to simulate many boats though.

The issue you’re having with server-sided physics might be due to a performance limitation? Make sure you use a simple part for the float. I used an invisible ‘ballast’ part. The entire boat model is welded to that invisible part.

I like that it’s infinite. I never succeeded with that (gave up lol).

System should be worth a couple hundreds of dollars if it’s decently optimized. Not sure how many sales you’ll get for such an ‘expensive’ price though.

1 Like

Thank you! I’m using the good and old method of exporting a plane from Blender with one bone in every vertex.

Currently no, I can’t swim, maybe I’ll add it some time, but I initially was making this project just for fun, with terrain water, then I got pissed off at it and decided to do all the boring (not for me, I liked it) research and got it finished, I have 0 ideas for games that require sea meshes, that’s why I didn’t even think of adding a swimming system or something.

Haha thank you!

Network receive? You can see it on the videos, and testing now it’s the same, 0.3kB/s for 1 boat, no issue with that. I cloned the boat 3 times and it didn’t increase, only network sent, because the network ownership of the boats is one of the clients (currently who joins first, but it could be the closest player or something).

(Enviado = sent)

Network sent was 1kB/s with 1 boat, now with 4 it’s 2.44kB/s. With a lot of boats this could be a problem, but splitting the network ownership with all clients should fix it (probably)

Yes I am using a part to rotate it, it’s welded but it’s also the boat’s primary part, don’t know if that affects anything, this part has constraints trying to align it with another invisible part, that is anchored and not attached to the boat.

But that issue isn’t really an issue unless there is some downside to setting the boat network ownership to players. I think there isn’t since the wave heights and boat rotation are already being calculated on local scripts, making the client manage the physics is just a little more work, I couldn’t notice anything worse related to performance.

I know a lot of stuff wasn’t very clear in my post, I’m sorry, I was in a rush to go to school.

I’m glad you like it. If you’re curious my code just ignores planes if their distance from the camera is bigger than the render distance (or their size times 2.5 a weird fix for weird-looking planes when render distance was too small), also ignores planes out of the camera’s view frustum.

The downside of this is I have to use the right size of plane, I read somewhere on the forum that a guy had only one plane and organized his bones in groups, it’s basically the same approach, but he needs to organize his bones by code, my ones are already organized in groups of 289 (amount of bones per plane), however if 289 bones took good 10 minutes to upload I can’t imagine how much it would be if my sea was only 1 plane.

I also thought about an expensive price, not that high, but I agree with your pricing considering it took me around 75 days only on this to make it work 100%, and also that most devs don’t need the wave height of their water, it would be better for me to make a few big sales than distributing it around, but I have a big problem with this:

  1. Where would I find people looking for an advanced sea mesh system on Roblox, and willing to pay for it (creator store is an option, I have a plugin version, but my country is not supported yet and it’s 2 clicks to pirate everything and my work is gone, maybe commissions are a better option, but I don’t know where to find people looking for this system)

If I share it for free (even if only on GitHub, and the creator store version that updates automatically being paid) the piracy problem is gone but it brings another problem:

  1. My payment is a lot more uncertain, I have no idea if the support I’ll receive will be enough for the time I spent (I think it won’t considering how much people actually need this for a game or something), and if it doesn’t pay back I’ll either have to start working while studying in which case I’ll have almost no time to code, and I really like coding or place a bet on developing Roblox games.

I agree that for this system a cheap price isn’t a good option, there’s almost no documentation on Roblox regarding sea meshes and optimization, only a few posts on dev forum here and there, the time I spent researching about sea meshes I was mostly translating JavaScript and C++ snippets to LuaU and trying to understand how to adapt it, but I’m still stuck on this decision about pricing and where to distribute.

As for optimization, I need testers to make sure, but I’m almost sure it’s decently optimized.

1 Like

You can now file DMCA takedown requests against plugins. Never tried that, but I assume they work.

I’m not sure if the plugin marketplace is a good place to sell your asset. I don’t really think it’s a ‘plugin’. You could add a plugin gui to easily change wave height, instantly setup floating height, etc. but the basic water system is just a plane asset, and scripts to control it.

A cool option would be to have the basic system be free (local water wave movement), and allow users to add ‘advanced’ features through a plugin: swimming, floating, server-sided wave sync, physics boat model, easily change wave behavior using sliders, etc.

That way you should have the exposure from the free asset, and that might encourage many to purchase the plugin that goes with the basic wave system.

I’ve not tried selling a plugin yet, so take this with a grain of salt.

1 Like

You can see it on the last screenshot of the main post, I already have such plugin GUI, I created it for myself to speed up things but turned out good.

There are 100 other ways of distributing a file, torrent, telegram, discord, etc. Especially considering how small the file is, around 1 Mb, but at least there won’t be someone selling the exact same thing for a smaller price on the creator store, I didn’t know that, thank you.

That’s a good idea, but if that version with advanced features is extremely expensive, let’s say 90 dollars or something, I don’t think anyone will be tempted to buy it, the hard part of seas is optimization, if the basic system is already optimized coding the rest is a matter of patience for anyone.

The best approach I think would be searching for people planning to create games that need a more controllable sea, this way I think that the price becomes much more appealing, it’s a big part of a naval game and probably skips like 4 months of development or so, however, I don’t know where to find such people.

Should I just upload it to the creator store with a price that most will consider absurd? Piracy will be there but If I get like 2 sales a month with a price of around 100 dollars, I’m already happy with the time I spent on this, especially considering how much of my currency a dollar is worth.

I just don’t want to end up without anything after all the research I did and the time I spent.

This looks amazing! you should definitely release this or make a full tutorial on it. Roblox has needed something like this for a long time!

Thank you!

That would be the longest tutorial on the entire forum, don’t know if anyone would read through it :sweat_smile:

As for releasing it, I’m really confused about pricing and all that stuff.

Roblox had this for a long time, but everybody who finishes this wants to keep it for themselves because it’s a huge amount of work, I finished it in ~2 months because I was using several hours of my days, that’s also why I’m reluctant about making it free.

This looks sick and well optimized, I’d like to know how you managed to calculate the height of the waves

As for the feedback:

The clocks are synced with an error of ~0.1 seconds, but that doesn’t visually affect the waves.

You could try using this if you want a more accurate syncing approach: Player | Documentación del Centro de creación de Roblox
(I can explain further if needed but it’s basically a way to compensate delays between the server and client)

As for how to use it, since I don’t know how you exacly handle syncing, I do it like this:
(return os.clock from server by invoking call method) + os.clock() + player:GetNetworkPing() / 2

A few optimization tips:

  • Precaching math variables
  • Disable any unnecesarry properties from the plane part (Set EnableFluidForces to false, Set CollisionFidelity to Box, Set RenderFidelity to Peformance, set CastShadow to False)

At last:

  1. How much do you think this plugin is worth, and how much would you pay for it?

I’d say a price between $20-35 is fair, I’ve seen plenty of gerstern wave systems go for $5-10, however, since yours is actually optimized, I consider my price range to be fair.

  1. Do you like the project? Does it look good? What features could I add?

Indeed, if I were you I’d add a zone system so waves (bones inside certain range) have their settings changed, for example:

A spawn / Island where the waves are calm at certain range but once you get out of that area, the waves become rough (default waves)

That’s all the feedback from my part, i’m really interested in how you handled wave creation and height lookup

have a nice day and keep up the good work :muscle:

1 Like

I don’t know how to explain you properly, but 13:20 of this video explains it very well.

Edit: It’s not the optimal way to do it with low-resolution meshes, but as I managed to get a reasonable resolution without lag it works with great accuracy.

I choose this method over others because it’s the most performant, others involve looping through a bunch of bones, imagine this in every floater of the boat, and for a bunch of boats, it’s not the best idea.

Yea, compensating for ping probably will give me a more accurate result, but an error of 0.1 seconds is extremely precise, especially for something visual such as waves.

However, players with high ping might experience some really big difference in their mesh I’ll try that later today.

I remember reading a Lua article about precaching math variables I’ll also try this later today. CastShadow is already false, and RenderFidelity on performance isn’t working, in my first attempts of exporting Blender planes it was, but with the planes I’m using currently it says the mesh should pass through moderation first, and a new asset ID will have to be created, but I don’t know how to send it for approval. Also, I didn’t know about EnableFluidForces, I’ll disable it, thank you.

A price like that seems fair, but what gets me stuck is: how many people on Roblox are willing to buy this system? I have no data regarding this but I think that very few.

So I don’t know if I should sell for this price range ($20-35, the risk is getting very few sales) or aim for teams with a high budget, this optimization is a big part of the development of naval games, if someone has the budget it’s probably worth for them, even if it’s like $60 or more because it skips months of development (1-4 depending on how many programmers and their skills).

I’ll also have to wait for the creator store to support my country anyway, so I’m trying to think through this while I wait.

Thanks to everybody who’s helping me in this topic.

2 Likes

This is a fine creation.

But, unfortunately not the first, people who want something similar should go to:

1 Like

Roblox has a great API that allows you to get accurate server time, which also accounts for ping:
Workspace:GetServerTimeNow()

I’m aware of it but back then it was innacurate for me, perhaps it was fixed now

This is OP, looks like UnrealEngine 5, kudos on this! :clap: :clap: :clap:

1 Like

Wow I didn’t know this was available, sadly on April 29, I could have speeded up my learning a lot if it released earlier :frowning:

However, the main creation I’m showcasing isn’t the Gerster Wave code, but the optimization, I can add how many planes I want without making it unplayable, and from what I’ve seen on the resource you linked it’s not that optimized.

Damn, I was using his method to get server time :man_facepalming: I didn’t know there was a built-in one, I’ll definitely switch to it, thank you!

Thank you! I think you’re exaggerating though :sweat_smile:

Sorry, but what would you know about this? All you’ve ever done is follow a simple tutorial on how to make Gerstner waves, and then “optimize” it, aka all you do is only move the bones closer to the camera. These “optimizations” are a barely anything, all you’ve done is add a view distance, that is obnoxiously low. Also the funniest thing of this all is that you’re doing this on the server side, look I know I’m not one to pity Roblox, but at least pity their servers. They’re under enough stress as is, they don’t need to be computing the water.

And not to mention that your “water” is just Gerstner waves, look I know Gerstner waves are useful since they are performance easy, but if you’re going to compare Gerstner Waves and an actual Ocean Spectra, then that’s when you’ve crossed the line.

Also looking at other comments about you asking how much you should charge this, well here’s my answer: who would pay more than 5$ for this, it’s literally just following a tutorial, anyone with half a brain can do it. Look no offense here, but this is not something that should even be thought of monetization.

2 Likes

Dude calm down, it’s from what I’ve seen, I didn’t download it or anything.

I’m handling all the calculations on the client, do you think that 27 ms of update time is with everything on the server? I didn’t add anything more than Gerstner waves because the mesh resolution is already high enough, adding FFT and increasing the resolution would fuck the mobile players, I coded this with the Roblox player base in mind. Im also frustum culling the planes which increased performance significantly.

Well I was initially thinking of distributing it for free, I only thought about monetization because of the time I spent on it, but even now my idea is to leave a free version on GitHub.

I don’t know why you’re acting so aggressively though, it wasn’t my intention to sound rude with that comment, I’m sorry if I offended you in any way.

I wasn’t trying to make your creation sound worse or inferior, I was just saying that what I mainly did on my project was optimization, as you said, the Gerstner wave formula and all that stuff is already on the internet. Again, I’m sorry.

To answer your questions,

  1. As a programmer myself, I personally would not purchase it, simply because I would just end up making it myself. The only time I would consider a purchase of any product is if I do not have the time to create it myself and it fits the wants and needs I would have. There are also similar assets I have seen, BUT, the ones I have seen are not simplified for the average user like yours is, with a GUI. With that being said, I think those who do not have the ability to create such a thing, this would be a great asset to them.

  2. I do like the project you have worked on and I think it looks really good. From what I have seen you post here, the ocean is well optimized and performs great. I think the look of it is also really nice. There are a few things I could think of you possibly adding. One of the things you could try implementing is the ability to stay afloat the top of the mesh as the playable character(this may already work since you have the boat moving though). Another thing you could possibly implement is zones where the water is still or rougher. Finally you could try and implement drifting in the ocean, things could be pushed along slowly, maybe towards an island?

I also have no clue why the guy above got upset with your response. Regardless if you or anyone ever followed a tutorial or not on anything, you clearly understand the ins and outs of what you created and that’s the most important part.

tl;dr
You did a great job creating and understanding the project you worked/are working on.

2 Likes