← Back to context

Comment by purple-leafy

1 hour ago

Compression is so tricky.

I got really into compression experimenting while I was developing my browser game.

I was trying to compress entire human gameplay matches into a QR code, for upto 60 minutes of gameplay both single player and multiplayer.

My game is a fast paced, grid based, snake x scrabble word game.

My first compression attempt was to do run length encoding and cardinal directions, encoded into 1 byte. This was really compressible data.

The best approach was to use relative direction changes instead of cardinal directions. Compressed even better as the raw data was more consistent (for the most part you are moving forward etc).

Some other attempts were: zone based encoding, double movement pattern encoding (much smaller raw data but less compressible), triple movement pattern encoding, interrupt encoding.

I am at a point where I can fit all 30 minute single player games into a QR code, some 60 minute games, and with a special encoding scheme I can fit 15 minute N player multiplayer matches in a QR code

For reference qr code max size is about ~3000 bytes