Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Need Help Compressing  (Read 5191 times)
0 Members and 1 Guest are viewing this topic.
Offline Rowdy

Senior Newbie




High School Student, wanting to make games.


« Posted 2009-01-27 23:28:31 »

I saw this competition and decided to compete in it, and over the weekend I finished my game. It's called Arena4k, but it's 5-6k... I tried compressing with 4KJO and other compressors, but they always give me errors even though the jar runs fine. If someone could help me out or point me out to a good compressor, that would be great.

Thanks in advanced,
Rowdy
Offline luisoft

JGO Coder


Projects: 6


Java games rock!


« Reply #1 - Posted 2009-01-27 23:38:57 »

I have a similar problem with 4KJO... when I run it gives lots of error messages and the compression is not good. I'm currently using proguard4.3 version but the result is not good... I can get around 30% of compression.
Offline Rowdy

Senior Newbie




High School Student, wanting to make games.


« Reply #2 - Posted 2009-01-28 00:54:01 »

I haven't been able to compress mine really because I have a mac and most run .exe or .bat files, and my windows pc is terrible. Oh, and btw I have been running all of this on the pc.

Good Luck with your game luisoft,
Rowdy
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hsaka
« Reply #3 - Posted 2009-01-28 02:13:02 »

Have you guys edited your manifest files as shown here: http://wiki.java.net/bin/view/Games/4KGamesDesign?

Also, after you run Proguard on your jar, run JOGA (provided in the 4KJO package)  on the resultant jar.
Then extract the contents of the compressed jar to a folder, edit you manifest if you didn't before and run BJWFlate and DeflOpt (also in the 4KJO package). [make sure you use the -r switch to recursively go through the subdirectory]

These should compress your jar nicely.
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #4 - Posted 2009-01-28 02:59:54 »

some of the optimisers used in 4KJO are a little overzealous and can "optimise" away whole code banches! others have problems even performing an optimisation with out errors. It is pretty anoying, but the only real way is to identify which of the optimisers are causing the issues and then create a custom config script using the -GUI option and removing the offending optimiser(s).

or if you want, attach your jar and i will see if i can create a script which will work for it.
Offline halfwitgoat

Junior Member


Projects: 2



« Reply #5 - Posted 2009-01-28 19:51:10 »

Have you guys edited your manifest files as shown here: http://wiki.java.net/bin/view/Games/4KGamesDesign?

If you are using Web Start, then you don't actually need a manifest. Just put
1  
<application-desc main-class="Main"/>
in the jnlp file.

Offline Rowdy

Senior Newbie




High School Student, wanting to make games.


« Reply #6 - Posted 2009-01-28 22:23:37 »

Ok, thanks for the responses. I took Hsaka's idea and got ProGuard and JoGa to work which brought it down to just over 4k (4101 bytes, it's killing me), and I used both of the zip programs which compressed them in the zip file, but when I extracted them, they went back to normal size. So, im pretty sure I can go through my code more and get it down to 4096 bytes. Thanks for your help.

Rowdy
Offline zeroone
« Reply #7 - Posted 2009-01-28 22:49:23 »

Quote
If you are using Web Start, then you don't actually need a manifest.

Really?  I didn't know that.
Offline Hsaka
« Reply #8 - Posted 2009-01-28 23:16:16 »

Quote
I used both of the zip programs which compressed them in the zip file, but when I extracted them, they went back to normal size.

I'm not sure if I understood you correctly, but after you zip up the .class file and the manifest folder, you will get a resultant .zip file [let's say myGame.zip]. Then you just need to rename myGame.zip to myGame.jar

You don't extract them after you zip them up.


Quote
If you are using Web Start, then you don't actually need a manifest.

Also did not know this. Would save 17+ bytes!
Offline Rowdy

Senior Newbie




High School Student, wanting to make games.


« Reply #9 - Posted 2009-01-28 23:26:52 »

Oh, I misunderstood what you wanted me to do... my fault. I got it to 4077 without that though, now I can make it even smaller, thanks a lot!

Rowdy
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hsaka
« Reply #10 - Posted 2009-01-28 23:32:27 »

No problem.
Good luck with your game; I look forward to playing it  Wink
Offline EnderGT

Junior Member





« Reply #11 - Posted 2009-01-29 12:21:00 »

Also did not know this. Would save 17+ bytes!
I knew you didn't techincally NEED one, but I've been stubbornly including one because I thought you were SUPPOSED to have it for this contest...

A quick test using my nowhere-near-4k-yet project shows that, including headers, removing the 17 byte manifest saves a whopping 133 bytes. I guess this is due to the path and file name as well as the file contents.

Guess I'll be removing that manifest Smiley
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #12 - Posted 2009-01-29 13:08:25 »

If 4KJO doesn't perform better than, say, JOGA + winzip, I'd say you're probably doing something wrong. If you upload & link the JAR or preferrably the unobfuscated class file I'll be happy to see if I can compress it further for you Smiley

Offline EnderGT

Junior Member





« Reply #13 - Posted 2009-01-29 14:16:27 »

I knew you didn't technically NEED one, but I've been stubbornly including one because I thought you were SUPPOSED to have it for this contest...
Ok, I've been thinking this through all morning, and I think the rules of the contest might not let us (me) take advantage of this.

Specifically:

Quote from: www.java4k.com
# If your JAR is below 4K until you sign it, you must provide a runnable unsigned JAR to demonstrate the game meets the competition rules.

Although, now that I read it again, it does say "runnable" not "executable" - so maybe it can be removed after all, as you can still run the game from the command line, you just have to specify the main class.

Judges, can we get a ruling? Smiley
Offline pjt33
« Reply #14 - Posted 2009-01-29 14:36:38 »

The rules of the contest say you have to supply a JNLP file. If you have one of those, you don't need a manifest.
Offline EnderGT

Junior Member





« Reply #15 - Posted 2009-01-30 01:22:41 »

The rules of the contest say you have to supply a JNLP file. If you have one of those, you don't need a manifest.

True, but it also says

Quote from: www.java4k.com
# If your JAR is below 4K until you sign it, you must provide a runnable unsigned JAR to demonstrate the game meets the competition rules.

Since my jar will definitely be over 4K when signed, I will need to provide a runnable unsigned jar that is 4k or less to prove that my game qualifies. Since java will not accept any jar file that does not have a manifest, the manifest must be present for the jar file to be runnable. As such, you cannot use an unsigned manifest-less jar file as your final determination of size - you must use either the signed jar file with no manifest, or an unsigned jar file with a manifest.

I don't like this conclusion, as it means I haven't gotten it as small as I thought I had, but them's the rules until a judge says otherwise.
Offline zeroone
« Reply #16 - Posted 2009-01-30 15:31:00 »

We definitely need a ruling on this manifest issue.  Judges??
Offline tom
« Reply #17 - Posted 2009-01-30 17:49:23 »

You only need to sign the jar if you need all mermisions like using the Robot class. In which case you are allowed to submit an unsigned executable jar (with a manifest) as well. The executable jar will usually be smaller than a singed jar and will be used to prove the game is 4k.

Offline zeroone
« Reply #18 - Posted 2009-01-30 20:19:47 »

Quote
You only need to sign the jar if you need all mermisions like using the Robot class. In which case you are allowed to submit an unsigned executable jar (with a manifest) as well. The executable jar will usually be smaller than a singed jar and will be used to prove the game is 4k.

And about the manifest?
Offline tom
« Reply #19 - Posted 2009-01-30 22:20:42 »

The executable jar must have a manifest, or it is not executable.

Offline EnderGT

Junior Member





« Reply #20 - Posted 2009-01-31 02:32:06 »

The executable jar must have a manifest, or it is not executable.

I was afraid of that. Oh well, guess I need to find another way to drop 133+ bytes Smiley
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #21 - Posted 2009-01-31 02:53:39 »

I was afraid of that. Oh well, guess I need to find another way to drop 133+ bytes Smiley

Remove whatever feature it is that requires functionality protected by the security model?

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline EnderGT

Junior Member





« Reply #22 - Posted 2009-01-31 05:58:18 »

Remove whatever feature it is that requires functionality protected by the security model?

Not an option, it's kinda the whole core of the game Sad
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (35 views)
2014-07-24 01:59:36

Riven (35 views)
2014-07-23 21:16:32

Riven (22 views)
2014-07-23 21:07:15

Riven (26 views)
2014-07-23 20:56:16

ctomni231 (56 views)
2014-07-18 06:55:21

Zero Volt (48 views)
2014-07-17 23:47:54

danieldean (39 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!