4k contest is where?

hi wheres the 4k contests website? when did this contest start?when does it end?

This year’s 4k contest was started over at suns forums (as usual).

http://forum.java.sun.com/thread.jspa?threadID=579342&tstart=0

Spin off thread over here:
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=announcements;action=display;num=1103678522

Woogley’s page about the contest:
http://woogley.net/java4k.html
(not really the official page since is was build as an after thought to fill the gap)

Growing list of games is here:
http://woogley.net/games.html

It started around xmas (dec 13th actually) and it ends end of february. So there is still around a month left.

[quote](not really the official page since is was build as an after thought to fill the gap)
[/quote]
heh “after thought” is about right. Although I do plan on keeping these games as an archive and host the official site next yaer unless there are some serious objections to that o_O;

The thing is you aren’t allowed to redistribute the games unless you got the permission from the author.

So… for avoiding any problems everyone should add a readme file, which contains something like…
snip

I think it would be nice if we would come up with a nice format for that readme. I just made a draft…

5 previews later… grml… curse you yabb :stuck_out_tongue:

http://kaioa.com/k/4kreadmedraft.txt

Any suggestions?

what program do you guys use to create the most effectively compressed .jar files? what about war files?

i have my game up and running with fullscreen hehe and its already 3861bytes :stuck_out_tongue:

  • a method for custom drawing lines and bufferedimage

ASAIK war and jar are both just zip files.

To make 'em:
kzip. Try playing the the “block” option (I found /b128 shrank the file by a good few bytes).
7zip. Use it to make .zip files, not .7z files. :slight_smile:

and what class file reducer do you use?
I have tried JOGA and ProGuard3.2 but it seems they only work with .jar files and i would like a utility that can be run from a bat file so i dont have to run the gui every time i recompile:)
my game is now 5156bytes zipped with 7-zip program…7-zip gives me 5byte better compr. then kzip hehe

ProGuard 3.2:
At the commandline:


java -jar "e:\proguard3.2\lib\proguard.jar" @pgtm.pro

The pgtm.pro file:


-injars       Mlk3D.jar
-outjars      Mlk3Do.jar
-libraryjars  <java.home>/lib/rt.jar
-printmapping proguard.map
-overloadaggressively
-defaultpackage ''
-allowaccessmodification

-keep class Mlk3D extends java.awt.Frame  {
    public static void main(java.lang.String[]);
    public int compare( Object, Object);
}


My complete build process:


// cpp -P Mlk3D.jp -o Mlk3D.java && javac -source 1.4 -target 1.4 Mlk3D.java
// zip  Mlk3D.jar Mlk3D.class
// work: java -jar "z:\proguard3.0.1\lib\proguard.jar" @pgtm.pro
// home: java -jar "e:\proguard3.2\lib\proguard.jar" @pgtm.pro
// echo y | unzip  Mlk3Do.jar
// kzip /y /b128 Mlk3D.jar Mlk3D.class

From http://www.woogley.net/j4k/mlk/Mlk3D.html

Only 1 obfuscator mlk :o

Uh?

Yeah, I never been bothered to figure out the rest :smiley:

I keep playing to write some funky ant task that will use each of the combernations (proguard/kzip,jax/kzip,jax/7zip…) and then delete all but the smallest, but I’m lazy :wink:

jax->jarg->kzip should produce the smallest (or at least pretty small) files.

Well, I can’t be arsed to use jax. Didn’t got it working the last time I tried.

could you also / someone please post the smallest code you know for just initiating an fullscreen application with bufferstrategy? I believe i have alot of “correct” stuff in there on how to do fullscreen…like checking what modes are available on the computer etc…

The smallest possible has to be written in bytecode.

In Java, you want something like :-

GraphicsDevice gd;
(gd = getDevice()).setFullScreenWindow(this);
gd.setDisplayMode(new DisplayMode(1024,768,16,60));

// the rest of your init code...
// (you will run into problems if you try and create the BufferStrategy immediately after the DisplayMode has been changed)

createBufferStrategy(2);

I gotta say, im amazed how poor all the obfuscators are at producing size optimal code.
I guess that is the next size optimisation step for the 4K contest entrants - write your own bytecode optimiser - I estimate a further saving of 1-2% (beyond the most optimal implementation possible in straight Java)

[quote][…]
I guess that is the next size optimisation step for the 4K contest entrants - write your own bytecode optimiser - I estimate a further saving of 1-2% (beyond the most optimal implementation possible in straight Java)
[/quote]
1.5 Webstart compression (pack200/gzip) yields much more. 4442 byte (jarg/kzip) vs 3342 byte (jarg/p200/7z gzip) :slight_smile:

Surely the overhead to launch a Webstart app is going to eat all that gain.

p.s.

Beyond automated bytecode optimisation tools, we could start writing in assembly.
It gives you soooo many more options.

[quote]Surely the overhead to launch a Webstart app is going to eat all that gain.
[/quote]
I believe mlk just stated in another thread that the Webstart descriptor doesn’t count.

I just ran pack200 on a Robotron4096 jar. 4,087 bytes down to 3,468! That’s over 500 bytes saved! :o

[quote]Beyond automated bytecode optimisation tools, we could start writing in assembly.
It gives you soooo many more options.
[/quote]
Erm… knock yourself out. Unfortunately, I don’t think you’ll gain much more than a good bytecode optimizer will give you. Not to mention that the JAR compression is actually going to work against you as you reduce redundancy.

So Abuse, when do we get to see your entry? The world is holding their breath waiting! :slight_smile:

Surely the webstart descriptor has to count if your app. will only work when using webstart ???

Allowing jars that weren’t self-executing was a slight but acceptable flex in the rules - allowing a whole webstart descriptor fo free is a huge change, and opens the door for many possible abuses.

For starters you can specify command line parameters for free if the webstart descriptor isn’t included.

Thats what I initially thought - however, I disassembled my game last year, and straight away could see dozens of simple optimisations that would cumulatively save 50-100 bytes.

Beyond that it would require code restructing, to take better advantage of the single byte %load_# instructions

I’m not saying it’d be easy, but there is definitely space to be saved there =)

[quote]So Abuse, when do we get to see your entry? The world is holding their breath waiting!
[/quote]
Coding all day at work doesn’t fill me with enthusiasm to code at home in the evenings/weekends =/

If I take a week off work, then maybe =)
(still got 1 or 2 ideas Kev hasn’t pre-empted ;))

Surely the webstart descriptor has to count if your app. will >only work when using webstart ???

The html doesn’t count if it’s an applet. (Was that different in the past?)

For starters you can specify command line parameters for
free if the webstart descriptor isn’t included.

Parameters aren’t allowed if their purpose is to carry some data. They are allowed for changing the default behaviour like using 16bit instead of 32bit.

[quote]Parameters aren’t allowed if their purpose is to carry some data. They are allowed for changing the default behaviour like using 16bit instead of 32bit.
[/quote]
I believe the rule was that the game must be capable of being run without parameters. e.g. If I downloaded your webstart JARs and created my own webstart file with no settings, it should still run. This rule was put in place to ensure that options could be used, but that no massive data sets were being space shifted out of the JAR file. :slight_smile:

Hey woogley, I wanna add my games to the 4k Game contest. How do I submit my games?

See link
http://luisoft.o-f.com/projects/games/main.html

Tks,