Heat Death (I finally finished a videogame!)

I finished my videogame Heat Death! I’ll probably still tweak some things here or there, but it’s basically feature complete.

Check it out here:

The instructions and everything you need to know should be on the page. Let me know if anything is buggy or not working or unclear! It should support most modern browsers and controllers (although you might have to do a bit of remapping).

I also plan to make a post eventually on my experience with developing in Pico-8! I think it’s a very interesting platform that makes some things easier and some things way harder.

Please let me know what you think, good or bad! I know what I think the strengths and flaws of the game are, but I’d love to hear from others too. Maybe I can make it even better!

opening pullers
turrets cramped

38 Likes

My inaugural highscore:

image

Good luck!

2 Likes

And here’s a full play of a worse-scoring run:

1 Like

Congrats!

I’ve done three runs so far. High score is 219, only been able to make it to the third or fourth screen. I really like the screen shrinking aspect. Also do the pickups enemies drop just give you score or do they increase the difficulty or game speed too? Seemed like I picked up three of them and the game started running faster. edit-looks like the answer is on the page I just hadn’t scrolled down to see it yet.

edit-231, screen seven is my current high score.

2 Likes

They give you score and one pip of power. The enemies aren’t affected directly by the pickups, although they do speed up over time naturally.

You can spend the power on abilities by holding the power button and then releasing on 1, 2, or 3.

  1. Defrag - recycles debris on the ground into extra firepower
  2. Cloak - enemies can’t directly chase or aim at you (drops aggro)
  3. Remote Backup - Prevents you from dying by warping you to where you placed the backup

The abilities are probably the most complicated part and have the highest learning curve.

2 Likes

this is really interesting! very hard though yes

1 Like

There’s a difficulty level that I called “easier” that you can try, too! I wouldn’t say that it’s actually easy, but it is “easier” and can help you get your footing.

Making a game

I’ve been trying to make games for a quite a while! Typically my pattern is:

  1. Get excited about an idea
  2. Work furiously building an engine for said idea
  3. Start fleshing out the engine in all directions, trying to plan for anything and everything I might want
  4. After weeks of programming, discover some large design flaw in my engine
  5. Start rewriting game with a new paradigm or in a new language or with new tools
  6. Finally or nearly finish the engine; now time to start making the game
  7. Completely lose motivation because I’m burnt out and I’ve forgotten what made me excited about the idea in the first place.

Maybe some day I’ll finish my Zelda Randomizer (before the ROM-based randomizers were a thing!), or my Cave Noir-inspired roguelike, or my competitive text-based Wumpus game, but it seems unlikely at this point!

Enter Pico-8

Pico-8 is a self-contained “fantasy console”. It has certain specifications that all games made in it need to adhere to. I was initially attracted to Pico-8 because of its constraints. It immediately solves some problems and makes a lot of decisions for you. I don’t need to agonize what my screen size or aspect ratio should be. It’s 128x128. I don’t need to pick a palette. It’s these 16 colors. How will I make music and sfx and graphics? There’s a music tracker and graphics editor built in! How will I distribute my game? You can make executables for any platform, and you can target HTML5.

I was also attracted to the community around it. All the code and data for the carts is inherently open source, and the community is helpful and they all iterate on each others’ ideas. There are many cool games and demoscene projects in Pico-8. It’s really fun to try to get the most out of a platform with heavy constraints.

For this project I resolved to take the opposite approach I normally take: instead of planning everything out and making a comprehensive engine, I instead just sort of hacked everything in. Nothing was planned, and I took the path of least resistance while programming it. If a certain feature started to get hard to implement, sometimes the path of least resistance was to refactor and rewrite the code. When it was easy to share code between enemies or objects I shared code. When it was hard, I didn’t.

Hack it in

There was never an insurmountable problem to solve, because the structure of my game was inherently simple. Game development (at least for me) is a very fluid process, and it’s a fool’s errand to try to create a structure that will support everything you want to do in the future.

I’m always reacting to what I just built, iterating on what worked, what didn’t work. With this hack it in mindset I was able to prototype ideas very quickly. I wasn’t immediately getting discouraged upon realizing I would need to completely redo how something worked in my game.

The fine print

In addition to the player-facing constraints (graphics, sound, etc), Pico-8 also features some rather strict development constraints which are somewhat invisible in the final work, and I had (and still have!) a very complicated relationship with these.

  • Pico-8 limits the number of operations you can do per frame. This is effectively like a CPU limit.
  • Pico-8 carts must fit into a compressed size of 32KB.
  • You are limited to 8192 “tokens” per cart. A token is a variable, a keyword, a pair of parentheses, basically every element you use to write code. This sort of represents roughly how complicated your code is.

If compared to developing a game on a modern system, these constraints are incredibly harsh. I went in with the expectation that my game would have to have an extremely small scope to satisfy these constraints. I think this aspect of the constraints is great, because the main thing that stops my projects from being finished is scope creep. I focused on a Robotron-style arcade shooter, because arcade games tend to be fairly straightforward and focused, without too many superfluous elements.

Of course, as I started working on the game I got more and more excited about how it was turning out, so I naturally had growing aspirations for it.

Rabbit hole 1

The first roadblock I ran into was the CPU limit. I wanted way more enemies on screen than my code was currently supporting. My framerate was dropping to unacceptable levels when a decent number of enemies were on screen at once. Was Pico-8 just not capable of handling this many collisions at once?

Well, the answer was “actually, no”, but it was very very complicated! I spent hours of time iterating on my code, doing research on the snappiest ways to do things in Lua, caching things, unrolling loops, and completely obfuscating my “simple” code. But hey, once I was done, my game supported way more enemies on screen at once than I would need!

To keep this snappiness, this actually ended up extending to all collisions in the game. Instead of solving collisions generally (which was too slow), I had to apply problem-specific optimizations for each “type” of collision in my game.

  1. Enemy to player bullet collisions
  2. Player to enemy and enemy bullet collisions
  3. Player to pickup collisions
  4. Enemy and player to wall collisions

Every one of the above cases has a bespoke collision solution. And while it took more code size and tokens, it was indeed fast!

Rabbit hole 2

Tokens. Oh my god, tokens. While my code was now running at a snappy clip, it was taking up way more tokens than before. But I planned all these beautiful features! How will I fit it all on the cart?

My first solution was to split the menu into its own cart. Pico-8 carts can launch into other carts nearly seamlessly, at the cost of about a 1 second loading icon. By splitting the menu into its own cart, I effectively gave myself much more room for the game on the game cart. This also allowed me to flesh out a lot of menu features, which is why the game has an intro, all the different modes, color customization, help & credits screens, highscores, etc.

This worked for a while but

Rabbit hole 3

it never ends with these god damn tokens! To make my game interesting at a higher level of play, I wanted more variety, but that variety came at the cost of tokens. I wanted each level from 1-10 to have different enemy ratios and variations. I wanted the player to have 3 usable abilities to further increase the skill ceiling. As hard as I tried, I just could not get it to all fit.

To remedy this, I started looking up token saving tricks. Often there were ways to express the exact same code in a fewer number of tokens, at the cost of legibility and clarity.

I spent hours and hours and hours reading over my code line by line, applying these optimizations everywhere I could manage. Every time I made a change, I have to go back through the code yet again and eek out more tokens. But it ultimately still wasn’t enough!

Finally, I realized that I could save tokens by storing data in strings. A string could be an arbitrary length, but it only cost one token. By writing some string parsing code, I could effectively store a lot of data in strings, relieving the pressure of the token count (at the cost of compressed cart size!)

The rub

At this point, each simple feature I wanted to add would take hours. This change resulted in too many tokens, so I had to do another token optimization pass. This change made me hit the cart size limit, so I had to do get rid of long variable names and whitespace. I finally conceded and narrowed down exactly what features I thought were most important and focused on those.

Despite myself and my stubbornness to solve this token and size “problem”, I did finally learn the lesson Pico-8 was trying to teach me. I should value my time! Pico-8 taught me that there was a personal time cost to every feature I implement. Instead of being a perfectionist and tweaking things that mostly worked already, I should focus on the big picture high impact features.

In retrospect, I have no idea how this was a revelation for me, but it was! It completely changed how I thought about game design. My perfectionist ass shouldn’t be spending all my time on the smallest of details. Programming on a modern system, those details would only cost me “time”, but in Pico-8 every change costs tokens and cart size in addition to time. This additional cost also effectively increased the time it took to implement them, which helped calibrate me to where I should have been to begin with.

Was it worth it?

Pico-8 is not for everyone, but I think it works exceptionally well for the people it is for.

I think I accidentally found out Pico-8 was for me. I initially viewed the constraints as a fun puzzle and a challenge. Later, I viewed the constraints as a supreme annoyance and extremely demotivating. I was on the verge of giving up due to these “artificial” roadblocks Pico-8 was throwing at me. It was only once I learned the correct lesson – that my time is important, and I should spend it wisely – that I finished making a game. Maybe now that I’ve “learned” that lesson, I can ditch the frustration and make a game in something less actively hostile?

Maybe, but working in Pico-8 is invigorating!

17 Likes

this is awesome, really looking forward to plugging a controller in and trying it at more length later

1 Like

Yeah, definitely best on a controller. The holding action you have to do for the power button is way easier on a trigger than anything else.

I’m really thinking of adding a tutorial with a flow similar to this:

God this game is complicated huh. I think the biggest sin is that it looks simple, but then it’s got enough unintuitive features that it’s kind of a lot to process, especially when the player is thrown straight into the shit.

Anyone who’s already learned how to play please let me know if that flow looks ok. Or even anecdotes of what was confusing for people that bounced off immediately would help. I feel partially unequipped to tackle tutorializing this.

Maybe it doesn’t even need to be interactive all the way through. Maybe it just needs animations of the powerups. Learn to move and shoot, now watch the computer use the powerups correctly.

Started on the tutorial, and I think that flow will work if I word some of the steps a little better (PICO-8 has so little room for text!)

I’m not quite sure this tutorial is going to actually convert more players, but at minimum it’s good practice if I want to build a tutorial for a future game.

I really did not spend a lot of time thinking about how players will learn the game, and I want to try to remedy that.

I think some simple animations and images can suffice. Like a little keyboard or game pad icon with a key or button press next to it and an animation of the thing happening to represent that that’s what happens when you push that button or key.

Right, the problem is that my interactions are not as simple as press button->do thing.

It’s like hold down button until it says a certain number, let go, do thing.

I already have all the rules in text with pictures of controllers and how to do things, but no one expects to have to read instructions in the year of our lord 2020. That my game looks like a simple Robotron clone actually seems to give people a false sense of self-confidence in that they think they already know how it will play.

And I’m trying to solve some other problems here too, namely:

  1. People don’t know you can use gamepads on a website
  2. The dual stick keyboard controls require quite a bit of dexterity and are non-obvious, so I don’t want to promote them (and rather just leave them for players that are more inclined to read the instructions fully, or players that know what they want)
  3. Even the “simple” keyboard controls require the player to understand that the aiming is reversed from the movement, and that holding shoot will lock your direction in.

I do have animations of each of the powers on the site already, but few people scroll down to look at them. To implement “animations” in PICO-8 I think it would literally be the computer moving the player, and at that level of effort, it’s probably easier to just have a fully interactive tutorial.

The opening level of the game gives you very little room to breathe, and there are just enough things that don’t quite work how the player expects them to, that it’s almost impossible for the player to learn naturally under that pressure.

This was very obvious to me once I watched a number of people attempt to play it in person without me giving much instruction.

2 Likes

I think this is a good game, but I’m not very good at it thus far. For some reason, when something is coming at me I sometimes kind of panic and run right into it.

I didn’t understand the powerups until I came back and read this thread after playing a couple times. (I once activated one and assumed it was a safety zone like that mode in Geometry Wars 3 but then I got hit inside the box and realized I had been mistaken.)

2 Likes

Try easier mode if you haven’t – it just spawns less enemies and so you should be able to get your bearings a little better. I sort of lay it on thick, even from the start.

I might default to the easier difficulty in the patch where I implement the tutorial. I think people won’t shy away from turning difficulty up if that’s what they want, but they will stubbornly refrain turn it down.

And yeah, the powerup system is basically not intuitive at all and requires reading, which is why I think it needs tutorialized.

If you’re using the simple controls, that might explain why you’re running into things (since they make you run away from something to shoot at it, which is opposite of most game). I did consider a toggle for that too. I’m finding it tough to find the right line between being prescriptive and providing options.

Added a tutorial!

ai
Play here!

If I did my job, the game should be much easier to learn (and you won’t have to read my long ramblings to do so!)

Finally got around to playing this. The controls are very hard to get used to. I wish I could map diagonal shooting to a button.

Either way it’s all very well thought out and the balance is interesting. I like using abilities to upkeep my firing power.

Which controls are you using @slime? The game is admittedly pretty hard to play on a keyboard. I offer two controls schemes there but they both have some tradeoffs.

Are you saying you’d want 8 different directional keys for shooting, and still 4 for movement? Or are you using the “simple” controls (arrows + zx)?