YOYOZO (or, how I made a Playdate sport in 39KB) ⌘I Get Data
A sport I made for the Playdate handheld was launched in the present day! Go buy it after which come again to learn this weblog submit.
It’s referred to as YOYOZO and in it you management an area yo-yo and have to gather stars in a form of cosmic ballet. Nicely, at first it’d really feel slightly like being on a fairground journey, however finally you’ll turn into ok for it to really feel like ballet.
Probably the most superb factor about this sport, for me, is that launch model weighs in at a file dimension of solely 39KB. I nonetheless discover it laborious to imagine as the sport accommodates a lot! On this weblog submit I’ll go into the main points.
Playdate?
Playdate is a handheld gaming system with a singular crank enter technique. I don’t use the crank on this sport, however I’ve executed prior to now and can do once more sooner or later.
For those who personal a Playdate you should purchase the sport now at https://play.date/games/yoyozo/. For those who don’t personal a Playdate, properly, what are you waiting for?
However…why?
The drive to supply a small sport began after I despatched the primary playable model to testers from the Playdate Squad Discord Server. Steve at Scenic Route Software, purveyor of high quality video video games, commented how tiny the sport was. At that time it was 18KB, however had no music or sound results or polish. There was a protracted method to go.
Even so, I questioned how doable it could be to construct the sport out with a watch on protecting file dimension “low”. I believed again to the times of my youth the place complete video games would match on a single floppy disk, with room to spare. If they might do it, shouldn’t I give it a strive?
It’s value noting that even with this mindset, I didn’t make an enormous sustained effort to fulfill the aim. Quite the opposite, it was simply one thing I merely stored in thoughts as improvement proceeded. For that motive, I’m positive there are extra methods the sport may very well be made even smaller than it’s, with the very same code and content material. For instance, I by no means tried discovering essentially the most optimum format for issues like music and particle knowledge that are the 2 largest units of embedded knowledge.
Lastly, it’s value noting that this isn’t a problem, or me throwing down the gauntlet in any method. It’s straightforward sufficient to make a smaller sport, be it comparable or fully completely different, you’d simply should make completely different decisions alongside the way in which. This was simply me doing one thing nerdy as an extra limitation on high of the already pleasurable limitations of growing for Playdate.
Causes
-
The primary motive for the small file dimension is the truth that the sport doesn’t use any digital sound recordsdata, and only a few bitmap pictures (the launch card and animation should be bitmaps, and in-game solely the brand and fonts are bitmaps). Recreation graphics are all drawn utilizing solely shapes (traces, rects, circles) and fills (black, white, and dither patterns).
-
A second motive is that while I take advantage of the bottom Playdate Lua SDK, I don’t use any of the extra “CoreLibs”. The one additional graphics features I wanted had been for drawing outlined or crammed circles, so I take advantage of two of my very own wrapper features which are just like these from CoreLibs/graphics however mine are smaller and extra particular. For timers, I take advantage of a easy body/tick system, an method which has execs and cons, nevertheless it’s ok for me.
-
A 3rd motive is that I made the powerful choice to scale back system property, which suggests there isn’t any animated launcher card. This was a troublesome one, nevertheless it added a lot to the file dimension I made a decision towards it.
-
Lastly, I observed that together with knowledge inside your sport code usually trumps how properly you’ll be able to compress it and retailer it externally. For instance I attempted compressing the music knowledge and storing it in an exterior file, however the sport last file dimension was bigger than if I embedded the info in my Lua code. Plus, it’s quicker because it doesn’t must load an extra exterior file.
Breakdown
I believed it could be cool to stipulate the principle options and the way every contributes to the full file dimension. Observe that the sizes are expressed as portions of the compiled binary, reasonably than uncompiled supply code. It’s additionally value noting {that a} clean venture with an empty replace operate leads to a compiled binary of solely 147 bytes.
Content material | KB | % |
---|---|---|
Essential code | 19KB | 49% |
Two music tracks | 5.5KB | 14% |
Three bitmap fonts | 2.5KB | 6% |
Synthesized sound results | 2.5KB | 6% |
Customized particle system | 2.0KB | 5% |
Animated system icon | 2.0KB | 5% |
Animated system card | 2.0KB | 5% |
Pulp music engine (modified) | 1.5KB | 4% |
On-line scoring system | 0.5KB | 1.25% |
The right way to play directions | 0.4KB | 1% |
Customized soundtrack functionality | 0.1KB | 0.25% |
“Essential code” accommodates: physics simulation, sport construction and state administration, multi-layered scoring and bonus system, rating/stat monitoring, loading and saving stats and settings, path recording and playback, animated introduction, plus the next dynamic methods: scrolling starfield, display shake, music system, sound results system.
Deserted and eliminated options
- I attempted a bunch of stuff throughout improvement. Similar to asteroid fields or meteor showers that launched obstacles that wanted to be averted, and black holes that will magnetically appeal to the ball. However I felt they detracted from the pureness of the idea, so I didn’t go any additional with them.
- The positions of stars are randomly generated, however I’ve carried out a set “each day” format within the sport, which is basically enjoyable. It’s a unique expertise to have the ability to play the identical format again and again, bettering your execution of the identical strikes and eking out larger and better scores. I’ll reintroduce that choice when Playdate Catalog will get rating boards that reset each day.
Guide/Information
I believed it could be enjoyable to put in writing a guide/participant’s information within the old-school model. I really like studying these kinds of manuals, the place the developer provides you slightly glimpse behind the scenes so that you get an understanding of how the sport works, with some small hints and ideas littered all through—for essentially the most inquisitive gamers! If that feels like your factor, download the manual from the game page.
Credit
YOYOZO is a sport by Matt Sephton, with music by Jamie Hamshere.
Due to CANO-Lab and Playdate Squad Testers.