Welcome to js4kgames.

The JavaScript Game Competition in just 4 KB

What is js4kgames?

The js4kgames competition is a fully automated JavaScript coding competition for game developers. The goal of the competition is to create the best game possible in JavaScript within a 4K limit. That means a maximum of 4096 bytes!

Why is it automated?

For two simple reasons:

  • To remove the need for an organiser to keep the contest going.
  • To make the judging consistent, fair and acceptable to all.

In the past, the organisers of such contests have put in a considerable amount of their own time over many months to ensure the success of the competition. It can be very demanding, and this is why we often see organisers bow out after a few years. By fully automating the competition, it is hoped that it will continue to run automatically for decades, and to be scalable and sustainable regardless of increasing entrant numbers.

But why 4K?

When the js4kgames contest was conceived, there already existed a js13kgames competition, and a js1k demo competition. Many people who enter these competitions wish that there were more regular competitions with similar rules. The js4kgames competition gives JavaScript game developers another annual contest to fill that gap. And by using a size limit between the two, the js4kgames contest hopes to appeal to the participants of both.

The 4K Legacy

It also hopes to continue the legacy of the 4K limit that the long running Java 4K contest firmly established in years gone by. The Java4K contest began not long after Ludum Dare, and can boast none other than Notch as a two time winner and regular participant. Sadly it was announced on the 29th November 2014 that the Java4K contest was being been discontinued after an impressive 12 year run. Picking 4K as the limit is a tribute to that great contest, and it is certainly hoped that js4kgames will appeal to the many entrants of the Java4K contest over its long history, by providing a similar feel and challenge.

Can JS capture the same challenge?

To answer this question, three popular Java4K games were ported to JavaScript to establish a size comparison. By doing this, it was discovered that exactly the same games could be built using JavaScript and the canvas and still fit within a 4096 byte limit when minified then zipped. In fact JavaScript has an amazing ability to minify and compress. In one example, a 50K JavaScript source file minified down to 21K and then zipped below 4096 bytes. The size comparisons with Java, for this particular example, were roughly the same in each comparable form. For one of the games converted, the result was just over 3K. So if anything, there could be slightly more room to play with.