Best way to do water for a submarine game?

I’m curious about how one would do water in a submarine game, one that you can actually go out into the water, your sub could be breached and rooms flooded, etc. It seems that there are three different options:

  1. Terrain water - You don’t have to script a swimming mechanic but you have to constantly write out voxels that are in a sub so the sub doesn’t look like it’s full of water all the time (unless it’s breached but that’s a whole different problem)

  2. Part water - Useful for flooding individual rooms but probably really laggy, also have to deal with keeping water out of the sub like with terrain water

  3. No water - Simulate water physics where there is no water, which is a valid option for my purposes but maybe have to do a tiny bit of part water to simulate room flooding

To all of the experienced scripters out there, what do you think is the best way of doing water for a submarine game? I haven’t tried anything out yet because I’m interested to see what other people think.

5 Likes

This is very tricky as roblox did not plan water terrain physics ( :wink: :wink: @Roblox made this real some day please) but I did it this way: when the submarine is above surface, it’s seen above water with terrain water cornering, when diving the interior of the sub is not actually in but in a separate region only for it so it can use as much space as needed and it does not have problems with water, you can also try to made the client recalculate all the terrain voxels each movements but since terrain works in voxels and not studs this won’t be nor smooth nor nice to look at, just a laggy mess with parts of water sticking too in or too out of the sub and probably making people swim in air when approaching walls.

I am actually working on a plugin to have realistic water physics.

1 Like

Sounds interesting, you are making it throu voxel default terrain or are you using some other method to make it? Also, does it lag so far?

It is just an idea and I am making an outline how to do it. I dont know anything about lua just C and Python.

Oh in that case I would be glad to help but it surely will be a bit of a mess to make with voxels, maybe mesh deformation would be a better approach but I don’t think it will be in roblox soon :confused:

Really? Would you like to collab on the plugin? Let’s discuss in DMs if yes.

1 Like

Use Colored fog to simulate underwater

Use parts for the flooding

2 Likes

Marking this as the solution for now. Custom swimming script shouldn’t be too hard.

when diving the interior of the sub is not actually in but in a separate region only for it so it can use as much space as needed and it does not have problems with water

@Cristagolem so if I’m understanding correctly, you put the interior of the sub in another part of the workspace and just teleport the player to that when they go inside the sub? If that’s the case, I’m not really sure if that’s plausible for me. If a room gets breached to the point where the player can go out into the environment, I’d have to teleport the player back and forth between the environment and the indoor region depending on what room of the sub they’re in, which might look really messy. Airlocks are a little easier to deal with but still involves lots of teleportation. I might be able to make something work with enough trail and error, but I want to make sure that’s what you meant first before I try anything.

the easy way to do it would be making a fade-in when the player gets down the airlock and make it fade-out when the teleportation to the other region of the workspace is made, we could also lower the minimum before model deletion and place it under the terrain. I did this for making houses and I think also other games like MeepCity do something like that.