Octojam 7 - CHIP8 Game Jam

Octojam 7

I’ll be entering Octojam 7 this year! This is an awesome jam targeting the CHIP 8, a virtual 8-bit gamesystem originally designed for the COSMAC VIP, a microcomputer from the 1970s. It is an unusually limited system:

  • 64x32 monochrome display
  • 3.5 kB memory space, containing both the program and the working RAM
  • A small handful of 16-bit opcodes, with some shortcuts to make games programming a tad easier
  • XOR-based manual sprite blitting
  • Minimal sound output, just a simple buzzer
  • Awkward memory addressing, often requiring self-modifying code

Due to its virtual nature, the run speed of the system is determined by the interpreter program, and several popular extensions exist. Octojam allows both SCHIP and their own XO-CHIP variant, which among other things allow for an expanded screen resolution and more efficient scrolling. The XO-CHIP extension adds two extra colors, and expands the usable memory space to around 64k.

For this jam, I’ve decided not to target any of the expansions, and instead have set myself the following task: Can I make a turn-based RPG, complete with a rudimentary battle system, and squeeze such an experience into the original platform’s limitations? To this end, these are the settings I will attempt to target:

  • Original CHIP8 platform
  • Octo IDE and Runtime
  • VIP Compatability mode
  • 30 cycles / frame

The primary limitation for this challenge is going to be memory, by far. VIP compatability mode forces a memory size of just 3216 bytes, which seriously limits the amount of artwork and content that can be stuffed into a single game. Happily, the smaller screen resolution also means it takes less artwork to fill the screen, even though detail will necessarily be lacking. Compression may help, but due to the 16bit opcodes and general quirkiness of the system, any compression routines need to be carefully counted to ensure the space they save is greater than the size of the decompression routine. That and, at 30 cycles / frame, decompression is going to be quite slow.

To familiarize myself with the environment, I made a “hello world” demo in the Octo IDE, which needed to include a text drawing routine and also a font. At this stage I knew I wanted to target a text-heavy RPG, so I went ahead and made a compact 5x3 font, and a small routine to decompress bit-packed glyphs for text display. The slow decompression speed looks intentional. It’s a feature! A proof of concept is located here: http://johnearnest.github.io/Octo/index.html?key=HRmUqx5Q

Okay it's technically 6x3, the extra bit is a vertical offset

Just this text demo, a font containing not much more than 64 glyphs at 2 bytes each, and a fairly minimal text drawing routine and scaffold, is already at 405 bytes, nearly 12.5% of the budget for the project. This is going to be a tight squeeze if it works at all. We’ll see!

I’ll try to post regular progress updates as I go. Best of luck to all jam participants!

  • Zeta