I Made Ocean Waves and Buoyancy in Godot

Поділитися
Вставка
  • Опубліковано 6 січ 2025

КОМЕНТАРІ • 55

  • @nathanelrod2703
    @nathanelrod2703 3 роки тому +25

    I worked really hard for 2 months to create something like this. I got discouraged by the issue with estimating the waves and gave up. I love to see a tutorial or even just see your code to see how you over came some of the same issues I saw.
    Super impressive work.

    • @xen-42
      @xen-42  3 роки тому +2

      Cheers! I'll try to get a tutorial up as one of my next videos. There are a few more things I want to work out with the code before I share it, but I'll be sure to put it on github once I clean it up more and improve the wave height approximation

  • @JohnnyThund3r
    @JohnnyThund3r 3 місяці тому

    Your messy code is saving me a lot of time!
    I'm trying to figure out how to make an accurate submarine simulation, and resources like this give me a good jumping off point!

    • @xen-42
      @xen-42  3 місяці тому +1

      Happy to hear it can still be of use!

  • @addmix
    @addmix 2 роки тому +4

    One thing I notice about a lot of games waves, (mainly Stormworks), when a wave comes over your vehicle or player, it only considers buoyancy forces, and ignores all fluid-velocity related forces.

    • @xen-42
      @xen-42  2 роки тому

      Makes sense. I have no idea what the best way to do that would be

    • @addmix
      @addmix 2 роки тому

      @@xen-42 it would be an aerodynamic calculation on the buoyant objects, maybe I'll see about contributing to your waves project to add it.

    • @mariegrasmeier9499
      @mariegrasmeier9499 Рік тому

      Guess it does not need to be super accurate. If so: for cargo securing at sea ships, we usually assume 1kN per square meter for the impact force of sea sloshing. Maybe you can just use a fraction depending on wave height/wind speed and use 1kN for super bad weather.
      Just an idea to approximate it without boiling your computer

    • @addmix
      @addmix Рік тому

      @@mariegrasmeier9499 well, it basically just turns into simple mass deflection aerodynamics.

  • @juliettegeo5002
    @juliettegeo5002 3 роки тому +5

    Thank you for the sea sickness warning very cool

    • @xen-42
      @xen-42  3 роки тому +1

      Ofc happy to help

  • @malahamavet
    @malahamavet 4 місяці тому

    this was very entertaining
    I'll check your channel and you better have a part 2 in there
    cause I like this sea of thieves madness you got going on here

  • @SofiaStar1463
    @SofiaStar1463 3 роки тому +6

    Love how the boat spins into the air, like a ballerina , hahaha
    4:02

    • @xen-42
      @xen-42  3 роки тому +1

      It's very realistic!

    • @SofiaStar1463
      @SofiaStar1463 3 роки тому

      @@xen-42 yeah, I always have to be so careful not to get hit by those spinning boats when I'm at the beach! 🤣👍

  • @harrygeoffrion4520
    @harrygeoffrion4520 3 роки тому +5

    People calculating the Archimedes' principle: *stupid*
    Xen slapping some buoyant objects on the underside: *chad*

    • @industrialdonut7681
      @industrialdonut7681 3 роки тому +1

      archimedes wouldn't give a proper buoyancy *vector* that actually changes depending on the tilt of the ship in the water and such though, it's simply the magnitude of the buoyancy on an object

  • @laky2k866
    @laky2k866 3 роки тому +6

    Nice video! Would be interesting to use this in for example the Minecraft Godot thing :D

    • @xen-42
      @xen-42  3 роки тому

      Definitely! I had considered it for this video but felt I should just focus more on the waves here

  • @indieology7336
    @indieology7336 3 роки тому +1

    Awesome video!

    • @xen-42
      @xen-42  3 роки тому +1

      Glad you thought so!

  • @jaws8621
    @jaws8621 2 роки тому +1

    Really funny and interesting, thanks.

    • @xen-42
      @xen-42  2 роки тому

      Thank you! I'm glad you enjoyed it

  • @zareth1226
    @zareth1226 2 роки тому +1

    When they say you will never use maths irl

    • @xen-42
      @xen-42  2 роки тому

      a^2 + b^2 = c^2

  • @giantfrogstudios839
    @giantfrogstudios839 Рік тому +1

    How do you prevent the waves from washing through the boat like that?

    • @xen-42
      @xen-42  Рік тому

      They do actually wash through unfortunately, the ship just isn't very deep and follows the waves well enough that you don't really see it. You have to do weird shader stuff to actually prevent the waves showing inside

  • @forgeflarion8362
    @forgeflarion8362 3 роки тому +1

    Cool video

    • @xen-42
      @xen-42  3 роки тому +1

      Thank you!

  • @theM4R4T
    @theM4R4T 3 роки тому

    Was trying to make the same thing. The fact that the shader can't interact with objects and vice versa is frustrating, cause to make an immersive ocean there need to be variable wave height and speed and wind direction.

    • @xen-42
      @xen-42  3 роки тому

      Yeah it's pretty annoying, you just have to have the same algorithm running in two places and just make sure it stays synced

  • @AnKlMa
    @AnKlMa 2 роки тому +1

    Will you still be uploading a tutorial on this by any chance?

    • @xen-42
      @xen-42  2 роки тому +1

      Thanks for reminding me, I really need to get around to it. I'm just not 100% happy with the buoyancy code because its technically slightly off (altho not really noticeable) but I haven't taken the time to find a better way to do it.

  • @rickland1810
    @rickland1810 2 роки тому +1

    Amazing work.
    Could you please share your code? I'm trying to do something similar and I'm struggling with the shader.

    • @xen-42
      @xen-42  2 роки тому +1

      Here you go, will also update the description to link it: github.com/xen-42/godot-waves-buoyancy

    • @rickland1810
      @rickland1810 2 роки тому

      @@xen-42 Thanks!

  • @randomboy2004
    @randomboy2004 3 роки тому +1

    Hey can you continue minecraft godot : but this time you add cave system . Not just any cave but actual cave with eco system kinda stuff

    • @xen-42
      @xen-42  3 роки тому

      I might do a cave video some day. What do you mean by with an eco system?

    • @randomboy2004
      @randomboy2004 3 роки тому

      @@xen-42 sorry i meant improved like big cave instead of looking like "drilling the chunk" and called it cave

  • @extremehyperventilation4377
    @extremehyperventilation4377 3 роки тому +3

    Did you use spatial nodes for buoyancy?

    • @xen-42
      @xen-42  3 роки тому

      Yep, and had them be children of a rigid body. In the spatial noise process function I'd check if they were below the wave height and then add a force to the parent rigid body at the position of the spatial noise

  • @marc.lepage
    @marc.lepage Рік тому

    Sweet.

  • @ghowstcrafter9201
    @ghowstcrafter9201 3 роки тому +3

    pls give source code

    • @xen-42
      @xen-42  3 роки тому +2

      I will once I am able to rewrite it to make it better and clearer

  • @mariegrasmeier9499
    @mariegrasmeier9499 Рік тому

    Tried this in unity 3d. It worked until I used it on a big ship. Started flying and spinning.
    Will think about the global/local thing you mentioned and try again.
    Thank you so much for the hint

    • @xen-42
      @xen-42  Рік тому

      Hope it ends up being helpful!

  • @WellSwolen69
    @WellSwolen69 6 місяців тому

    Why is UA-cam recommending old tutorials that are most likely out of date?

    • @xen-42
      @xen-42  6 місяців тому +1

      This isn't a tutorial so idk!

  • @waporwave5066
    @waporwave5066 2 роки тому +1

    Global coordinates?!?! "world coord offset"?!?! IT TAKES A LOCAL COORDINATE
    AND YOUR TAKING FOREVER TO FIND THAT OUT MADE ME TAKE FOREVER TO FIND IT OUT THAT YOU WERE WRONG!!!!!!!

    • @xen-42
      @xen-42  2 роки тому +1

      big mood

    • @waporwave5066
      @waporwave5066 2 роки тому

      @@xen-42 i have formally apoligize, apparently it's the rotation that's in global coordinates 😔😔and this took me forever to find out too😔😔😔 you could have been more clear tho

    • @xen-42
      @xen-42  2 роки тому

      sry