[fix first added with v1.1.0; improved with v1.1.1]

Sometimes, when you're swimming underwater, you'll hear the noises that play when the camera exits and enters water. In rare cases, you may see the screen flash, using the above-water visuals and lighting for just an instant. If you swim for long distances (shoutout to Waterbreathing), you'll experience these bugs periodically. In fact, the problem occurs whenever the camera passes a cell boundary (outdoor spaces are split into grid cells) while underwater: the game seems to think that the camera has exited the water for a single frame, or perhaps even more briefly than that.

I don't know entirely why this bug occurs, but I've managed to improve my understanding a bit.

Your camera has what's called a bhkRigidBody -- that is, the camera is physics-simulated, which makes sense, since Bethesda doesn't want it going through walls. Water is also physics-simulated, with special Havok physics types: one for placeable water, one for waterfalls, and one for "auto" water (outdoor cells' water, created automatically when a cell loads).

Code inside of these water physics is responsible for signalling when the player has entered or exited the water or its general airspace, it seems. What happens to your character is a fusion of Havok physics and Bethesda's code: it's Bethesda's code, not the physics, which decides that you are "underwater," and that you should swim and (potentially) drown. Bethesda's code doesn't constantly check your collision against every patch of water. Instead, whenever you cross a cell boundary, the Havok side of things signals to Bethesda's code that you've entered the general airspace of a patch of water, and Bethesda in turn keeps track of the height of the water closest to you; then, every frame, your position is checked against that height. (It's more complicated than that; this is sort of a lie-to-children.)

What would happen if the game didn't run this process? Well, that depends on where you are. Outdoor cells can have different water heights; this is commonly used with waterfalls, where the cell on one side of the waterfall has a higher water height and the cell on the other side has a lower height. The same process that causes the underwater ambience bug is also responsible for ensuring that you adapt properly to these changing water heights. If that code doesn't run, then when you move from the high-water side to the low-water side, your character will still behave as if the water is at the high water height... allowing you to swim through the air, if your position is at or below the high-side water height.

So how does the underwater ambience bug occur? Well, this "you have changed cells" water code does two things:

1. It tells the game to halt all underwater ambience immediately. (My guess is that Bethesda figured: if you're still underwater, then we'll just start it again, right? The underwater sound stop/start was probably an oversight.)

2. It tells your character model what the height of the water above/beneath it is.

3. It does... probably a bunch of complicated math and physics stuff.

In Cobb Bug Fixes v1.1.1, we alter that first step: instead of halting the underwater ambience, we check your camera height against the cell water height (going by cell data, not physics data).

(In Cobb Bug Fixes v1.1.0, I actually got it wrong and skipped the check entirely. Then, someone told me about the craziest bug they were seeing near the waterfalls from Riverwood to Whiterun...)

Article information

Added on

Edited on

Written by

DavidJCobb

0 comments

Top