The buoyancy component seems to cause a crash if you don’t replace the DefaultSceneRoot of an actor BP with something else. Maybe that was just me being stupid, but for instance, it can happen fairly easily if you create a new BP and then add something like a sphere/static mesh without manually setting it to be the scene root. This happens specifically in BuoyancyComponent.cpp line 48 (Begin Play):
35 void UBuoyancyComponent::BeginPlay()
.
.
47 SimulatingComponent = Cast<UPrimitiveComponent>(Owner->GetRootComponent());
48 check(SimulatingComponent);
Also, I’ve been running into some problems with waves been attenuated when I don’t want them to be (basically the attenuation depth setting not working as I expect/assume it to), and I’m wondering if I’m just being dumb and missing something or if it’s the water material. The biggest issue I am running into is that waves get attenuated unless I raise the water body thousands of units above the terrain, which is most apparent when using a heightmap or heavily sculpting the landscape. Besides waves, this also causes the blend materials to break down, and the rivers to not render speed/flow at all.
I’ve been digging through things like the WaterBodyData function a bit and have tried debugging the values for things like Water Z Height, Water Depth, and Terrain Z Height in hopes of getting a better understanding of the attenuation factor. I feel like I’m getting some strange values for some of those, like extremely large negative values for the Water Z Height (-10000 to -12000 usually), while the Terrain Z Height is correct (although sometimes also not). I know WaterBodyData uses Black_1x1_EXT_Texture as an input, filters it through HighQualityTextureFiltering, and then isolates the blue channel for the Water Z Height. Not sure if there’s something I’m missing there with that. If I just change the Water Z Height to be the blue channel of absolute world position, I get what I would expect to be the right value.
I assume what’s happening is with however I have it set up, it thinks my water body is way below the landscape and so it’s basically just maxing out the attenuation factor no matter what I set the attenuation depth value to.
Additionally, if I set up just a basic flat landscape and lake at z = 0, everything seems to work fine. Then, if I start moving the lake down, the waves start to get attenuated as I approach the default attenuation depth of 2048, with max attenuation happening at that value. But the tooltip for that Wave Attenuation Water Depth is “The depth at which waves start being attenuated.” Which to me means the waves will only begin to start being attenuated at that value, but it seems instead to be gradually attenuating the waves up to that value. The other problem I’m running into is the attenuation depth value working the opposite of how I would expect it to. For instance, if I bring the landscape and water body both back to z = 0, increasing the attenuation depth value will start attenuating waves until full attenuation at the max value of 10000. Whereas if I decrease it to zero, the waves start getting larger.
Sorry if any of that is confusing or worded poorly. I know this is all still being worked on too, but thought it might be worth sharing.