November 25, 2021

Game Engine Waffling + Tetris Prototypes

TLDR: Skip to the playable prototype at the bottom.

I haven't been doing as much gamedev prototyping the last few years (too busy with Intro Maker), but I have done a LOT of engine waffling. The last few commercial games I built were either in Unity (for iOS) or SpriteKit (for iOS).

The thing I miss most about Flash is how easy it was to whip up a quick prototype and throw it on the web. I don't know if I have the bandwidth to finish any projects these days, but I want to get back to making prototypes and publishing those.

I'm kind of over iOS and mobile, which eliminates SpriteKit.

I like Unity (and C#) and the Unity Editor, but sharing weird prototypes from Unity is too much of a pain in the ass. Project Tiny ( sounds perfect, but I'm not sure if anyone is working on it and the Unity roadmap is too fuzzy to rely on these days.

I like DragonRuby for small projects (the original iOS version of Banana Breakers was built in RubyMotion, which was a precursor to DragonRuby), but I'm not as big a fan of their license structure. I eventually want to start posting source code, so having something open/free is important.

I looked at Defold, but wasn't a fan of the Lua scripting.

I like what Godot is doing license-wise, but it's overkill for the type of prototypes I build and web doesn't seem to be a huge priority right now (doesn't work on iOS).

I've shipped games with Haxe and it can output to the web, but for developer happiness I'd rather not work in a transpiled language any more (I remember debugging being a little weird, but maybe they've fixed that).

I strongly considered using Processing (p5js), but I would have to write my own display tree. I still think this would be a good choice for doing tutorials, but for quick n' dirty prototyping I want something with a few bells and whistles.

When I rebuilt Filler, I used Phaser. Phaser suffers from a bit of kitchen sink syndrom – there's a ton of extra stuff jammed in there and the documentation is pretty spotty. Filler was a simple port, so I mostly didn't run into many problems. The original prototype below has a bit more interaction and nested objects/containers, and this led to a TON of weird input issues. I don't think Phaser is that poorly built, but it just doesn't quite line up with the way my brain works.

While I didn't enjoy working with Phaser, I did like the dev/build environment: TypeScript with intellisense in VSCode, a node watcher doing hot reloads, and debugging in Chrome. Phaser is built on top of PixiJS (an older version I think). I've shipped a few agency game projects using Pixi over the years (and even wrote an unpublished runtime for my personal asset pipeline), but I initially dismissed it because I didn't want to write vanilla javascript spread over a bunch of different files (which is how I shipped projects 3-4 years ago). I checked around and found a typescript/node-ified version of Pixi 5.

It took a couple of hours to port the Phaser prototype over to "just" Pixi, but I'm pretty happy now. I'm confident I can use that stack as a base for doing weird little prototypes (part 1 of the goal!), and this blog post will be the trial run at sharing them out.

Honorable mention: while I haven't personally used them, I also looked at PlayCanvas and Cocos. PlayCanvas fails for the same reason as RubyMotion (paid, hard to share code/tutorials). I did some mobile projects in Cocos a few years back (before they had an editor), but I haven't followed it that closely. It looks like they've gone a lot more towards Unity (heavily component driven), but it also looks like web and Typescript are supported. I'm going to stick with Pixi for now, but Cocos is probably my next fallback.

Tetris + Bridges

Tetris was one of the first games I ever played (Nintendo, Game Boy) and I've thought a lot over the years about how to do stuff with Tetris pieces (aka tetrominoes). These tweets were from 2017, but the prototype was a Flash prototype from way back in 2008 or 2009:

I still have the code for that prototype. I'd like to dig it up and port it to Javascript some day.

Tetris + Sudoku

I had a new idea earlier this month. I posted a bunch of in-process gifs and thoughts in this thread below:

I ultimately tried a couple of different things:

  • 6x6, 7x7, 8x8, 9x9 puzzles
  • two 6x6 board with a shared pool (harder and less fun than a single board)
  • various puzzle creation rules

This version (12x6) was the most fun, but it's still not that fun. Too frustrating. I like the mechanic, though, so I'm going to repurpose it for something else.

How to Play

  • The game is 1280x720 (no fancy resizing or anything).
  • A puzzle is generated using a specific set of pieces.
  • Each piece has a number that tells you how many times it can be used.
  • Press A/D while dragging a piece to rotate it.
  • Pieces can be picked up and moved freely (no snapping) or stashed on the outside of the puzzle.
  • There's no code for victory, just the thrill of knowing you solved it!
  • Press the button for a new puzzle.