Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3 4 ... 6
  ignore  |  Print  
  Java 4k Resources Thread  (Read 38852 times)
0 Members and 1 Guest are viewing this topic.
Offline Bonbon-Chan

JGO Coder


Medals: 12



« Reply #30 - Posted 2009-12-02 09:51:44 »

I don't really get the pack200 stuff...
I have try to make a batch file to optimized my jar size (it executes itself automatically with netbean after a clean&build) :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
"C:\Program Files\Java\jdk1.6.0_13\bin\jar" uf dist\k2010.jar META-INF\MANIFEST.MF

java -jar C:\proguard\lib\proguard.jar @k2010.pro

"C:\Program Files\Java\jdk1.6.0_13\bin\pack200" --effort=9 -O --no-gzip dist\k2010.jar.pack dist\k2010_.jar
"C:\Program Files\7-Zip\7z" a -tgzip -mx=9 dist\k2010.jar.gz dist\k2010.jar

echo off
echo ---------------------------------------------------------------------------
echo ---------------------------------------------------------------------------
dir dist\*.*
echo ---------------------------------------------------------------------------
echo ---------------------------------------------------------------------------


I get :
1  
2  
3  
4  
6 834 k2010.jar               // netbean jar
2 851 k2010.jar.gz          // gzip pack
4 693 k2010.jar.pack      // pack
4 078 k2010_.jar            // proguard jar


So, i think it works but are my option right ? Is it the .jar.gz that should be under the 4096 ?
Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #31 - Posted 2009-12-02 13:06:38 »

Compile 'n Shrink - HTTP Service

http://www.indiespot.net/app/java-four-kay

Funky,

Could you also provide a means of attaching resource file(s) to be included in the resultant pack.  Kiss

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

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #32 - Posted 2009-12-02 13:23:28 »

So, i think it works but are my option right ? Is it the .jar.gz that should be under the 4096 ?

Yes. But the name should really be k2010.pack.gz

Play Minecraft!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline soothsayer

Senior Newbie


Projects: 1



« Reply #33 - Posted 2009-12-02 13:28:01 »

Compile 'n Shrink - HTTP Service

http://www.indiespot.net/app/java-four-kay

Fantastic!!! Cool Who maintains this site? Is it a permanent project?
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #34 - Posted 2009-12-02 15:33:30 »

Fantastic!!! Cool Who maintains this site? Is it a permanent project?

Thanks. Me. Yes.


I bet I can improve it further, as I'm currently not even using an obfuscator to shrink the method/field names.

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

Senior Newbie


Projects: 1



« Reply #35 - Posted 2009-12-02 15:48:49 »

Thanks. Me. Yes.


I bet I can improve it further, as I'm currently not even using an obfuscator to shrink the method/field names.

Thank you.

By the help of this tool I can finally create my jar file easily. I had a big problem with compression until now.
Offline Markus_Persson

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #36 - Posted 2009-12-02 15:56:46 »

Do you store all java classes submitted there, or can we use it without giving all your source code to you? Wink

Play Minecraft!
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #37 - Posted 2009-12-02 16:11:02 »

Do you store all java classes submitted there, or can we use it without giving all your source code to you? Wink

Yeah, it was very tempting, but I resisted. The only file that is stored, is the generated .pack.gz file, so you can download it. I can probably launch a thread to remove it after a minute or so.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #38 - Posted 2009-12-02 16:13:48 »

I just updated the service, so that it actually gives you plain-text error messages, it something would go wrong before the external processes are launched.


I submitted my Poker4K app (2006) which was exactly 4096 bytes, and it came out at 3592 bytes.

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

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #39 - Posted 2009-12-02 16:24:43 »

Left 4k Dead went from 4096 bytes to 4019.

Neat. Cheesy

Play Minecraft!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #40 - Posted 2009-12-02 16:35:45 »

Can anybody give me a kickstart on which proguard parameters to use?

Even if I use the most basic / safe parameters, the jar file comes out at under 300 bytes, and obviously it doesn't even remotely work.

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

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #41 - Posted 2009-12-02 16:38:17 »

It's probably removing the entire class since it's "not used". Try this:

1  
2  
-keep public class * extends java.applet.Applet
-keep public class * extends javax.swing.JApplet


Or: http://proguard.sourceforge.net/manual/examples.html#applet

Play Minecraft!
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #42 - Posted 2009-12-02 16:43:47 »

I did:

1  
-keep class *


which apparently didn't patternmatch 'public class X'.


* Riven is updating the webservice

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #43 - Posted 2009-12-02 16:49:33 »

Thanks Markus!

I submitted my Poker4K app (2006) which was exactly 4096 bytes, and it came out at 3592 bytes.

3508 bytes bytes now.

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

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #44 - Posted 2009-12-02 17:06:11 »

Left 4k Dead got BIGGER!
G.pack.gz   => 4259 bytes

Play Minecraft!
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #45 - Posted 2009-12-02 17:10:31 »

Hrr... I'll make 2 outputs... one with, and one without proguard

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline pjt33
« Reply #46 - Posted 2009-12-02 17:17:16 »

I did:

1  
-keep class *


which apparently didn't patternmatch 'public class X'.
Try
1  
-keep public class *
or
1  
-keep * class *

I used
1  
-keep public class a
but that has an obvious downside...
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #47 - Posted 2009-12-02 17:23:54 »

Now outputs 2 files. I'll probably only output the smallest file later on.

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

JGO Wizard


Medals: 49
Projects: 5


I always win!


« Reply #48 - Posted 2009-12-02 17:55:16 »

Left 4k Dead got BIGGER!
G.pack.gz   => 4259 bytes

You just code better than pack200 can compress ,)

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #49 - Posted 2009-12-02 22:11:39 »

I'm curious; does pack200 invalidate the 'inject binary data into class files' space saving paradigm?

looking at the pack 200 spec, (section 5.9) it looks like you can manually inject an encoded attribute into a pack encoded class by defining an appropriate "attribute band"

However i do not think that it will compress any smaller than the pack 200 native non-class file storage as it seems be quite tight: as a minimum per file it will have a name (reference into the pack 200 constant pool) file size (32 or 64 bits depending file size) and then the raw file data.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #50 - Posted 2009-12-03 00:55:27 »

Hrr... I'll make 2 outputs... one with, and one without proguard
Instead of that, maybe provide checkboxes for each tool you link to and have them all checked by default. Depending upon how fast your utility is, you could even have your service construct results for every possibility, then just return the smallest one.

See my work:
OTC Software
Offline steveyO
« Reply #51 - Posted 2009-12-08 16:25:55 »

Does anyone know where I can get Moogies program?  Last years link doesnt seem to work (http://unlimited.woogley.net/hosted/moogie/4KJOv3.zip).  I remember using it to good effect last year.

https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #52 - Posted 2009-12-08 22:11:59 »

Does anyone know where I can get Moogies program?  Last years link doesnt seem to work (http://unlimited.woogley.net/hosted/moogie/4KJOv3.zip).  I remember using it to good effect last year.

hmm... your right, woogley's hosting seems to have stopped.

I am in the process of making v4 to output pack200 compressed output but if you want to use it right now i have attached it to this post.

It is in two parts, you will have to rename it from .pdf to .zip as this board does not accept zip files and max file size of 1.5meg.
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #53 - Posted 2009-12-08 22:15:07 »

Part 2 of the 4kjo tool.

Just a reminder that the tool is not very robust (as it was an in house tool) so it expects to be run from the command line with the working path to be where the tool is located.

Also i recall that some of the optimizers used do not handle file paths with spaces so best to not have paths with spaces Smiley

Offline steveyO
« Reply #54 - Posted 2009-12-08 23:23:43 »

Thanks moogie, You star!!  Its pretty damn good..   4.6K -> 2.9K using your tool...  To 2.1K after using Pack200..

If you can combine the 2 in version4 would be perfect!   If you need somewhere to host it PM me and I'll put in on my website..

https://play.google.com/store/apps/details?id=com.bullsquared.alggame Annoying Little Gits (Android)
www.bullsquared.com   Play java (applet) games! www.chessclockpro.com Free Online Chess Clock
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #55 - Posted 2009-12-09 02:47:45 »

Glad it helps.

Version 4 should be able to get it smaller tham 2.1k as i will use use the kzip or BJWdeflate to compress the .pack file to produce the .pack.gz.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #56 - Posted 2009-12-09 16:48:33 »

hmm... your right, woogley's hosting seems to have stopped.

I am in the process of making v4 to output pack200 compressed output but if you want to use it right now i have attached it to this post.

It is in two parts, you will have to rename it from .pdf to .zip as this board does not accept zip files and max file size of 1.5meg.
I can host the file on my site if you like. Just give me permission and I'll put the ZIP on it.

EDIT: I'll just assume you don't mind, because I won't have time to put this up again later. Wink

http://www.otcsw.com/files/4KJOv3.zip

See my work:
OTC Software
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #57 - Posted 2009-12-09 22:01:42 »

I can host the file on my site if you like. Just give me permission and I'll put the ZIP on it.

EDIT: I'll just assume you don't mind, because I won't have time to put this up again later. Wink

http://www.otcsw.com/files/4KJOv3.zip

hehe no problems Smiley

I will *try* to get the updated version done when i get some "free" time... such time seems very rare lately Sad
Offline SquashMonster

Senior Member


Medals: 1
Projects: 2



« Reply #58 - Posted 2009-12-11 04:13:50 »

Riven, your (absolutely brilliant) tool seems to be giving me a 404 when I try to access it.  Were we taking up too much of your server's CPU?
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #59 - Posted 2009-12-11 14:25:25 »

Oh, no, not a problem. Just upgraded to another server, and have to restore that 4K app and my JGO avatar, which had low-priority for now.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: 1 [2] 3 4 ... 6
  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.

xsi3rr4x (18 views)
2014-04-15 09:08:23

BurntPizza (15 views)
2014-04-14 18:46:01

UprightPath (28 views)
2014-04-14 08:39:50

UprightPath (13 views)
2014-04-14 08:35:47

Porlus (29 views)
2014-04-14 06:48:38

tom_mai78101 (54 views)
2014-04-09 19:04:31

BurntPizza (111 views)
2014-04-08 14:06:04

tom_mai78101 (212 views)
2014-04-05 04:34:39

trollwarrior1 (181 views)
2014-04-04 03:06:45

CJLetsGame (187 views)
2014-03-31 17:16:10
List of Learning Resources
by Longarmx
2014-04-07 18:14:44

Good Examples
by matheus23
2014-04-05 04:51:37

Good Examples
by Grunnt
2014-04-03 06:48:46

Good Examples
by Grunnt
2014-04-03 06:48:37

Good Examples
by matheus23
2014-04-01 09:40:51

Good Examples
by matheus23
2014-04-01 09:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 06:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 06:05:20
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!