Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (604)
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  
  Compression toolchain  (Read 3476 times)
0 Members and 1 Guest are viewing this topic.
Offline bysse

Senior Devvie


Medals: 3
Projects: 1



« Posted 2010-02-08 21:09:02 »

With the code (riven/pjt33) and hints from the thread, http://www.java-gaming.org/topics/java-4k-resources-thread/21630/view.html,
I've put together a compression tool. Hopefully it will do almost the same thing as riven's web service but locally.
I personally like to be able to tweak all parameters of everything!

On the first run the app will write a configuration file where you adjust the path and parameters for 7z, proguard and kzip manually. So you will also need to download them. This is only tested on linux and i don't even have an appletviewer configured for the browser so my modifications to pjt33's server code is totally untested.

Also i've been having some trouble running the Zip2Gzip (http://www.java-gaming.org/topics/java-4k-resources-thread/21630/msg/177304/view.html#msg177304) on the files generated by 7zip. So right now they aren't run through it at all. I'll setup a google code project for this if it ever reach some kind of stable state Smiley

Toolchain:
  javac->jar->(proguard)->pack200->[kzip -> zip2gz | 7zip]

And here is the file:
  http://static.slackers.se/files/fourk-0.1.jar

Please let me know about the errors you find.
Thanks
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2010-02-08 21:18:17 »

So how do the file sizes compare with my webservice?

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline bysse

Senior Devvie


Medals: 3
Projects: 1



« Reply #2 - Posted 2010-02-09 09:08:01 »

Well my app produces bigger results, no question about that. But it gives you the chance to do a decent compression offline and be able to tweak the parameters if you like. That said, i will still use your service to get the "real" lower bound size for the final jar.

Here is a comparison between the two:
java-four-kay-shrinkfourk
G.java => 2115 bytes
G.class => 1426 bytes
G.normal.jar => 991 bytes
G.progrd.jar => 884 bytes
G.normal.pack => 793 bytes
G.progrd.pack => 746 bytes
G.normal.7z.pack.gz => 661 bytes => test
G.progrd.7z.pack.gz => 627 bytes => test
G.normal.kz.pack.gz => 635 bytes => test
G.progrd.kz.pack.gz => 601 bytes => test
G.normal.bj.pack.gz => 647 bytes => test
G.progrd.bj.pack.gz => 608 bytes => test
G.java                          2034 bytes
G.class                         1426 bytes
G.normal.jar                   999 bytes
G.proguard.jar                 884 bytes
G.normal.7z.pack             718 bytes
G.proguard.7z.jar             991 bytes
G.normal.kz.pack.gz         634 bytes
G.proguard.kz.pack.gz      902 bytes

As you can see i'm not sure about the name standard or in which order to run these tools Smiley I need to take a big long look at the naming standard...


(edit) Forgot to mention, G.java is the template from this post - http://www.java-gaming.org/topics/applet-templates/21626/msg/177577/view.html#msg177577
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline pjt33
« Reply #3 - Posted 2010-02-09 10:31:11 »

Also i've been having some trouble running the Zip2Gzip (http://www.java-gaming.org/topics/java-4k-resources-thread/21630/msg/177304/view.html#msg177304) on the files generated by 7zip.
I don't have a Windows machine, so I don't think there's any way I can test 7zip. If you could create a really small zip file with it (e.g. zip a text file with contents "Test") and get it to me somehow (maybe post it UU-encoded) then I can try to look into this next week.
Offline bysse

Senior Devvie


Medals: 3
Projects: 1



« Reply #4 - Posted 2010-02-09 10:56:44 »

I don't have a Windows machine, so I don't think there's any way I can test 7zip. If you could create a really small zip file with it (e.g. zip a text file with contents "Test") and get it to me somehow (maybe post it UU-encoded) then I can try to look into this next week.

Here is a test archive, http://static.slackers.se/files/test.7z, it contains readme.txt with the contents 'Test'.
There is a port of 7zip available at:  http://sourceforge.net/projects/p7zip/files/ or in aptitude 'p7zip-full'. Don't know about mac though.

Before you start debugging let me run some additional tests tonight, there is always a chance I've messed up.
Can you also confirm the toolchain i wrote down in my first post? I'm kind of a beginner with this compression business Smiley


(edit) The file in base64:
1  
2  
3  
N3q8ryccAAOcDTHwCgAAAAAAAABUAAAAAAAAADju/HYAKhlKZ2vNEoAAAQQGAAEJCgAHCwEAASMD
AQEFXQAAAQAMBQAICgHCGnj6AAAFAREXAHIAZQBhAGQAbQBlAC4AdAB4AHQAAAAUCgEAgOodS3Wp
ygEVBgEAIICkgQAA
Offline bysse

Senior Devvie


Medals: 3
Projects: 1



« Reply #5 - Posted 2010-02-09 21:17:21 »

I don't have a Windows machine, so I don't think there's any way I can test 7zip. If you could create a really small zip file with it (e.g. zip a text file with contents "Test") and get it to me somehow (maybe post it UU-encoded) then I can try to look into this next week.

Don't bother looking at this problem Smiley I was compressing the files to 7zip format so it's kind of obvious why the zip2gz converter didn't work. Sorry for wasting your time.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 841
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2010-02-09 21:30:21 »

Well, it seems you are trying to build something, rather than providing a solution for us to use.

I have taken a look, and I found several hardcoded paths and basically everything else was Linux. Now I don't have a problem with Linux, as my webservice runs on Linux (including 7zip through wine), so I'm not even too biased. But very few are using Linux on our dev machine.

What you have written may be useful to you, but in the current version, you should not expect many people to jump in and use or improve it. People are lazy, truly lazy, what's why I'm not even making anybody upload a classfile, it's just too much hassle. For most it is good enough, and others simply already rolled their own.

Don't get me wrong, I'd love to see you do a better job than my 4K shrinker!

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline bysse

Senior Devvie


Medals: 3
Projects: 1



« Reply #7 - Posted 2010-02-09 22:27:17 »

Well, it seems you are trying to build something, rather than providing a solution for us to use.

I have taken a look, and I found several hardcoded paths and basically everything else was Linux. Now I don't have a problem with Linux, as my webservice runs on Linux (including 7zip through wine), so I'm not even too biased. But very few are using Linux on our dev machine.

What you have written may be useful to you, but in the current version, you should not expect many people to jump in and use or improve it. People are lazy, truly lazy, what's why I'm not even making anybody upload a classfile, it's just too much hassle. For most it is good enough, and others simply already rolled their own.

Don't get me wrong, I'd love to see you do a better job than my 4K shrinker!

You're absolutely right. In time i hope that it can become a tool that people actually can use. When the project is decent enough i'll publish the source and binaries. But right now it's doesn't really work properly.

All commands are stored in settings.properties which is generated in CWD on the first start of the application. This is kind of hard to understand since there is no readme or anything, just a tiny tiny log row Smiley Anyway, in that file, the path to each binary is defined along with the necessary parameters. The toolchain is fixed for now but in time that might be configurable as well.



Offline pjt33
« Reply #8 - Posted 2010-02-13 20:04:22 »

Don't bother looking at this problem Smiley I was compressing the files to 7zip format so it's kind of obvious why the zip2gz converter didn't work. Sorry for wasting your time.
Ohh. Don't worry about wasting my time - I was thinking of looking at it tomorrow, because I've been away on a business trip all week, so no time wasted.
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.

rwatson462 (36 views)
2014-12-15 09:26:44

Mr.CodeIt (29 views)
2014-12-14 19:50:38

BurntPizza (61 views)
2014-12-09 22:41:13

BurntPizza (98 views)
2014-12-08 04:46:31

JscottyBieshaar (58 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (76 views)
2014-11-29 21:32:03

toopeicgaming1999 (136 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (37 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
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!