I’m going to hijack Ray’s awesome post here and use it to talk about a particularly challenging engineering problem that we solve in No Man’s Sky, which arises as a direct consequence of our game universe being so astronomically large:
You all probably know about shaders, which are the primary basis for rendering rasterised graphics in games and also might know that large titles can have thousands of shaders, so that they can render a rich set of materials/meshes, particles, shadows, post fx .. and everything you see, in game.
We face a hard and complex task in
#NoMansSky when it comes to these sort of shader combinatorics - not only as biome diversity and richness has grown over the years, but also because the exact set of shaders needed to render a planet or anything else that is procedurally generated is not known until it is calculated - nothing in NMS exists until the seeded generation produces the system, planet, ship, station (etc) or anything else that you then see on your screen! This aspect makes “shader loading” in our game more challenging than a lot of titles, where a traditionally designed/static world might allow you to have information about which shaders are going to needed, ahead of time.
One up front thing that we do know is the whole set of shaders that could possibly be needed to render anything in the game .. and right now that number is around 60 thousand. The 60 there is not a typo, but at least we can initially reduce this starting count by 2.5x with some hash reduction - it still leaves us with tens of thousands of shaders, though!
For console versions of NMS this huge shader set can be completely precompiled offline and then streamed in as needed - but on PC shaders have to be compiled and cached by the driver. To deal with such a large set requires quite a lot of extra work, in order to minimise hitching that would happen if a driver has to compile shaders (pipeline states) that it has not encountered before - Nobody on PC likes hitching, and pretty much every gamer has encountered FPS drops that are caused by this problem, across a large number of titles over the last decade, as game rendering complexity has grown.
When running from Steam, there is an embedded shader caching system, (introduced some years back) and this is very helpful for reducing initial load times or long compiles/loads when you update a driver.. but even with this system in place, every time we do a large update (or patch) that has changed a lot of our shaders, we gather data from QA - dozens of hours of real play or smoke-test shader usage, visiting hundreds of planets, dozens of stations, freighters and bases, so that we accurately know and can precompile 99.5% of the most common shaders in use, to minimise this kind of hitching - quite a mad amount of effort to solve something that is never mentioned in patch notes and all just happens behind the scenes!
#NoMansSky is BIG
Like really Big
You just wouldn't believe how vastly, hugely, mind-boggling big it is
NMS has 18, 446,744,709,552,616 planets to explore, that's 18 Quintillion, with a Q
It would take 255 BILLION years to see them all
So, where to?
@NoMansSky @hellogames