A little knowledge…

posted by Chris on 27 Nov 2010

Sometimes cliches really are true.

When we first started working with Flixel, it was right after I tried writing a Zelda-like game entirely in JavaScript. (I called it Zelda’s Maze and almost all of the ideas in it showed up in Where We Remain.) The experiment kinda sorta worked. I got OK framerates in Chrome, but Firefox was all over the place and IE didn’t even support the <canvas> tag back then, so the results were mixed at best. The landscape is a bit different now — there are projects out there like Akihabara — but then, it seemed like the clear choice for browser-based game creation was Flixel. (Flashpunk didn’t exist back then, either!)

Switching to Flixel meant not only learning a new language, ActionScript, but also a new environment, the Flash runtime. ActionScript is basically a stronger-typed JavaScript, so it didn’t take that long to get comfortable with it. The Flash runtime, though, was a whole different story. Flixel is full-featured enough that you don’t need to learn anything at all about how the pixels actually get onscreen and the sounds get played — so we didn’t worry about those details with Where We Remain. As a result, the game hewed very closely to what was possible in Flixel then. There were a number of things we ended up cutting out because I couldn’t figure out how to make them work. The shoes everyone hated, for example, were originally going to allow you to either move through the trees on the map or maybe even through the mountain tiles, albeit at a slower speed. But at the time I couldn’t figure out how to selectively collide the map with the player. Joel was also keen on animating the map, especially for the water, but that was also beyond me.

Looking back on it, though, these limitations were more good than they were bad. They forced us to constrain our design. We couldn’t drift off into something that would take forever to implement, because we simply couldn’t do it. Nowadays, the situation is a bit different. With Sanctuary 17, I started to peek under Flixel’s hood in order to implement dynamic lighting, and started working with the actual Flash classes that Flixel manipulates. Although it took me some time to get it working correctly, it was time well-spent. I can’t see how we could have done Sanctuary without that lighting system. It’s just an integral part of the game.

With the game we are working on now, I decided to dive head-first into the quote-unquote internals of Flixel, because I wanted to implement a couple things that would at first inspection would be impossible in Flixel. I don’t want to talk about details too much, but as a hint, look at the constructor of FlxGame for one of the things we wanted to do. I ended up spending some serious time getting to know how Flixel handles graphics and collisions, which are the bread and butter of almost every action game. I learned a lot along the way, saw some ways to do some neat tricks… and wasted a lot of development time. I was spending a lot more time experimenting with technical gewgaws instead of thinking about what would actually make for a good game.

A couple weeks ago, we sat back and re-examined the original design we came up with for the game. We cut out a lot of things that weren’t working, and we refocused most of the rest. It also meant cutting a ton of code that simply wasn’t useful anymore. Kind of tough but also necessary. I’m really happy with how things are going now… we soon will have a prototype version we can start showing people and getting some feedback on the mechanics, as we start to fill out all the content we plan on creating. When you’re on a good creative path, you can just feel it, I think. And I feel it now.

But there will always be that temptation, I think. To spend a couple weeks if not months trying to do something supercool instead of thinking about design. I think this tension might even be inherent to making computer games, since they’re such a young medium. Even when you’re making games out of chunky pixels, you still want something that will grab people’s attention at first glance and make them go “woah.” Compare literature, whose quote-unquote technical innovations in recent times have been writing a novel without using the letter E and the crazy typography of House of Leaves. This is not a criticism at all — I just think as a medium matures, people spend less time on trying to make a crazy leap forward and focus more on the content itself.

(I’m not sure how movies and this newfangled 3D fits into this theory.)

So to boil this all down into an aphorism of my own: if you’re spending a lot of time worrying about your framerate, it’s probably because you have an unfocused design.