Monday, December 2, 2013

Notch, WebGL, Dart, and ramping up quickly

Just a little something I thought was worth pointing out. @notch, the creator of Minecraft, has been posting updates on his latest toy project to his Twitter account recently. I've found this very interesting because he's doing a WebGL app in Dart, which just makes me all sorts of happy. Ignoring that, however his tweets illustrate something that I feel is very important.

This was a week ago:
We've all been there, right? "I got SOMETHING on screen! YAY!" But then...
Two days later and he's gone from "Triangle on the screen" to "Blocky environment, mocked up UI, and text rendering".
Some hangups on the math, and now there's basic collision detection!
And sprites.
And then, hey, let's swap out the entire lighting system on a whim! Why not!

So, to recap, in the space of a week Notch went from rendering one triangle to being able to walk around a deferred lit environment. In a language that he's only just started with, no less!

Now, I'd love to claim that using Dart and WebGL has something to do with being able to iterate so quickly, but in all honesty it's going to be far more accurate to chalk that up to Notch being an experienced and skilled developer. (I do believe the web, by it's very nature, allows for fast development iteration. But that's a different story.)

No, the real reason I point all this out is not to promote any particular tool/language/API but to discourage something that I see time and time again: Over-Architecting.

I can't tell you how many time I see hobby developers saying "I'm building a game!" and what they actually have to show for it is a really complicated system for loading meshes and shaders. It's all well and good to think about long term goals and engine structure and such, but if you're going to build a game then please build a freaking game! Don't build an engine that you will someday build a game on top of, because you will never get past step one.

(And, for the record, I'm just as guilty of this as anyone!)

Now, I haven't seen one line of Notch's code. I have no idea if it's well structured or spaghetti. I would make an educated guess and say that there's a lot of the basics in this project that have been ported over from the Minecraft or 0x10c code. The point is that regardless of the coding styles at play this is a project that went from nothing to basic world interaction in a week, which is a great jumping off point for experimenting with actual gameplay.

That's awesome, and I kind of feel like that's the sort of velocity that you should strive for when you set out to "build a game." Establish a goal of some point of basic, minimal usability and do whatever it takes to hit that point first. Then iterate the crap out of it!

UPDATE:

Well, this post seems to have become fairly popular. I'm worried that people are taking away a message other than I intended, so let me clarify:

By no means am I encouraging bad coding practices, nor am I implying that Notch is trading speedy development for clean code. It's perfectly possible to do both, it just takes experience. I am trying to discourage people from building out a bunch of infrastructure that they don't actually need. This is both a personal bad habit and one that I see echoed in many forums, blogs, and tweets across the web. Worrying about making sure your shader system efficiently handles every imaginable effect before you have any meaningful game interaction is probably putting the cart before the horse. Unless, of course, you are actually trying to build a "game engine". Then by all means, design away! But at that point you shouldn't delude yourself into thinking that you'll end up with a game on the other side.

(And of course none of this applies to professional game studios. We're talking about garage developers here. The rules change entirely when you have a building full of employees and a few million in funding at your disposal.)

If you are a beginner and just want to build a game, I strongly suggest looking into Unity or something similar, as they've done all of the hard architectural stuff for you and you can focus on the game mechanics instead.