J4K

I don’t know if many of you read the game forums at sun, but the last few years I’ve run the J4k competition. Write a game, which fits in a 4K JAR (include all needed resources).

The (rather organic) rules are:

[] The game (byte code + resources) must be 4096 bytes (4kb) or under
[
] Must be a playable game
[] Must be pure Java (no JNI)
[
]The program should be entirely self-contained and must not reference resources from another pc over network.
[]The presentation (jar, class, or other) does not matter, as long as the code can be directly run from the shell.
[
]The target JRE is 1.5.

I invite you all to come join in the fun..

The SuperPackME toolset is now available! This release includes the complete toolset for generating SuperPackME files, as well as the Hexidecimal encoder and Class Inliner! With these tools, you should be able to get an 80% or more reduction in code and data sizes!

To download, simply visit:

http://jgcwiki.datadino.com/jgcwiki/index.php?title=Image_Compression_Technology

Scroll to the bottom of the page, and click on “SuperPackME Tools” to download. The page itself describes the SuperPack and SuperPackME formats.

I will be happy to help anyone who’s has questions about the toolset. You can reach me here or by email at jbanes@gmail.com.

Good luck everyone, and let’s make this a year for the record books!

Edit: BTW, I dished out some numbers on the Official 4K contest thread. Some highlights:

[quote]… Current results for 3-4 color images, is 37% of the original crushed PNG size! I’ve also developed a new tool that allows the data to be inlined into the class file. This not only saves space from the ZIP Headers, but it also allows the data to be processed without expensive references to the java.io package. Current results have 1126 bytes of PNG data, plus SuperPack loader, plus fullscreen support fitting into ~1.6K. That leaves about 2.4K for game logic! …
[/quote]

[quote]… The new format can pack images with up to 255 colors. And the fewer colors you use, the better the images pack! With about 127 colors, you can get between 5-15% reduction over crushed PNG files. With 63 colors, you can get about 25% reduction! Even better is that the output file compresses even more in the JAR! …
[/quote]

Here’s my first entry:

http://www.cokeandcode.com/4k/tilt

Kev

Kevglass, that was great.

re: one letter var names, private var names are
compiled out, as are method params and vars in
methods if compiling with -g:none, public stuff can
be removed with a obfuscator. If you are really evil
(like me) you can even use a precompiler (stop
stairing at me like that).
I hope you don’t mind, but I took the liberty of
throwing it through ProGuard [
http://proguard.sourceforge.net/ ], shrinking the
size of the jar to 3936 bytes (giving you loads of
space for more levels, yeay!).

Current Entrys:
oNyx
No Manifest, requires sound bank (JDK)
http://kaioa.com/games/jm4k.zip

mdb47
http://www.meatfighter.com/4k

Woogly has also dontated webspace for entrys, see JDC thread

Mlk
(must learn to preview :slight_smile: )

How about a section on JGF? I’ve got some placeholders pencilled-in for programming competitions (c.f. the thread on here about rules, sizes, etc, that is being used as the basis for a JGF competition, although that’s not ready yet). With 4k games, the biggest issue is simply how to integrate the comp information with the JGF site so that all the information is there but the rest of JGF doesn’t get in the way.

Current thinking is/was (open to better ideas):

  • games entered for competitions have a unique category in the DB
  • each competition can be selected individually, giving a list of entries + metadata + a screenshot + logo for each one
  • …or all competitions at once, with sort-by-size, sort-by-date, sort-by-name, etc
  • a “competitions” index page acts as a bookmarkable entry point with:
    • news on current and upcoming competitions
    • section listing winners of all recent competitions
    • links to rules + details of organizers + etc for each known competition
    • quick-links for submitting games to competitions via the JGF site (free hosting, game appears in the main JGF games list as well, etc)

If you’d like to get a set of pages up on the JGF preview site (http://javagamesfactory.org) I can get it up and running pretty fast (it’s only cunning stuff like automatic JNLP that is broken - the basic stuff like making new pages etc is all working fine :)).

Thanks blahblahblahh, the more places to upload the merrier :slight_smile: I’m all for it. ;D

If you could collate all the existing info you have (rules, guidelines, useful links, previous games, current games - anything you can think of) then I’ll format it all into pages (and stick your name on it as the contact :)).

Just copy/paste into a long email to ceo @ grexengine.com all the info you have.

(Obviously, in the future, I’d hope to have this A) automated and B) something you can administer/configure directly as the “owner” of the competition; right now I’m concentrating on getting games + auto-jnlp working :/)

ooh. I’ll try whipping up an entry. :smiley:

lol, Wurm 4K… ;D

Interesting…

Like alot of people I suppose, I’ve missed the previous years. Are the entries archived anywhere?

[quote] Are the entries archived anywhere?
[/quote]
Alas not, you can most of last years. (alas Sun changed the way URLs work(1) on the forums). The first 4K was Inappropriate content and killed. Yeay sun ::slight_smile:

(1) Read: Made them stop working.

I posted a list of some of the cooler ones here. The second year can be found here. Saber X used to have an archive of the first year here, but it looks like it’s gone. :frowning:

I love archive.org
I wonder howmany are still live?

Reakon Woogley would extend the current j4k site to include a definitive list of entries each year?

Kev

This is more fun than I thought it would be. =D

[quote]Reakon Woogley would extend the current j4k site to include a definitive list of entries each year?

Kev
[/quote]
…trying to get it all into JGF at the moment, which would preserve them all indefinitely, using W’s design + data along with all the other info. It’s a bit worrying that on the first pass of a list of pages needed for the competition I forgot to include a results-per-year page ::). So, um, if anyone can think of any other pages that are needed and not present on W’s site, please post them.

Hoping to get the site minus binaries up PDQ (today?), with binaries to follow once the game-submission thing is tested/working.

http://www.mojang.com/j4k/screenshot.gif

http://www.mojang.com/j4k/

[quote]Reakon Woogley would extend the current j4k site to include a definitive list of entries each year?

Kev
[/quote]
yes I wouldn’t mind publishing a more complete J4K site, and I think it would be a great idea for its home to be on JGF (seeing as it is a java gaming resource site)

p.s. Markus: great job in that Sonic game. Will you be releasing the source? :smiley:

Phew, that sonic game is smooooooth!

Nice one!

Kev

:o

Wow ;D

And it even runs ultra smooth on my old hardware :slight_smile: