Developing Slot Games for js13k: What Fits, What Doesn’t, and Why That’s a Win

Imagine trying to fit one of the most graphically detailed casino games into just 13 kilobytes of JavaScript. That's what the js13kGames is all about. It is a creative competition where developers from all over the world are invited to create games within the 13kb limitation. For context, 13kb is approximately 2000 words of plain text if written on a Word document. No formatting, no images, no styling.

Since js13kGames uses JavaScript, the games have to be browser-based. Their small size means the games will load much faster and run much smoother, even with a very poor internet connection. For many games, developing a js13k version would mean doing away with fancy effects and elaborate menus. But for slots, this would mean stripping everything down to the barest minimum because this is a game that is known for its layered animations, flashy graphics, and distinct audio effects.

Modern Slots

Slots are arguably the most popular casino game globally, whether at fancy resorts or online. Modern slots are packed with exciting reel animations, high-definition symbols, and multiple layers of gameplay. This is especially true for online slots. With real money on the line, casino operators ensure that every detail is well taken care of. Online slots of today accept cryptocurrency payments, offer huge welcome bonuses, and a wide variety of slot games. At any given time, the slot system tracks multiple bonus rounds, jackpots, and all paylines. All of these, including the RNG, the system responsible for randomness and fairness, have to work as designed. (Source: https://www.pokerstrategy.com/online-casinos/real-money-slots/)

As you can imagine, none of these will fit into a 13kb script. So what can developers do?

What Fits?

First, developers need to go back to the basics. The fundamental mechanics of slots are that you press a button, the reel spins, and symbols appear. The pleasure is in the anticipation and the outcome. If the same symbol aligns, then you win. If not, you lose. Try again. It is as simple as that.

Based on the basic mechanics, the Random Number Generation (RNG) can fit. This is an essential part of the mechanics. JavaScript has a function called Math.random(), which can take care of that. It will return a set of random numbers, which can be used when the reel spins for symbols. It can also be used to determine when a player can win. The result is totally random, as the function suggests.

Basic visuals can also fit. Instead of having images for symbols, simple text characters can be used. And in order not to make it too bland, a CSS transition can be added to simulate the spinning of reels. For sound effects, all that is needed is a ‘win’ and ‘spin’ effect. Coders can find such effects in audio synthesizers like ZzFX. These two tiny effects take up only about 100- 200 bytes (which is much less than 1kb).

What Doesn’t Fit

With a 13kb limitation, it is obvious that many features will not make the cut. These include anything 3D like assets or spritesheets, loot boxes, space for advertisements, and ‘free spin’ prompts. There is no room for any form of bait-and-switch. These are all nice-to-have features that make commercial slots very attractive. But without them, what you have is a clean, minimalist game. And since payouts will require payment gateways, that too can be eliminated. This is where creativity can even come into play. What if, instead of payouts, “winning” reveals new game elements? Or maybe the symbols are part of a larger puzzle since they are in text characters. Or what if instead of three symbols, there is just one? In this case, there is no need to use text characters as a simple emoji or icon can work just fine. This is the part to ask: what else can slot machines do?

Constraints Breed Creativity

Many developers fear limitations. While this is understandable, in reality, having these limitations forces one to get creative. Take, for example, renowned author Dr. Seuss and his The Cat in the Hat story. This book is famous not just for its whimsical style but also because it was written using about 250 unique words, most of which were chosen from a list of simple, early-reader vocabulary. This is what limitation can breed.

With only 13kb, one has to think small, literally. One has to ask what the essentials are and what is fluff? At the end of the day, you would create a game that is clean, functional, creative (in its own unique way), and maybe even meaningful. All of these might just be what some players out there are looking for in a slot game.

🔙 Back to Articles list.