[Community Project] WIP Weather & Water Shader

I have improved the audio: (EDIT: Improved it on OceanExampleMap_01 only)

  • Created new asset for submerged sound in Cubase, adapted from original ocean_water audio asset (built at 22050Hz - no need for any higher; mono; ogg size has thus reduced from 3344 to 566 for better performance)

  • Original ocean_water asset shortened (why was it 5 mins in the first place lol - down to ~2:30 and probably still longer than needed :wink: )

  • Audio Cues created for surface, submerged, and underwater bubbles (because we all like bubbles)

  • Bespoke attenuation volumes crafted for un-/submerged volumes, with respective audio assets attached

  • Third volume created for 4 bubble types which will play at randomised intervals and randomised pitch/volume - tested and refined (though perhaps a little too high pitched in places - please feedback. Randomised delay is between 2 and 6 seconds, on the basis that players won’t spend long underwater. With correct documentation, any user can change )

  • Crossfade articulated between surface volume (CUE_ocean_top) and subsurface volumes (CUE_bubbles; CUE_ocean_sub)

  • Audio Classes created and sound assets allocated: [ (Ambience {Ambient_SFX}) (Music) (Dialogue) (SFX)] - will help file structure

  • sounds moved from their original file location (Content/ShipsAndExamples/Audio) to Content/Audio - recommend moving cannon firing SFX into Content/Audio/ and allocating to SFX Audio Class, unless you plan on a strictly modular design

I’m not 100% happy with the crossfade between volumes and would prefer more overlap. However, if an animation is being added for entering/exiting the water then splash SFX would effectively mask the crossfade (splash could be 1-2 seconds easily, with its own fade out built in Cubase).

Let me know where to drop files if you’d like them :slight_smile:

Hv8nf4Dz3wI
(video might be a little quiet!)

Proposed:

  • Surface swimming (surface water being pushed and rippling: possibly 2-3 audio assets which can be layered and randomised in UE4)

  • Subsurface swimming (as above, but with LPF on the imported asset)

  • Splash SFX for entering water

  • Drip SFX for exiting water

I am more interested in determining how to allocate correct wave SFX to rendered waves. I believe that it should be possible to convert the data that informs the way the wave crosses over the dynamic material into an output that can be used to trigger audio assets and effect audio volume/attributes.

Example (assuming there’s a parameter for wave height, which I don’t think there is):

Wave height = 0–0.2 -> no additional audio assets called; ambience only
Wave height = 0.25↑ -> base layer called (probably white noise)
Wave height = 0.5↑ -> additional layer called (actual wave (representation))
Wave height = 0.75↑ -> cresting audio called [at whatever the tipping point actually is]
Wave height = 0.7↓ -> spray audio called
Wave height = 0.6↓ -> roll-off audio called (as wave breaks)
Wave height = 0.4↓ -> wave dissipates audio called (end of wave break)
Wave height <=0.2 -> no additional audio assets called; ambience only

With blending, which may be best built inside Cubase through applied fade in/out, the wave life/death can be rendered seamlessly. All I need is to know how to extract the data! From there, I can use UE4 or Wwise to interpret it and apply it :slight_smile:

The next problem is then how to render these sounds in-game: as ribbons of sound following the waveform, or presented locally to the player (could be difficult in multiplayer). Either way, I am certain (hopeful) that correct audio panning can be achieved through approach, meaning you can be standing sideways on to the waves and track them as they move left to right / right to left.

Using a similar approach, it should (should) also be possible to render effectively the submerged audio assets underneath the bulging wave part of the material, by inverting the coords (or whatever reference is applied) used to define the surface wave audio functions. would negate the need for rigid audio volumes that do not dynamically match the material’s shifting shape.

I would guess 18-22 audio assets overall (6 for waves; 4 bubbles; 2-6 player/character water movement; enter; exit; additional sprays and waves).

If the person(s) who created the material in the first place can contact me – or anyone who has an inkling on how to achieve what I’m looking to do – that would be fantastic.

Hey there concrete_buffalo :slight_smile: and welcome to the :stuck_out_tongue:

I have zero knowledge about audio in UE4 (I consider audio to be the last step in game dev, unless it’s an audio-based game), the sfx I added was just so the scene doesn’t feel that dull :p, it’s definitely not ā€œdoneā€, not by a long shot :stuck_out_tongue:

You are more than welcome to contribute of course! you can upload the files wherever it’s easier for you (personally I use google drive or mediafire to upload stuff) and eventually me or the other guys (, ) will add it to github.

Let me try to give some feedback and answer some of your questions… (long post btw!)

:eek: compression? nooo! my arch enemy!
When it comes to audio, I’m a quality nut :stuck_out_tongue: if it was up to me I would add uncompressed flac 7.1 support or some unnecessary thing like that… haha but that could be just me :wink:
Besides there is no performance to be gained by , it’s a single looping sound.

I wanted to make the file start playing at a random time point when you start the map so it sounds ā€œuniqueā€ every time but I don’t know how to do that (or if it’s even possible).
If you ask me, 5 minutes was already too short :stuck_out_tongue: my can already recognize sound patterns from hearing it many times :stuck_out_tongue:

I wanted to have all the ā€œextrasā€ such as ships, meshes, particles, sfx etc. into one separate folder in order to make the plugin more ā€œcleanā€ and easy to add to other projects, also more modular.

Eventually there will probably be 4 content folders, , Sky, Underwater, Extras etc. so you can easily copy/paste only the stuff your project needs.

I’m not a huge fan in having Audio, Materials, Meshes, Blueprints (etc.) as content folders because it doesn’t always make sense.
Cannon sfx should be at the relevant Cannon folder, right next to the cannon meshes and cannon materials for example (which means you then simply copy paste the cannons folder instead of files spread all over the place).

But I suppose that’s a personal preference :stuck_out_tongue: I don’t know, it feels much more organized and modular to me that way!

I have already added a way to get the wave height at a specific point with blueprints, check the level blueprint which uses method to toggle the underwater on/off.

For example…
You could make a bunch of test points that are following and spread around the player (or camera), and then you could play a sound depending on the wave height at each point.
Also you could read some of the variables from the manager (wave amplitude etc.) to determine if the is generally calm or rough.

I don’t think any game has ever used something like that :slight_smile: it would be cool to see what can be done with method.


Hey Le :slight_smile: welcome to the as well :wink:

Looks pretty cool! great job with the underwater post process and splashes :slight_smile:

Hey , thanks for replying :slight_smile:

Thanks for letting me wade in (pun intended) - it seems like a good project. I’ve literally just opened the blueprint for the material, and I see captioned threads and areas for (what I hope will be) the parts I think I’ll need :slight_smile: I’m very new to UE4 so is going to be a challenge, but I’m keen to do . I don’t think it’s been done before either :wink:

I’m kinda with you on compression and length, though it depends on the context. People aren’t likely to be standing around listening to the ambient sounds, they’re going to be background to other sound and visual action. Exploration games arguably have a greater need for longer sound files, but tbh if you have two or three 1 min loops and then sprinkle them with a bank of randomised sounds Ć” la Skyrim’s setup, it’ll be difficult to tell unless you’re actually listening out for repeats. It is personal though; in all my designs I like to have a sort of backdrop on which to layer the other sounds to create depth, which I know isn’t for lol No harm in having a long version and a short version in the same project though I guess! :slight_smile:

Yeah, your file structure makes more sense :slight_smile: If I want to move a ship I can move the ship’s folder - that’s *much *easier! I’m still learning :stuck_out_tongue:

I’m not sure how to do , but don’t tell me (haha) I’d like to try to figure it out :wink: I have a vague idea, but as I’m still getting to grips with blueprints I’m not yet familiar with what nodes go where, do what, and are the best to select. I will get there, or come for help if I get stuck.

Thanks to you and your team for opening the project up like - I’ve not done proper modding since UDK and System Shock 2. It’s nice to get back into it :smiley:

The material? :stuck_out_tongue: I don’t think you will find something useful in the material.

To get you started, is how you can read the wave height at a specific point in world space.

You can use in the character blueprint and run all the logic from there but it would probably be a good idea to make a separate OceanSoundManager blueprint to handle all that (for modularity purposes :p).

Have fun :wink:

Hullo folks! work on project so far. I started with Handkors tutorials, so I’m using the project more as a "how did they do " sort of thing and working from there… Trying to keep everything blueprint.

But I noticed in TKs Dev Project your boats seem to have a similar problem to mine, in that when you’re aboard them you can push them around from on deck. Which is a lot like pulling yourself up by your own bootstraps… I’ve been trying to find a way around , and to prevent the player (or physics objects) from sliding around unrealistically in general (which is inconsistently a problem). But so far no dice. Was curious if you guys could offer any advice or anything.

is the sort of thing I’m having issues with: BONEHEAD — Buoyancy is pretty much working properly now.Ā  The...
Toward the end of the video.

Thanks again for the work you guys have done, it’s been a lot of fun to follow/stumble around with.

Yeah… even if I disable ā€œEnable Physics Interactionā€ in the CharacterMovement component I can kinda still push the small ship around if I walk at the right spot (could be a bug).

Unfortunately the CharacterMovement is not great for every game… the only solution I can see right now is to code a custom CharacterMovement component.

But the problem in my branch is not as obvious as in your video :stuck_out_tongue: maybe try to increase the ship mass?

I think I have found a solution for the edge foam. Will update soon.

I did, and it doesn’t really seem to make a difference in direct collisions. The problem is much more noticeable if you push against the ships movement. Get the boat going and while it’s moving forward run into the front of the cabin it’ll tank. Maybe my ship just has more opportunities to collide with the player…

What I was thinking might work is encasing the entire walkable surface in a trigger that when overlapped attaches the player to the boat (to combat the sliding I get occasionally - which is another thing that worries me: it needs to work consistently gameplay-wise). But the triggers movement seems to cause it to toggle on and off endlessly, and if I work around I end up getting double transforms on the player instead.

Would be nice to find a work around somehow. Didn’t plan on making a new character controller. I’ll post if I figure anything out.

You can try attaching the player to the boat but that will probably not change anything (but you can try?)

What we need (I think) is an accurate way to tell the movement component ā€œhey!! you are colliding with an immovable object at angle… stop trying to add velocity to the player!ā€ but that’s easier said than done :stuck_out_tongue:

That functionality already exists in the CharacterMovement as far as I can tell but it’s obviously not perfect (more like, it wasn’t designed with ships in mind :p)

Haha I meant BP_ocean :stuck_out_tongue:

I appreciate the starting point you gave, but there elements to it that I don’t understand (:p). Rather than PM’ing you I thought I’d message on here, in case I’m not the only one looking at …

Please tell me if I’m reading your starting point correctly:

1&2. Identifies BP_ocean and instructs UE4 that whatever we do applies to all BP_ocean instances; 3. checking if the object BP_ocean can be used; 4. casting the object BP_ocean to the Manager (is that right? if so, I’m assuming is because Manager and BP_ocean are separate entities); 5. pull/get data about wave height from Manager at a specified point; 6. return the wave height value as a z coordinate.

Or, sort of in reverse: at the player’s location, extract the z value for BP_ocean being operated by Manager.

I am specifying the player point by using Get Player Character –> Get Actor Location.

My thinking is that the next step(s) should be:

If z coord is < x then Play Sound #1.
If z coord is > x then Play Sound #2.
If z coord is > x+y then Play Sound #3…

At the moment, I’m trying to set up to produce a text string value, just for testing, but it consistently returns 0.0 as the value during Play :confused: Obviously, my logic or execution is wrong somewhere :frowning:

However (lol) I have an additional question (because I’m like that :p). Is the Get Wave Height Value function referring to the Amplitude parameter in the Manager’s Global Wave Settings? Or is it referring to the z value, that I can see bobbing up and down in wireframe mode? :slight_smile:

I can see possibilities for engaging the entire weather system based on wave amplitude, steepness, and wave speed. Modular users select ā€˜Calm’ or ā€˜Tempest’ and get consistent dynamic results for behaviour, weather type, lighting, fog, wind, and sound. Not sure if is planned or already a part of your concept (I haven’t read all your posts, eep :o)

GetAllActorsOfClass returns an array with all the actors (of the specified class) that currently exists in the level.
Since there should only be one BP_Ocean in the level, we use the Get(0) node which returns the first element of that array. Then we have to check if it’s actually valid just in case there is actually no BP_Ocean in the level (you will get an accessed null error otherwise) :stuck_out_tongue:

We have to cast it to BP_Ocean type because the array that GetAllActorsOfClass returns is the base ā€œActorā€ class (which means we can’t access any of the specific parameters or functions that the OceanManager class has).
Then we call the GetWaveHeightValue function which does some math to determine what is the Z height of the wave at that world location (you can use DrawDebugSphere node to visualize the returned value).

The Z of the GetWaveHeightValue returns 0? that’s weird… try to determine which part doesn’t work (for example does the GetActorLocation return the proper player coordinates?)
I’m assuming you already know you have to plug some event (like the tick event, or a button event) to execute the nodes :stuck_out_tongue:

It’s referring to the Z value of the plane that you can see bobbing up and down :stuck_out_tongue: but the intensity of the waves are based on the Amplitude parameter so if the Amplitude is zero (calm ) it will return just the base height of the .

I had a similar using VAOcean and I messed with pretty much everything in-engine I could find but the persisted. Just walking into a particular spot could launch the boat.

My solution of sorts was disabling the pawn’s collision with the boat itself and creating an invisible pawn colliding static plane that continuously moved it’s position to follow the boat’s last updated position. Not perfect but it worked, from there you could work further with it, maybe have a static non-rendered version of the boat as a pawn collision ā€˜ghost’ following the boat. Sadly disables the pawn’s direct interaction with the boat mesh but it’s something.

Sorry if doesn’t help, it was done under VAOcean’s buoyancy system which might work differently, but the way you described it it seemed like the same.

That might work. I don’t need the player to interact with the boat directly anyway. I’ll give it a whirl and see what happens.
Edit: Worked absolutely perfectly. Minor minor clipping, but that’s easily fixed by moving the collision ghost forward a few centimeters. Thanks a ton.

Hello !

Great plugin with cool effect and usability, congratulation to all.

I have a problem with buoyancy object. I try to use your BP_buoActor in my level. I’ve placed the BP, setup it, and when I put the Actor on it, with 4 points collision and the average same parameters like in your test scene, and something strange happens, the actor just elevate to a certain point, and reverse itself, then seems to buoyance at point… What am I doing wrong ?

Here is a screen of my pb :

Thanks !

Hey ,

These post process materials are . Will you be sharing them for the ?

If you are using the branch then make sure your plane is at 0 Z, if you need to move the plane then use the TK branch for now, it’s a bit more updated.

It’s actually very simple.

Note: I currently don’t have the project right now but my rain setup is very similar

Rain/ Water drops:


Underwater Distortion/Heat:


You can see them in action right here:

Rain:
nAlgg8zg1CA

Heat:

watch?v=08XGwp-xE0o

Those above will be used in my commercial project.

P/S: I tend to avoid using Scene Color because it disables any kind of DoF.

Another question, with Tk branch.

I need to have two in the same level, one for calm water, and another for a torrent, with different parameters. But actually when I place my seconde and setup it, it modifie the result of the first too… Is there any possibility to use 2 oceans in the same level ?

Thanks !

It’s ok i found a solution to have multiple in the same level :smiley:

** Le** - those look . Thanks for sharing your water drop effect :slight_smile:

**** - :slight_smile: is going to be a summary of my action as I work along, so sorry if it’s too long. As a newbie to BPs I’m as much interested as learning how to use them, rather than just learning what I can do with them - seeing how other people arrive at their conclusions has been more helpful than what they were actually trying to achieve. For me, anyway :slight_smile:

As you’ll no doubt easily see, the BP in the screenshot below nets me a true/false printout, depending on the value of the z axis (>300). (or some other value) will be a trigger for the sound.

However, z’s peak value isn’t static. Standing at the spawnpoint on the jetty, I get a high of about 352 and a low of around -352. At the end of the jetty, by the galleon (cool word), I get about 130 and -130 respectively. Stepping off the jetty at the galleon end, and hitting the sea floor I get about 100 and -100 which alters through buoyancy…

I thought that might be because the player z position was effecting the reference for the wave height, but after testing that out by using only the player’s x position to define their location I can see that’s not it either.

I also get a wave height value even if I’m not actually over the wave mesh:

My current thinking is to cast a ray down from the player, in a similar manner to the way I was going to test out making footsteps for the wood and beach surfaces. can then collide with anything that’s not Ocean_BP and stop the wave sound! [EDIT: I haven’t included a filter for yet.]

If I understand raycasting correctly, I will also be able to get a more natural shoreline sound effect by allowing the raycast to pass through the Ocean_BP, hitting the beach mesh and, depending on the distance between the two in z, trigger a gentler lapping sound, with attenuation on the more distant waves causing them to fade into the background. will necessitate an overlap between the Ocean_BP mesh and other meshes, but should allow for better aural realisation of fluid contacts (e.g. a raft’s edges or, with some small xy denomination, the galleons and other larger objects who intersect the water vertically in relation to the player). [EDIT: is an idea for later…]

BP provides values of around 700-odd positive and negative consistently throughout the map:

Posting now, and will test the sounds in a moment - putting the finishing touches on some football armour in preparation for a Mad Max theme party weekend :wink:

[EDIT: I still get a waveheight reading when I’m not on top of the Ocean_BP (without filtering for objects), which puzzles me. What could it be referencing, and what part of my BP is causing ? :/]