Download

[Community Project] WIP Weather & Ocean Water Shader

I had some free time tonight and I rewrote the OceanManager to be 100% Blueprint. I’ve also created a BuoyancyComponent with the new ActorComponents. I just need to finish the applying the buoyancy forces to the objects and the 100% blueprint version will be complete.

Another Canadian eh! We will be known as the Canadian Ocean Team lol! Are you going to share that? I’m a visual learner and would love seeing all the blueprints to get up to speed on this project so I can start tinkering with underwater fluid dynamics and addons. Been so busy modelling some ships I havnt gotten around to even opening the project yet.

I’d like to share it but It looks like I am going to have to recreate everything again. The project keeps giving me external reference errors when I place an pawn with the buoyancy component in the map it is then preventing me from saving the map. I’m thinking it was caused from migrating some of the old blueprints that were referencing the code OceanManager but I can’t seem to be able to shake the reference. I just tried to Fix References on the folder and just sent the engine in an infinite loop. Other than that the components works and I made a cube float.

This reference thing is weird. It goes away when I reopen the project but comes back as I edit the BuoyancyComponent. It does not always come back immediately though.

Anyway I just did some performance testing and the C++ version 1 or 24 object the framerate is the same. The Blueprint version 12 object cuts the framerate in half and 24 cuts it in quarters. This seems to be too much math for the Blueprint system to handle.

Maybe we can reduce the number of calculations in Blueprint by using a multiple Blueprint approach with some calculative C++, or just add more Blueprints to support the load on one of the blueprints. In C++ you perform the calculation needed for the Gerstner wave. But then pull variables created from the C++ into the blueprint.(Now I have seen you doing this already in C++ and using variables in the BP but I’m trying to think of a way to reduce the overall math in the one or more BP.) I run into the same frame rate issue when I attach my AI script to one Character BP. I instead have to make new Blueprints to reduce the number of functions on the one blueprint.

For instance the P(x,y,t)= [x+sum(QA *D.*cos(x,y) + pt)), y+sum(QA *D.*cos(x,y) + pt)), sum(A sin(x,y)+pt))] can be used In C++ to carry out some sort of background calculation and then pulled into the blueprint using created variables. Then we make a Calculation Blueprint that takes these variables and just calculates variables for use in other blueprints. It sounds like building more structure to the blueprint can help lower the load on the blueprint system for one or more of your blueprints. Let me know if this helps.

Or you can write everything in C++, compute shaders and provide blueprints as an interface solution :slight_smile:

Yeah, if it’s not 100% Blueprint then might as well keep the C++ I already have. At least now I know the impact of doing this in blueprint. I also ended up doing dome refactoring/simplifications when converting that I will apply to the C++.

Have you tried splitting up some of the Blueprint and using event dispatchers or even the blackboard system? I’m not against the idea for C++ if it lowers the frame rate, but maybe we are looking at using the blueprint system improperly for the scope of the project. Also sorry about the Kandkor, I corrected it in my video.

Wow, so it’s confirmed then. I thought I was doing something wrong when I used BP in the past with similar performance, that’s crazy!

For example I can’t imagine calculating FFT on blueprints for large (at least 512x512) displacement maps without killing performance completely. :slight_smile:

P.S. Do you have a list of programming tasks for your project?

Hey man, wasn’t able to make the last Siggraph, but hoping to go to the next! Funny how Canadians seem to be obsessed with water, eh? :wink:

As far as you project goes, please do what is best for you. I would love to have you work on this project as well but I don’t want to get in the way of your game whatsoever. So you do what is best for you okay? I totally understand either way. :slight_smile:

Looking good Avolanty! :slight_smile:

Looks like we won’t be going to blueprints only in the next version, there are some performance issues currently. I will be uploading a 4.7 version (and a new 4.6 version) asap though.

Well, we can make do with the C++ if Blueprint cant handle the math. I’m just glad its working for you guys. I would like the idea of a Blueprint version for Buoyancy but I would not want to sacrifice performance at the cost of nice Blueprint format.

Hey LUX,

That implementation is actually my own, and I will be releasing it to this project very soon, so sit tight :wink:

I tried Unity 5. Its nice compared to Unity 4 but it was CLEARLY rushed out the door the second they heard UE4 was going free. Its unpolished, unfinished, buggy, etc. and SLOW, the editor is fast I like Unity for that aspect, but the performance sucks I mean. A single cube on a plane with no HDR, no AA and highest detail settings otherwise with their global illumination (which is no better looking than UE4’s lighting so far) I was getting 66 fps! Before I would get nearly 200! In UE4 a similar setup nets me 110-130.

I’m willing to code some things in C++ once I start learning the UE API. Anything you need code wise just ask! Otherwise once I finally get my models ready and my co-founder up to speed on UE to start playing around on my project I’ll start making additions on a GitHub (or yours if you set it up soon).

Not to hijack the thread but does anyone have any game title ideas for our game? A cold war era submarine simulator like Silent Hunter 4&5 but vs Russia instead of Japan/Germany. Red Waters is the only thing I can think of. Any suggestions would be welcomed.

I hope the 4.7.2 update doesnt break more things…

Here is the 100% Blueprint version for anyone to play with. I may have done something stupid which would explain the performance as this was done quickly last night. Performance aside though if anybody just needs a couple of actors to float, this solution is at least more portable.

Buoyancy 100% Blueprint Implementation

Thank you for your work and contribution. I will play with it this weekend with the submarine im finishing up if no one puts together any updated versions by then. Got the hull and sail done. Just need to model and animate the moving parts now.

For your project it would be worth changing the Test Points for buoyancy to a struct with the buoyancy factor applied at each point instead of globally. That way you could simulate ballast and leave the sub neutrally buoyant except at the ballast’s locations allowing you to control each one to sink or rise.

I am currently getting AI to work with the Buoyancy and I will also play with your Blueprint Buoyancy. 4.7 correct? If Nsomnia is interested I have Rigging and Animation experience and can easily get your model rigged and good to go for animation using Maya. Just ask and we can share the FBX :slight_smile: Or if you want enemy subs that patrol with the Buoyancy effect(not sure where your at with that) I can share my work. Nsomnia I notice your Sub is very high poly, are you making a movie, or a game? I feel like you can greatly reduce the amount of topology and improve performance by simplifying the mesh and it will still look just as good. Are you using back-face culling?

Hmm never thought about that. I’ve used various methods to “simulate” ballast and negative tanks (the negative tank is filled with water for a fast dive, and then blown full of air (water in the tank is equal to the weight required to keep her neutrally buoyant) so that the sub is just a tiny, tiny bit positively buoyant when submerged which the planes (the wings) compensate for with a tiny tiny bit of angle up to keep perfect depth).

Jotting that idea down. I’ve had issues in the past with Unity using the typical slice n dice and then raycast from the waters surface and apply force method before. Unless I set the center of mass really really low round hulled ships like to tip over in the smallest of waves.

I’m always looking for team-members but the moveable surfaces are static right now. They arn’t even properly modelled. Check out my github and thread in my siggy see if anything intrests you. I’ve taken on people for things I hate doing like character modelling for free or just a small 50 dollars in your pocket favor-payment but so far just me and some off-site coders and artists. [EMAIL=“info@blendertek.com”]info@blendertek.com skype blendertek or steam nsomnia if you do wanna talk. Yes, blender uses back-face culling by default, I own Maya but dont know how it works that way. And no I have not optomized it yet for ingame, it will be for cutscenes then I’m gonna cut down every quad I can to get it down a bit. Currently sitting at around 11k tris.

Current game status: nothing. I havn’t even begun to port my old U-boat work over from unity since its all in c# scripts. I want to start fresh with blueprinting and c++ as I’ve become a much better coder and developer since then. So far its just some models, some ideas, enough reference material to blow your head off and alot of free time, I’m in talks on a submarine game forum with a fellow member who might join me now that UE is free since he is a Unity guy and in regards to the grant I want the interior of the ship to be nearly like an arch-viz, video talks with the vetern crew members that have helped me etc.

Sorry about the off topic!