Mon Dec 13 15:34:34 PST 2010
wherein minecraft isn't good enough
Minecraft is a neat game. Nobody denies that. But it could be neater, and I know how it could be done.
Waaay back in 2006, Valve released an early teaser trailer for for Episode 2. This was somewhat ill-advised, since EP2 changed quite a bit in the next 13 months; but there was one scene in the trailer that had my jaw on the floor. It showed a bridge collapsing, with its girders buckling under the load.
That looked, to my naive eyes, like real-time finite element analysis, something I have a little experience with. FEA is, at its root, a cheat, to make simulating the deformation of an object under load. Rather than simulating every atom, which would be hopelessly complex with current computers, FEA pretends that it's made of a bunch of very large atoms, essentially, then does a bunch of fudge factors to make the math come out right. But while FEA makes the problem tractable, it still doesn't make it terribly easy. My water simulation used 3,375,000 "atoms", and it took a couple hours to produce 25 seconds of data. That is not even vaguely close to real time, and doing the same for an entire bridge would be orders of magnitude more computationally intensive. In order for Valve to pull off real-time FEA, they would've had to make some major breakthrough, or several major breakthroughs, in quite a lot of fields.
Of course, they didn't. It was faked. The simulation was precalculated, and the data merely plugged into the mesh animation. The collapse of the bridge plays out the same every time. This is unfortunate, but unsurprising. Accurately simulating the collapse of a bridge, with a high enough resolution to be convincing with modern graphics, takes a lot of computational resources. But there are problems that are not quite as hard, and their hardness diminishes even farther if you don't have to use a fine-grained model.
And what game is composed entirely of blocks a meter on a side?
Not every problem is as hard as water simulation. Minecraft uses a simplified water model, due to processing constraints, that mostly works for natural rivers, and breaks hilariously in certain edge cases. (Go to lake. Fill bucket of water. Go to top of mountain. Pour out bucket. Bucket covers mountain in a flood of water.) No, for maybe the next five years, water simulation, even at the cubic meter scale, will probably be intractable. (Intel "Rockwell" 16nm CPUs are due to come out in 2014, and there will probably be a 12-core variant)
But there are plenty of neat things you could do in Minecraft, thanks to its 1 meter Planck length, that would be impossible in any other modern game.
Things like weather simulation.
Weather prediction is notoriously hard, but that's because to do it perfectly, you have to model the entire world at a molecular level, which requires, along other things, measuring the initial state of the system perfectly, and vast, vast oceans of computational power.
But in minecraft, the total simulation size is much smaller, (a dozen square kilometers at a time, centered on wherever the player happens to be) and absolute physical accuracy is unnecessary, and indeed, in this context, doesn't mean a lot. Accurate to what, precisely? The Minecraft world isn't much like the real world, except in broad, garishly colored strokes.
A lot of interesting things come naturally from real weather simulation. Realistic biomes, for one, something Markus implemented in the last patch, which are pretty neat in-game, but has garnered criticism from the usual suspects for being "inaccurate". If it's inaccurate, then why not simulate the underlying conditions that produce biomes?
A real water cycle would also produce rivers that make sense. Right now the world generator puts cubic meter "water springs" where they (I suspect, from looking at where they appear) produce interesting features, such as waterfalls, etc. Of course, these waterfalls are produced by the same water springs that can be placed by buckets, and can produce the same bizarre results. Simulated rivers would be more physically accurate, could produce large-scale water features that can't happen under the current model, (rivers tend to peter out pretty quickly when they hit flat stretches of terrain) and all without presenting the intractable complexity that implementing true real-time water simulation would.
While real-time water simulation is, as implied, done in real time, (pour out a bucket of water and watch it flow downhill) weather simulation does not need to be terribly fast to produce good results. And there's an obvious, in-game method of reducing the amount of computing power needed: changing the length of the day/night cycle. Short days and nights, with fast moving weather, longer days for users playing on laptops or old hardware, or disabling the day/night cycle entirely, for the most limited platforms, or for those malcontents who point out that a day/night cycle, while physically accurate, is actually quite annoying and produces a consistently mediocre play experience, rather than one precisely optimized by the designer picking the one sun angle, that, you know, looks good.
Tracking heat could also have water evaporating when coming into contact with lava and becoming steam, later falling as rain. It could also heat up the air in a cave system that has lava in the bottom, requiring you to divert a river into it before you could enter.
There's quite a lot of headroom for CPU intensive features, at least, on modern machines, since Minecraft is single threaded.
There's a reason most games don't scale features based on CPU power, rather than GPU power; and that is because it is both hard to do well, and not terribly obvious even when it is done.
Scaling graphics quality is both easy, and very, very obvious. You use larger texture maps, greater levels of antialiasing, or higher polycount models. Each of these scale linearly up or down, in an easy processing-power-for-prettiness tradeoff, and crucially, do not affect gameplay at all.
But the CPU, in video games, tend to be used for fiddly things like AI or game logic, which tend to be of the form of things that either work, or they don't. There's no way to scale up event scripting. Either it runs fast enough that things trigger on time, or it doesn't.
Even when you can scale up CPU-bound features in meaningful ways, like adding more physics objects, or making the AI smarter, it's hard to do so without materially affecting gameplay. Add more physics objects, and the player can score more object kills, and make the game easier. And making the AI smarter is one of the oldest ways of managing game difficulty!
So not only are CPU-bound features hard to do, hard to scale, and hard to balance, they're also not terribly impressive in a trade-show demo, unlike a slam dunk feature like improving graphical quality by putting your code guru on the lighting engine team and quadrupling the number of dynamic lights in the scene. Instead of what he was doing before, which was spending a lot of time unproductively staring into space and then writing blog posts on what you could do with a lot of CPU power.
At this point I think I should point out that Minecraft is leaving alpha on the 20th. This means that the price is increasing five euros, and that buying the beta no longer guarantees that you'll get the full version of the game. If you have been on the fence about buying Minecraft, then, as your attorney in this matter, I strongly advise that you do so before Time, as it were, Runs Out.