Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Infinite Oceans w/ underwater For Naval Sim

Discussion in 'General Discussion' started by Nsomnia, Feb 1, 2015.

  1. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    What would the best way to create infinite oceans with an underwater view with waves, etc. I tried Tritons demo and could barley get any decent physics results from my models however the system they use is *almost* useable overall, because buoyancy I can figure out and theres lots of examples and assets on.

    I was creating a new WWII UBoat simulator (last one by Ubisoft was in 2010) but realized a fellow sub simulator fan has been working on one since 2010 so wanting to be unique I decided to create the one part of that genre thats missing: Cold War Submarine Simulation.

    I've bought video courses on infinite terrain generation using perlin noise and voxels and such but of course I can hardly see how that would apply to water and it wasnt a very good course anyways, more of an overview.

    All water systems (except Triton oceans) that I've come across we all know just use an ocean shader and if your lucky you can script some basic waves.

    I'm starting to lean towards scrapping Unity and C# to move onto UE4 (havnt because I havn't learnt c++ yet) since I think it would be easier in the end, once I learnt c++.

    I know this is alot of forward future thinking but any tips? Im more of a modeller than a game designer but this is my dream side project and I work from home so I have infinite amount of time to work on it.

    Games like stranded deep, if I they said hey heres all our source code have a nice day. I'd be a happy man. Their oceans, underwater scenes, and weather system looks great but they are a large team by Unity standards.

    I should mention the boat physics and simulation I've got down from studying documentarys, books, code, Silent Hunter etc. but its the infinite dynamic oceans that get me. If anyones played Silent Hunter 5 you know what I'm looking for (essentially).

    The community ocean shader project has some nice underwater looks that I'm sure I could work with but its really out of date. I've been toying with some of the vesrions in there and it seems with some effort, it may be my best bet, sticking within Unity that is. Heck the underwater is more important than above, its a sub afterall.

    Thanks.
     
    Last edited: Feb 1, 2015
  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Ideally you would have an underwater shader with a nice distortion filter effect along with caustics and light beams.

    But you can probably as an interim try a fog volume for underwater, as well as a simple trigger to switch the lighting when you submerge. Caustics you should be able to simulate with an animated projector. Unity has a light ray filter.

    In theory you should be able to pull together a decent looking set of effects that will work until you find a proper underwater shader solution. For shaders it's sometimes a good idea to check out GPU gems.

    Here's an amazing set of resource information on Water Shaders http://www.digitalrune.com/Support/Blog/tabid/719/EntryId/208/Water-Rendering-Resources.aspx
     
  3. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    Thanks for the link some good reading in there... A LOT of it. Bookmarked, downloaded and saved. Thank you.

    I'm keeping an eye on Head@Hunter to see if hes going to release his latest version of the Community ocean project it looks perfect and very adaptable. I'm lucky in that I can visualize others peoples code and structure well and reapply it for my own needs. I'n the meantime I'll continue working on my models and doing some reading.

    That all makes sense. I guess its the infinite part that gets me a little confused as to how Ubisoft does it in Silent Hunter or C10 or whateer his username is in Wolves of the Alantic (WOTA). 1-4 tiles to the horizon that translate with the player object, and any spawning enemy ships?


    I just purchased a good c++ intro book so in a couple weeks I'll see if that is the language for me and if moving to UE4 or something like Typhoon is a good idea, when I compiled UE4 I was amazed at how good it looked out of the box, but couldnt get any further due to lack of any C++ or C knowledge. Scrapping all the code I've already put into my U-boat stuff would be a shame but no reason I cant re-code it in c++.
     
  4. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    C# and C++ are syntactically similar but the Unity and Unreal API's differ quite a bit so in theory you should be able to port some of your scripts between the two.
     
  5. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    Exactly my thinking. Thanks again for the link, going to be a day (or week) of reading.
     
  6. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    I wonder how hard it would be to write your own game engine like Ubisoft did for the silent hunter series. or SCS software. Such a long shot but Unity needs alot of work for proper water physics and UE4 is so dedicated to FPS and 3rdPS.


    Way too complicated though. No degree in computer sciences here.
     
    Last edited: Feb 1, 2015
  7. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,681
    VIC20 like the Commodore VIC20… and since 2009 not 2010, 6 years at full time and still not finished :-(

    It is all custom. I don't use any standard shaders from Unity or 3rd party assets except for the sky colors (but even this asset is customized for my needs and to work with my custom global illumination system).
    It makes no sense to switch the engine. Unity offers everything you need to CREATE what you want.
    The water in my project is a single mesh its size depends on the current altitude of the camera, so the size of the mesh always fits to the possible viewing distance. Water and ships always take curvature of the earth into account.
    You want/need something that works perfectly together anyway, so don't think about prepared solutions, it is a waste of time - what you need is something that works at any weather and all light conditions: ships, clouds, underwater color, water color, sea state etc. - the look of it always depends on something else. No generic asset will offer that.
    You basically write an environmental engine inside the Unity engine.
     
    ZJP likes this.
  8. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,681
    Next thing you need is your own water physics. No one will offer you what you need.
    You need to calculate what's physically going on inside the ballast tanks, This was pretty crazy stuff but I'm not a genius, so everyone can do that, all you need is time and will and a lot of literature.
    And the other hydrodynamic things. You need to calculate what ship builders try to estimate with their formulas just in the opposite way (unfortunately there is no golden formula for that but many different equations for different types of ships in many different variants and you will often meet the chicken-and-egg problem). My Type VII U-Boat always automatically matches original real world test results by 90% which is pretty good (acceleration, turning diameter at different speeds and rudder settings - but I also had to simulate the whole propulsion system for that like the diesel engine, shaft and propeller).

    Creating such a game is a very complex task. I had to learn a lot of completely different things.
     
    Last edited: Feb 2, 2015
    ZJP likes this.
  9. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    With so much information on post 1945 submarine technology being available (not to mention the fact that record keeping and technology allowed for better data from 1945-1991) I feel it'll be easier to get real world simulation results.

    I agree im sticking with Unity for now but I work from home I have 16 hours a day to do whatever I want if I want to. I'm gonna learn c++ now that I've got c# under control.

    I understand about the water physics, it was tough getting a u-boat to turn realistically, I own a boat and tried to compare the "feeling" of piloting it vs in game and its hard to re-create.
     
  10. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    I should've asked about teaming up with you before I started this project. I assume your wary like me to take random people on, and it seems everyone is about money now, instant gratification.

    Been playing around with some of my code and the community ocean project. Got some nice stuff to work with. And now that all these vets have given me photos and drawings of this ship im working on, It will be a much faster model.

    Still open to suggestions and idea though. I like ocean4 cause its code is well commended and offically supported, I like the community ocean project cause its open source and very flexible, I like triton cause its beautiful and has everything you need but its completely closed source and expensive.
     
  11. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,681
    I can't work in teams anyway. I hate the code other people write. What most people would call chaos and spaghetti looks easy for me and what they call easy and maintainable looks like a terrible style for me. Triton isn't expensive, most of the other assets are ridiculous underpriced. When you make a game about ships and use Triton then the visible core of your game is Triton.
     
    chingwa likes this.
  12. DizzyTornado

    DizzyTornado

    Joined:
    Nov 17, 2013
    Posts:
    134
  13. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    Thank you I heard about scrawks oceans but never found them. Have to see if I can incorporate it in anyway.