Raid On Java 4K

First many thanks to all for the tips.

@Groboclown:
I tried the tip with the binary gfx data. For that, I had to modify my rotation algorithm a little bit. It turns out, that the char data with the old routine can be compressed better than the binary data with the new routine. In total the original char data is 88 Bytes smaller.

@Moogie:
I made some tests with joined arrays but I can’t get smaller results. Because of my limited spare time I don’t want to invest in this way. Nevertheless thank you very much.

At the end I combined the suggestions from Gef and Harm (Gef optimized the cockpit away ::)) and won 11 Bytes ;D.

Here is the source:
http://pastebin.java-gaming.org/1cfb9983584

I think the secret are the compression tools.

Here are my results (with intermediate results):
Original JAR: 11.228 Bytes
(JARG exists with an exception, so I dropped this step.)
After Proguard: 5.512 Bytes
After Pack200 (without compression): 8.966 Bytes

Now I tried 4 different compression tools on the pack200 result:
KZIP: 4.306 Bytes
7Zip: 4.294 Bytes
BJwflate: 4.260 Bytes
Zopfli: 4.240 Bytes

At the end I used deflopt on every result:
KZIP: 4.287 Bytes
7Zip: 4.290 Bytes
BJwflate: 4.258 Bytes
Zopfli: 4.240 Bytes (winner)

@Gef:
You said you can reach 4080 Bytes. Which parameters do you use with the tools? How does your proguard file look like? Do you have magic tools?

@Groboclown:
I tried to use your 4k utilities on Sourceforge, but I’m not clever enough to handle all this ant stuff. I was not able to setup a runnable build structure in eclipse. In the read me file you described how to create a build structure. But I can’t integrate your tools and I can’t make a build.xml. Maybe I have not enough background information.

no problems, it really does come down to trial and error as to what heuristics will yield extra byte savings.

I have an really old tool which is entirely automatic which i can resurrect if you like.

There are no magic tools, only hours on those mentionned above, to understand how they work and how to combine them.
This is why I love Java4K contest, two challenges : make a game, be able to fit it in 4K !

Here you will find a compression chain for Windows only, adapted to your latest (included) source code (a bit modified and not broken I hope) and you finally should obtain a ~4087kb pack.gz. If any problems with it, modify some paths in proguard config and in “.bat” files.
There is also a little readme.txt that explains how to use it and to test final pack.gz.

@Gef: You are soooo coooool!!! 8)
It works and I uploaded the new version to Java4k!
I dropped a note in the source.

Here is a screenshot:

http://s7.directupload.net/images/140222/lkos6oji.png

I’ll analyze the results of the tools later. I’m curious which tool is the booster. But first I’m really happy that the radar is in the game. It’s an eye candy and useful for the gameplay.

Again, thank you very much to all. I have learned a lot.