Chatting with Nathan Adams and Erik Broes of Minecraft
It is our privilege to present to you this informal conversation between Nathan Adams and Erik Broes of Minecraft and John Lindquist of JetBrains. The interview covers a wide range of topics ranging from the informative to the entertaining. Enjoy.
How were you introduced to programming?
Nathan: I started when I was 10. I saw people making bots on MSN messenger at the time and thought, “Hey that’s awesome, I want to try that!” It was lots of fun, but perhaps Perl wasn’t a great introductory language!
Erik: Wha! That is a long time ago; you made me feel old! When I was around 10 I doodled a bit in BASIC (lots of typing what magazines said without understanding much of it). My first “real” language was Perl when I was 14 to admin/control QuakeWorld servers.
Have you always considered yourself a game developer?
Nathan: I didn’t really consider myself a game developer until I started to work on Minecraft. I’ve always been working on either modding games or reverse engineering games, but to now be developing them is a scary place! Much more rewarding though, and fun!
Erik: Same as Nathan basically, and still I’m not qualifying myself as a game-dev. I love ‘fixing broken things’ far too much. I’ve dabbled in the occasional hacking around in games, figuring out their data format etc.; but until the first Mojam (coding jam) at Mojang I’d never made a fully working game before.
What have been your favorite programming languages and tools you’ve used throughout your career?
Nathan: That’s a tough one, different tools (languages) for different jobs. I think these days I prefer to use Python for scripting or web work, Java for games, tools or client-side programs. As far as tools go, that’s even harder. I’m a simple man, so I’ll probably vote for IntelliJ IDEA, Sublime Text (for anything non-java) and Twitter (it’s a tool, I promise! Best place for feedback!).
Erik: I’ve been taught/learned to use Vim from very early on. Doing lots of work on servers or through ssh tunnels limits you some (also, ~18yrs ago, we didn’t have this fancy-pancy stuff). I still use Vim plugins right now (IdeaVim!). I used to claim Perl would be the right language for every situation I’d end up in, but since then I’ve converted to loving the sanity a strong-typed-non-evaluated language like Java gives you. I still use Perl for (too m)any one-offs hacky things but prefer Java+IntelliJ+IdeaVim for anything else.
Which platforms do you most enjoy working with? Hate working with? 🙂
Nathan: Hmm, interesting question. With Java and Python I usually don’t have to worry about platform, but if I need to start doing UI work I’ll go cry in a corner!
Erik: As development host OS I absolutely *hate* Windows with a passion. No proper shell, no sane ssh support, just makes me cry to be so ‘powerless.’ As I also do not want to spend a lot of time investing why on earth my kernel module seems to be turning itself inside out again, I ended up on the middle ground between Linux and Windows, OS X. I always say if you know something well enough you know what to hate it for, so far I seem to hate OS X the least.
What sort of tools do you use for testing? Do you follow any specific testing practices?
Nathan: Hehe, I’ll leave this to Erik. He’s the testing guru here. We tend to write new components test driven, but the majority of the actual gameplay is still untested sadly.
Erik: Ha, calling someone with <4yrs of Java experience a guru. First off, I don’t consider myself a guru. We’re not using many ‘tools’ beyond what IntelliJ IDEA provides, we just need to be able to run JUnit4. I don’t quite fancy frameworks that use reflection to get the codebase into a state so it is mockable (overwriting finals, testing privates etc.), so we’re just using Mockito. Eventually, I plan to somehow get this codebase up to 90%+ coverage (line based unit tested) and it might very well be the only game that does that if we get there 😀 .
What advice do you have for other developers working with massively popular code bases?
Nathan: Don’t be afraid to tear things apart, as long as you’re willing to spend three times as long putting it all back together again. If you have a community always wanting new things, they have to understand (and you do too) that sometimes you need to take a few weeks to just shave yaks and refactor code – it may not sound fun but in the end it lets you be more productive and work on cool things faster!
Erik: As Nathan said, we break all the things all the time. It would be significantly easier if our code was properly unit tested and we’re slowly getting there. Also, if you have a chance to open source your product, please do so, listen to the feedback people give to your code and learn from the constructive criticism.
Do you have a favorite programming book?
Nathan: I’m afraid that I don’t, I haven’t read any! *ducks from fire*
Erik: *fires at Nathan’s feet*; I’m sad that I actually don’t have it on my desk, but Effective Java by Joshua Bloch, I can advise to anyone coding Java. Also, do not skip out on Clean Code by “Uncle Bob.”
When are you most productive, day or night?
Nathan: Hehe, programming hours. I’m most productive when it comes to me, whenever that may be! Usually at night though, perhaps because I have fewer distractions then.
Erik: My best ideas are always at horrible times, like just jumping into the shower or right before you fall asleep. Best productivity is achieved while I’m not sleeping I guess 🙂 .
Music or no music while you code? Favorite coding music?
Nathan: Ooh, that’s an easy one. Explosions in the Sky. It makes you feel like you’re in a cheesy hacker movie, one more line of code away from saving the world.
Erik: Even though I don’t listen to music a lot, I love the artist Nathan pointed out. If I listen to music I cannot listen to anything with lyrics, it just messes coding up for me badly. So when I decide to listen to music to tune out other sounds it would be some form of Trance or even Classical.
What’s the most difficult bug you’ve had to fix?
Nathan: I’d say lighting bugs… Sometimes when playing Minecraft you’ll come across random patches of darkness, where the world hasn’t been lit. We haven’t fixed them yet. Well, that’s not true, I’ve fixed them multiple times in multiple different ways but it’s always killed performance in some way or another so we’ve just had to keep treating the symptoms instead of the bug. I’ve probably wasted solid months on this by now.
Erik: ^^^ THAT! I hate this lighting bug. The problem is that we ‘know’ how to fix it but the result ends up being too slow. We’ll eventually get around it again once we abstract it out of the current tangle it is in.
Do you use a lot of “in-house” built tools?
Nathan: Not so much these days, but a few. The one I’m most proud of is Hopper, a crash report collector. Whenever anybody crashes in Minecraft (provided they have this turned on), it’ll automatically post it to http://hopper.minecraft.net, which will group it with similar crashes by uniqueness on the “unknown” part of the stacktrace, whilst the game filled in a bunch of relevant data at each part of the crash. We can also mark certain bugs (like not having a graphics card… it happens more than you think) as known so we can immediately give user feedback as soon as they experience the crash. The best part about the system? It deobfuscates reports for us!
Erik: We try to stay with open source tools as much as we can but we need to fetch/prepare data from/to other sources for our release process. Think of ‘sets’ of assets for Amazon, downloading translations from Crowdin and prepping them for upload. So our custom tool chain is relatively small right now. We do have plans to dabble in UI authoring and perhaps some model-exporters for our upcoming changes in those areas. Also, I totally wrote that deobfuscator for the stacktraces in Python (first time I touched that)!
Any advice for aspiring game developers?
Nathan: Make games for yourself, not for others! That’s the most common mistake I see people making. If it’s not fun for you, you’re not going to make something fun for others. Don’t be afraid that you’ll mess up or it won’t work; it *will* mess up and it may not work but that’s a learning experience by itself. Besides, half of the games out there are built on unintended features!
Erik: Two things, code, code until your brains fall out, and make all the mistakes you need to make. Only by making mistakes will you learn/improve/discover new things. Try once in a while to figure out if you are getting the most from your IDE or if you can perhaps use it better (This is how I found IntelliJ). And as I’ve said before, get other people in on your project and learn from them.
Any feature requests for IntelliJ IDEA or other JetBrains tools?
Nathan: Oh man, my mind went blank. We’ve always said to ourselves “IntelliJ needs this…” but now I can’t remember any. I guess hotkeys for certain run configurations would be nice! Or better multi-cursor support, Sublime has really spoilt me there and sometimes I need to switch back to it to more quickly edit things up, but I can only imagine how much of a headache that’d be to make.
Erik: Yeah while running tests having a button that not-depending-on-context runs all the tests in that file, would be useful. For structural replacements, being able to have a variable to match operators would be *SO* useful. For example:
$SomethingThatExtendsFacing$.getId() $EqualsOrNotEqualsTo$ 3
$SomethingThatExtendsFacing$ $EqualsOrNotEqualsTo$ Facing.SOUTH
or turning: “new Pos(x + 1, y – 1, z + 1)” into “new Pos(x, y, z).offset(1, -1, 1)”, right now you have to make all the variants of positive/negative and manually ‘map them’. And if we’re going this way; being able to handle: “x + 1 – 1” ‘natively’ instead of having to manually rewrite it to: “x + (1 – 1)” to see it as an addition, would be wonderful too.
Thank you Nathan and Erik for your time and joining us for this interview. In regards to their improvement ideas for IntelliJ IDEA stay tuned for more information.
This is the tweet that set into motion the whole conversation. If you have ideas for future interviews and articles, please share your thoughts in our comments section.
Structural replace in IntelliJ IDEA is the best thing in the world.
— Nathan Adams (@Dinnerbone) November 28, 2013
Minecraft and the Minecraft logo are registered trademarks of Mojang / Notch © 2009-2014.