TL;DR: Once upon a time, there was a Problem. And lo! I did create an Algorithm to solve it. ‘Twas an imperfect hero, greedy and brutal at heart, yet virtuous in its straightforward character. I spent, like, two hours on it, and I was well-pleased. Then came a hundred hundred Programmers from the Internet to annihilate the Problem and make my poor Algorithm look dumb.
The Legend of Monetization
In CodeCombat’s original pitch that got us into Y Combinator on stage, we said we could make money from employers by finding jobs for our most talented players. That way, we can keep the game free to play for everyone. Last month, the YC partners challenged us to test our assumption and find out whether we could actually get hirable players interested. We set out to make a hard developer challenge level as a proof of concept, and eventually came up with last month’s Gridmancer challenge.
The Wicked Problem
We wanted something we could put together quickly with the CodeCombat level editor that would be hard enough to test players’ programming fu, not just their Stack Overflow fu. I thought back to a problem I had struggled with while working on the CodeCombat world simulation performance. We’d have these dungeon levels with hundreds of Dungeon Wall Thangs, and even though each wall would hardly interact with any of the other Components, there were still places in the code with O(walls * frames * properties per wall) or O(walls * frames * thangs) interactions. Box2Dweb’s collision handling, though smart, also started to slow down with so many walls.
Muscles are built from two types of fibers-- fast twitch and slow twitch. Slow twitch fibers fire slowly, but are more efficient with oxygen use, making them suitable for the long punishment of a marathon. Fast twitch fibers don't use energy as efficiently, but they fire faster, making them good for sprinting.
Brains aren't made of muscle, but as I've observed how different people work, I've come to think of people as having either fast twitch or slow twitch brains. Neither fast nor slow twitch muscle fiber is better than the other, but knowing which one you have can be useful.
I have a fast twitch brain. When I see an opportunity or problem, I immediately begin working on it with very little planning. I course correct as I go, which occasionally means starting over, and will finish before the slow twitch brained person would. However, my solution is likely to be hacky and have some rough edges.