YW4 Recomp
YW4 Recomp · for developers

Advanced

How the port is put together: a map of the runtime's code that you can click through, and where to read more. For anyone reading or changing the code. You don't need any of this to play.

102modules in runtime/
2,040functions, with who calls whom
45,903lines of C

The runtime in eight areas

Lines of code in each, from the map's data

    Code map

    runtime/All modules

    All modules as a table

    How it was made. python -m tools.dev.code_map reads every .c, .cpp and .h file in runtime/src and runtime/include. A file and its header count as one module (gpu.c + gpu.h = gpu). Between modules, a line means one includes the other's header or names a function defined there. Between functions, a line means one names the other in its body: a call, or passing it as a function pointer. Calls through pointers at run time and calls inside macros are not seen. Not shown: the recompiled game code (made on your own computer at build time), shaders, the launcher and the Python tools.

    Where the frame time goes

    A snapshot from one PC: GPU time per pass, at high settings

    The snapshot hasn't been made yet: python -m tools.dev.bench.

    GPU time per pass

    Milliseconds per frame.

      • Ours
      • The game's
      • NVIDIA DLSS

      The shadow mask, in four forms

      Our shadow pass with soft and contact shadows on and off, timed in the same run (bamboo forest). Together they cost about 2 ms; how that splits between the two changes from one run to the next.

        Frame rate per scene

        At the settings above, and uncapped at the game's own 1600×900 with no anti-aliasing (there the CPU sets the limit)

        SceneFrames/sGPU ms per frameFrames/s uncapped, 1600×900

        More for developers

        The written side: how things work and why