Pysteroids
My 2013 Asteroids Game in Python, Rebuilt to Play in the Browser
Back in 2013 I built a game I called Pysteroids. It was Asteroids, made in Python. I was experimenting with particle explosions - the use of pixel-sized particles en masse, which produced interesting graphical effects. Each particle has its own vector - a direction and a magnitude - inside of a game world with physics maths of my own: gravity, drag and acceleration.
But as with all of these Software Engineering posts, play first, read later! Pot and Flame have joined in on the remake. Although they can’t ride in the cockpit of the ship, they do assist. See how far you can get, and keep an eye out for some easter eggs!
Play First, Read Later
High scores
Loading…
About the Original
This was a one-all-nighter game I made back in 2013. One file, one game. Everything was a line of code, and there were no graphics. Everything was polygonal line art, rendered with the Pygame engine that could draw the lines to make shapes right where I wanted them. OpenGL was similar, except in C++, and it had 3D support. Pygame was the simpler, scriptier 2D companion.
You may already know how I feel about some games in the industry nowadays: a lot of big triple-A productions are all about the “glam and glitz”, meaning they care a lot more about the graphics and sounds than they do about the actual game mechanics. Fun in games is both, but never only one or the other. Indie games tend to get a good rep because they focus on games smaller in scale, without a massive studio, and usually with simpler, 2D graphics. Pygame is a major enabler of that.
Physics wasn’t something I was particularly good at, so most of my time in 2013 went to experimenting with physics formulas for acceleration, drag and the rest, trying to get the right feel for the speed and flow of the game’s moving elements. The bullet patterns were the fun part, and I’ve always loved level-up style games where you can upgrade. Seeing the bullet patterns combined with the ship rotating or traveling at the same time as shooting was mesmerizing, and I wanted to share that with the world.
The Remake
When I built the original, the upgrades were simple items - labeled as I, II and III - not very memorable, and obscure at that. For the remake, I wanted Pot and Flame to join in on the game, so I put on my game-design hat and started employing some of what I’d written about in my book, What Makes a Game Fun.
And so the remake is here, for all to play. I’ve addressed many of the faults to playability, and enhanced replayability where practical. Some faults and aspects are not addressed, on purpose, but I’ll discuss those too. I wrote about it here, to share and accompany the book when it comes out.
Faults to Playability
Several faults to playability riddled the original Pysteroids that I wanted to fix. The most obvious one was obscure upgrade items. I, II and III wouldn’t cut it, even with a help page that explained them. This would violate playability intuition, where I, II and III mean nothing to a player inside of a ship. If you ran into that in the real world, I wouldn’t expect you to read a manual just to understand it. So I redesigned the items as badges. And I gave them a small sheen, a shine that was attractive. That meant it was worth your time to grab.
In addition, the upgrade badges don’t simply appear, which is another kind of intuition violation. Instead, Pot and Flame are now jumping into the screen and bringing the badges with them, in their own way of helping. This works with the theme of “Pot and Flame want to help.” They’ve found Pysteroids, and together, they enhance the game and make it better.
Another fault is a lack of adequate reward when stages are complete. Clearing a regular stage by itself isn’t that spectacular. So I’ve added bosses, which do two things. First, they give me an opportunity to reward the player with a brief flourish of celebration - something I’ve noted that the NES arcade game 1943 does really well. When you defeat a boss in the new Pysteroids, the ship will do a small dance of sorts, along with celebration from Pot and Flame too. The second thing a boss does is introduce challenge. If the upgrades, along with Pot and Flame, are aids to help the player overcome challenges, then I also need a pull in the opposite direction - and the bosses do just that. They make the upgrades even more worth your while, because you’ll need the power to defeat them.
Dying shouldn’t cost you the whole run. The original had a Death Tax: lose a ship and your upgrades went with it. In the remake, you keep every badge you’ve earned. The ship pulls itself back together from its own shards, and you get a few seconds of shield to find your bearings, so one stray rock doesn’t turn into a second death right away.
The screen grows, too. In later quests, the world reaches past the edges of the screen, and the camera follows the ship. A bigger world brings its own fault: losing track of things. So when Pot or Flame is off screen, a small banner at the edge points the way, and when only a couple of rocks are left, arrows show you where to hunt them down.
And one fault I made myself, while building. Early on, every shot homed in, and the game nearly played itself - an upgrade that’s too strong is a fault of its own. Now only a few darts home in, and they hit softer. Burning shots took over the role, and they burn hotter as you upgrade them.
Immersion mattered here too. I took the menus away as menus: you stay in the ship and shoot a choice to pick it. You’re always flying, even when you’re picking Hard mode or reading Help.
Aspects of Replayability
I’ve already mentioned Challenge, and how bosses and upgrades work together to provide it. I’ve spent a lot of time polishing the balance in the game, to present the kind of challenge I wanted in a demo. Not a full-fledged game you’ll spend hours on, but something you might spend minutes on. But what else?
The bosses themselves are The Flatterer, the Fifth Monkey and the Dark Flame - all characters in our ongoing metaphor and overall story involving Pot and Flame. These enhance the aspect of Experience. The particle explosions from 2013 are back, too, now with burning rocks and fire trails behind your shots.
On Completion, I introduced a repeat of the main nine stages. That mode only exists beyond Easy mode, which ends when you defeat the final boss. So there is a way to actually complete the game too, if you’re looking for a story mode. Beat Dark Flame on Easy, watch the credits, and you’re done. In the harder modes, the quests keep going after that, and completion amounts to defeating Dark Flame and obtaining all upgrades. The HUD banner pulls you toward that: it shows every upgrade along with its unfilled orbs, showing you where upgrades remain.
Mastery gets more of a ladder than the original ever had. Easy is story mode - on the bosses you get a life meter, so you can take a few hits and keep flying. Hard and Insane drop the meter. One hit is death again, and after Dark Flame the world grows, the rocks get tougher, and the scoreboard keeps climbing. You won’t get the highest score from Easy, and so hence, mastery lives in the harder modes.
Social is present with the Believable AI mode. Press B and watch the ship play by itself. Watching counts, and in the book, I call that being a spectator. It’s the same instinct as crowding around one NES in the living room, except the pilot is a little robot that flies the ship for you. Any run the AI flew, even partly, stays off the high score board, so the names on it earned their spot. That matters for mastery too: the board stays a human contest, and the Believable AI stays a show.
What I Left Alone
Not every fault got a fix, and that was on purpose.
It is Asteroids. Fluidity is purposely kind of clunky. Turn-and-thrust inertia is the genre. I improved a few things - autofire while you hold the button, a brake, keys only, no mouse aim - but I wasn’t going to sand the float out of it. Not much to do here that wouldn’t stop being Asteroids.
The axiom of choice is flawed here, too. Badges drop at random. I could have done something like 1943, where you shoot a power-up to cycle what it becomes before you grab it. I had done enough iterations for a simpler demo, though. Impact stays light, and I’m fine with that for what this is.
While playtesting, I realized a few additional things that could have helped, but I didn’t want to venture too much further than I had already. The immersive menu could have done more to “gravitate” the user towards the easier modes first, and made it more intuitive. That is Walt Disney’s “weenie” - I wrote about that in Creativity Curves. I also could have done something to make the levels more intensive and respect a player’s time too. If each stage had its own timer, then multiple levels could collide, meaning more polygonal asteroids that could add difficulty.
And on Experience, I did not venture into sound and music. Graphics remain right where I wanted them: simple, 2D and particle pixel glitter. I do want to get into music more in depth one day, and connect an electronic keyboard to my PC in the office and start recording music and sounds of my own. When that day comes, Pysteroids may get an update first.
I’ve been building a world where Pot and Flame are adventuring and discovering creativity, enlightenment and sharing that with the world. Today, Pot and Flame play a little blast from the past in the form of Pysteroids. I’m pretty tempted to do something like a Chocobo’s Dungeon 2 remake using Pot and Flame one day too, though, and that’d probably work really well with my Endless Dungeons.
So give the game a few plays, see where you land up on the high-score board. Pot and Flame will be back for more adventures. Anyway, that’s it for now.