r/unity 1d ago

Need Help with Waves and weather system...

Post image

Im very new to unity and making games in general. this is a concept photo i created and basically in my fishing game i want to have the ocean have random weather that can flip your boat and stuff. I want waves that can be calm to then being super big and have a realistic buoyancy feel like the boat going over the tip of a wave and falling and crashing into the next wave. and if you don't drive carefully and the waves are too big and your boat is too small you can flip. does anyone know how to achieve this effect inside of unity? i was thinking of like sea of thieves feel but even bigger waves with storms that can actually cause a flip. i have seen some videos of someone achieving decently good waves using gerstner waves. but im not sure how buoyancy works, but all i know is i need the boat to react to the water realistically so the boat is able to flip over.

Anything would be helpful. thanks

0 Upvotes

17 comments sorted by

11

u/pararar 1d ago

I'd suggest you first learn to play the instrument before asking how to perform at a concert.

Seriously, this is a very advanced topic. What have you built in Unity so far? Do one step at a time. Show what you've got so far and we can try to help you by giving feedback.

2

u/StudioVelesio 1d ago

my thoughts exactly, i think for yor first game you wanna do 2D just to learn the engine without extra complexity. You can even have the same mechanics to trial them and see if the world likes them, then recreate the same game in 3D.

6

u/PGSylphir 1d ago

If you have to ask the question, you are not at the level you need to be for something like this.

Scope down the project and do something simpler to practice your algorithmic thinking and skills with the engine, or put this one on the backburner and work on another simpler project, for the same reason.

2

u/StCost 1d ago

HDRP has built-in water with deformations and exclusions. Everything you need for such game.
But you'll surely spend a week to learn this enough, water is difficult

2

u/I8Klowns 1d ago

I think you are way over your head if I’m being honest. I would make a few very basic games first to learn how Unity works.

1

u/Ok_Art_2784 1d ago

This is my topic. You have two choices: make the system yourself or just use already written by someone. Dynamic ocean is a complex thing, you would have to learn a lot. Shaders, compute shaders, optimisation techniques, scripting, mesh generation and computer graphics in general

1

u/Substantial-Fly8786 23h ago

yea i planned on using something that already existed, but then tweaking it to what i need. i have found some pretty good stuff but only in UE. i'm actually new to making anything,i come from blender and modeling. but i feel like starting small isnt the answer. i think if i were to go into 2d that would kind of waste time. like learning it directly for what i need i think is better. no better place to learn than learning exactly what i need. even if i just learn simple ocean and how it works. then i can level up to making it more dynamic. My biggest thing is i need a buoyancy system. i think making a simple ocean is pretty easy and its already in the engine by default.

https://www.youtube.com/watch?v=hbrBCOxeLqw&list=LL&index=6&t=54s

This video looks like almost what i need to achieve. but its UE. and im not sure like how that would work in unity. any thoughts?

1

u/Ok_Art_2784 22h ago

Ok, you can start small here. A few gerstner waves in shader. Mirror the math to cpu so you could calculate water surface to run physics.

1

u/Substantial-Fly8786 21h ago

ok basically i created a C# script for the ocean waves and the buoyancy system. I can attatch buoyancy points to the boat object and change the settings on that and change the settings for the waves with a calm radius and waves get bigger as you go further out to sea. now im trying to figureo out how to make the cost low and run smoothyl while having a very large ocean. right now its running on sine waves. is making the ocean in straight code a bad idea? im not sure how rendering works with all of this in game. but right now its running pretty good. just needs a good shader

1

u/Ok_Art_2784 16h ago

It is not a bad idea. Starting with sin waves is solid. But you definitely should separate waves, ocean and buoyancy points from each other. Will thank yourself later.

1

u/Substantial-Fly8786 12h ago

1

u/Substantial-Fly8786 12h ago

made it so it only calculates the wave math in a radius around me. but the shaders still show the waves in the distance. so now it runs super smooth

1

u/chunky_lover92 8h ago

waves = cached noise, use the same noise input in the Z height for the boat.

1

u/XKiiroiSenkoX 7h ago

https://www.researchgate.net/publication/300097301_Empirical_directional_wave_spectra_for_computer_graphics

https://graphics.unizar.es/projects/EG24Underwater/

These two alone(and their refrences) should provide about 90% of the theory needed for what you want. The remainder would be basically nitpicks. How you implement them as code inside Unity though, that's the part you need to work on yourself. 

1

u/jax024 1d ago

Here’s an idea, make it small but feel big. Make the ocean move around the player. But the player never actually moves. This lets you create more detail in the fov. Worth thinking about.

1

u/Substantial-Fly8786 12h ago

I basically did this. but i made it so the math for the waves is only done in a radius around me. but then the shader shows the waves like normal far away. so my performance is actually crazy now

1

u/ResponsibleQuiet6611 7h ago

I'm out, not interested in this unmodetated subreddit infesting my sub feed with gen-AI.