12

I'm not a game dev so please forgive me if this is the wrong place for this type of question but I'm looking for some resources to try and understand why games take so long to compile.

For context, I've worked with former game devs who've mentioned that builds can take anywhere from 4 to 6 hours to complete - even with a distributed architecture - depending on the hardware. That shit blew my mind. They said it has something to do with compiling shader permutations but didn't go into anyore detail. That said, I have a very primitive understanding of what shaders are but I mostly work with infrastructure and optimizing build systems.

Like I said, I'm not a game dev, im just curious. I appreciate any insight or resources you throw my way. Thanks!

top 5 comments
sorted by: hot top new old
[-] entwine@programming.dev 7 points 1 week ago

but I mostly work with infrastructure and optimizing build systems.

Besides source code, games also need to compile source assets. An example of this is textures; a dev might store them as PNGs in their source control, but the texture will need to be converted to a different format depending on the target hardware. On mobile, that might be something simple like PVRTC, or maybe supercompressed KTX. Geometry and animations also need to be compiled, usually from something like FBX to whatever runtime formats the engine uses, not to mention all the other copious amounts of custom data needed for the game.

Shaders are a challenge because you can't fully compile them ahead of time. They're usually authored in some DSL (maybe HLSL/GLSL, but sometimes also an engine-specific custom language), and depending on the target graphics API they can be compiled to intermediate bytecode (eg SPIRV). However, that bytecode needs to be compiled by the user into the internal format needed by the graphics implementation (which can even change between driver versions on the same machine), which is why modern PC games need to compile shaders on first launch. Consoles with fixed hardware can avoid this problem.

Beyond that, the shader permutation issue leads to games requiring a shitload of shaders for performance reasons, exacerbating the issues described above, both for the developer performing a release build, and for the user launching the game. This article describes the issue well.

So add all that on top of the usual time it takes to (cross-) compile the engine and game code, which is often a massive C++ codebase of dubious quality, and sometimes also an outdated proprietary toolchain of dubious quality.

[-] WhosMansIsThis@lemmy.world 2 points 1 week ago

I love lemmy. Thank you so much for your detailed response and fantastic article, its exactly what I was looking for. Seems like the bottleneck isnt really the infra. Definitely a difficult problem to solve.

[-] savvywolf@pawb.social 3 points 1 week ago

Worth noting: That 4 to 6 hour number is probably for a build from scratch. A good build system will be able to only recompile things that have changed and so the develop -> compile -> test cycle is usually much faster.

[-] WhosMansIsThis@lemmy.world 1 points 1 week ago

Ahh yeah that makes sense. That'd be a pain in the ass if it was for every build.

For a standard UE 4 or 5 game, 4 to 6 hours is normal time for iterative cook builds. If you lose your cook your are fucked and have to wait 20 hours. And that would involve incredibuild to get more than 100 cores during the compile.

this post was submitted on 11 Mar 2026
12 points (100.0% liked)

Game Development

5998 readers
19 users here now

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

founded 2 years ago
MODERATORS