Skip to content

HydroThunderHurricane-Recompiled-v2.2.0

Latest

Choose a tag to compare

@visibou visibou released this 30 Oct 15:39

2.2.0 - Faster rendering

Faster

The GPU does about a quarter less work per frame in a race: 6.9 ms became 5.3 ms on the development PC (RTX 3050 laptop), on top of 2.1.0's gains. Since the start of this optimization work, GPU time per frame has roughly halved, from 10 ms. This matters most where the GPU is the limit, as on handhelds like the ROG Ally.

  • Textures the game renders to are loaded straight into the texture. Shadow maps, depth and other render-to-texture results used to be converted into a buffer, then copied into the texture. A new shader writes the texture directly.
  • Resolves read the render target directly. Copying a render target to memory used to go through a full copy of it into the emulated EDRAM first. For the formats this game resolves most, the copy now reads the render target itself.
  • Resolved textures don't get reloaded. When a resolve rewrites a whole texture, it now writes that texture too, so it isn't reloaded from memory right after.

Every change was checked by comparing frames with it on and off, and the image is identical down to the pixel.

If anything ever looks wrong, each change can be switched off in hydrothunder.toml: ht_direct_texture_load, ht_direct_resolve and ht_resolve_to_texture (all true by default). Please report it with a screenshot if you need to.

Performance

On the development PC, races went from 65 to 115 fps. The worst frame dropped from 36 ms to 20 ms, and the visible stutters (frames slower than 25 ms) went from about a hundred a minute to none. Part of that was a debug leftover that was slow mainly on that PC. The rest applies everywhere: GPU time per frame fell from 10 ms to 7 ms, which matters most on handhelds like the ROG Ally, where the GPU is the limit.

  • Clears no longer copy whole render targets. The game clears its shadow and depth buffers through a 4x MSAA view of memory it then draws into at 1x, and every clear made the renderer copy the whole buffer twice. Those clears are now drawn at 1x over the same memory. The output is pixel-identical.
  • Clears are measured at their real size instead of being assumed to cover the whole screen.
  • A leftover debug file write on every GPU memory fault is gone.
  • Less CPU work per draw. The game's memory copy runs natively, and GPU registers and shader constants are copied in bulk instead of one at a time.

Also new

  • The frame rate cap actually caps. "Capped" in F5 > Display now holds the game at the rate you set, even with tearing allowed. 30 and 40 are new presets. On a handheld, capping at a rate the game can always reach (60, or 40) is the smoothest choice.
  • Player name. F5 > Game > Player name sets the name the game calls you by, instead of "User".
  • The F6 overlay shows the game's real frame rate. It used to show how often the overlay itself redrew. With ht_gpu_perf = true in hydrothunder.toml it also shows GPU time per frame. Please include that when reporting performance.

Thanks to HydroThunderPORT, whose measurements and 4x-clear idea pointed the way.

Note that HydroThunderPORT is itself built on top of this project's 1.0 code: its own provenance.json lists this repository (github.com/visibou/htrecomp, commit ecae518) as the app it starts from. Its README does not credit this project anywhere. The recompilation, the game fixes and the features it inherited were done here first.