Shawn Hargreaves Blog
Most game design documents include a resource budget section, where you are expected to write things like "my AI will use 5% of the CPU and 1.5 megabytes of RAM".
This is bulls**t, and intellectually dishonest. It is simply not possible to predict resource usage with that level of precision before the code has been written. Of all the teams that have written such budgets, I bet only a tiny fraction even had the tools to measure their results against the plan, let alone any intention of actually enforcing it!
The only truly accurate way to know what resources a design will need is to implement it and then measure the results. But going over budget can be horrifically expensive:
Yikes! We'd better make a conservative original estimate, then, to avoid any danger of ending up in such a mess...
But this is a competitive marketplace. Especially in the AAA space where many companies are making variants of the same genres, if one team guesses conservatively while their competitor pushes a little harder, they will end up with reviews saying "well, it's ok, but this other similar game has better graphics and more cars on the track at a time". Even for indie games that depend on original gameplay concepts, implementation quality is still important. Nobody is going to want to play a crappy implementation, no matter how good the core idea is.
It's like The Price Is Right. You must guess as high as possible to win, but are disqualified if you go over the limit.
There are several ways to mitigate the risk:
I started writing this post because I wanted to talk about a MotoGP example of a late-binding knob, but this is long enough already, so I will defer that for later.
The main ripcord feature in MotoGP was multisampling. Thankfully our guesses turned out pretty good, so we didn't have to cut this, but had everything fallen to pieces at the end of development, the flick of a switch could have saved 2.3 meg of RAM, a ton of GPU time, and (unusually, on account of how we were memory bound on a UMA machine) also sped up our CPU code.
I once worked with a guy who built even more explicit ripcords into his projects. First thing when starting a new game he would allocate a megabyte array that was never used, and insert a millisecond delay into the Update method. A year or two later, when everyone around him is tearing out their hair and wailing in despair: tada!
That last comment is amazing. Was his intention to force the devs to be efficient with resources, and only cut them slack if it was absolutely necessary?
It’s a hard code 90/90 rule! Flick a switch and you gain your 5%. The 90/90 rule basically states that you should use 95% of the recourses 95% of time. If you’re lower you have room to grow if you’re higher you risk ‘horrifically expensive’ problems Shawn talks about.
> That last comment is amazing. Was his intention to force the devs to be efficient with resources, and only cut them slack if it was absolutely necessary?
The goal is to be slightly conservative and aim to use 90% of the CPU and 90% of memory, rather than maxing out everything at 100%, in order to have a little headroom and make sure the game can ship on time.
But the trouble is, enforcing that you only use 90% of something is hard verging on impossible! If you run out of memory, you get an obvious crash, but there is no such in-your-face warning as you inch past an arbitrary point like the 90% threshold.
Rather than building a ton of infrastructure to measure and report that 90% margin, this guy took advantage of the built-in failure that happens when you hit 100% resource usage, and just shifted the goalposts so that what would have been 90% usage becomes 100%. When the game is mostly finished, and has been optimized for this new version of 100%, he can shift the goalposts back again and be running nice and stable at 90% resource usage.
That really is a clever solution. But you guys don't use this as the 90/90 rule?
"The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time." lol
Take care guys,