NMS Insight





7 Likes

A place to store all of Martin Griffiths tweets seems like a good plce to me!

5 Likes

Some Belated Martin Griifiths posts

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!

I want to add that this week I virtually stood in the queue to order my home PS5 Pro - there is something really special about the journey from working on prototype hardware to it becoming a real thing with the immense intellectual and human effort it takes from thousands of people to ship a console like this with more than 50 launch titles.

I’ve never lost that child like excitement I get when coding on a new dev-kit or that same excitement when the real console arrives at home and you boot-up a game you’ve worked on, for the first time. The brilliant tranquil image I linked off, summed up the launch milestone perfectly for everyone at Hello who have worked hard to reach this point - we can quietly breath again and take pride that our tiny team is part of this.

3 Likes