Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
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 5 6
  ignore  |  Print  
  Java 4k Resources Thread  (Read 42635 times)
0 Members and 1 Guest are viewing this topic.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #60 - Posted 2009-12-12 22:36:56 »

Server up and running... now streams the output, instead of a long delay.

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: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #61 - Posted 2009-12-13 00:44:29 »

Added kzip shrinker, using pjt33's gzip=>gz code



A.java => 13931 bytes
A.class => 11196 bytes
A.normal.jar => 6846 bytes
A.progrd.jar => 4480 bytes
A.normal.pack => 5783 bytes
A.progrd.pack => 5750 bytes
A.normal.7z.pack.gz   => 3597 bytes
A.progrd.7z.pack.gz   => 3513 bytes
A.normal.kz.pack.gz   => 3480 bytes
A.progrd.kz.pack.gz   => 3383 bytes

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

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #62 - Posted 2009-12-13 01:08:35 »

Added kzip shrinker, using pjt33's gzip=>gz code



A.java => 13931 bytes
A.class => 11196 bytes
A.normal.jar => 6846 bytes
A.progrd.jar => 4480 bytes
A.normal.pack => 5783 bytes
A.progrd.pack => 5750 bytes
A.normal.7z.pack.gz   => 3597 bytes
A.progrd.7z.pack.gz   => 3513 bytes
A.normal.kz.pack.gz   => 3480 bytes
A.progrd.kz.pack.gz   => 3383 bytes

Holy moly. Lemme try it out.

Wow! That works wonders! I can't believe how much more I can add now...

F.java => 22744 bytes
F.class => 11039 bytes
F.normal.jar => 7002 bytes
F.progrd.jar => 3843 bytes
F.normal.pack => 4776 bytes
F.progrd.pack => 4517 bytes
F.normal.7z.pack.gz   => 3177 bytes
F.progrd.7z.pack.gz   => 2997 bytes
F.normal.kz.pack.gz   => 3052 bytes
F.progrd.kz.pack.gz   => 2884 bytes

Hm, I clicked the bottom two links (the kz links) and I get:
Quote
FileNotFound: /home/indiespot/http-files/4k/64d01486f26c4116cf97b02a126867bd.4.pack.gz

The 7-zip links work, however.

See my work:
OTC Software
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #63 - Posted 2009-12-13 01:10:34 »

I just made another update (thanks kapta) which reduces the size even more.

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: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #64 - Posted 2009-12-13 01:12:48 »

Hm, I clicked the bottom two links (the kz links) and I get:
The 7-zip links work, however.

Thanks, fixed it!

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

Senior Devvie


Medals: 1
Projects: 2



« Reply #65 - Posted 2009-12-13 01:44:45 »

Oh my, this is too good to be true.  My game just went from 4110 bytes to 3397.  Thank you!

I'm almost at a loss for what to do with all that space, haha.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #66 - Posted 2009-12-13 03:43:57 »

A.java => 13931 bytes
A.class => 9627 bytes
A.normal.jar => 6266 bytes
A.progrd.jar => 3817 bytes
A.normal.pack => 4707 bytes
A.progrd.pack => 4430 bytes
A.normal.7z.pack.gz   => 3201 bytes
A.progrd.7z.pack.gz   => 3035 bytes
A.normal.kz.pack.gz   => 3077 bytes
A.progrd.kz.pack.gz   => 2932 bytes

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

JGO Knight


Medals: 13
Projects: 6
Exp: 10 years


Java games rock!


« Reply #67 - Posted 2009-12-13 11:32:19 »

That is some serious compression!

I have been attempting to replicate your results but so far have been unable to Smiley The closest i have come is 1244 bytes compared to your tool's 1226 bytes for my sample code.

My steps:

1. javac -target 1.5 a.java (version 1.6.0_12)

2. proguard (version 4.5 beta 2) with the following config file:
1  
2  
3  
4  
5  
6  
7  
8  
-libraryjars "D:\Program Files\Java\jre6\lib\rt.jar"
-injars "D:\temp\a.jar"
-outjars "D:\temp\a.proguard.jar"
-allowaccessmodification
-overloadaggressively
-optimizationpasses 99
-defaultpackage ''
-keep public class a extends java.applet.Applet

note that the JRE version it uses is  1.6.0_13-b03.

3. pack200 with the following settings
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
          p.put(Packer.EFFORT, "9");
          p.put(Packer.SEGMENT_LIMIT, "-1");
          p.put(Packer.KEEP_FILE_ORDER, Packer.FALSE);
          p.put(Packer.CODE_ATTRIBUTE_PFX+"LineNumberTable", Packer.STRIP);
          p.put(Packer.CODE_ATTRIBUTE_PFX+"LocalVariableTable", Packer.STRIP);
          p.put(Packer.CODE_ATTRIBUTE_PFX+"StackMapTable", Packer.STRIP);
          p.put(Packer.CODE_ATTRIBUTE_PFX+"SourceFile", Packer.STRIP);
          p.put(Packer.CODE_ATTRIBUTE_PFX+"Deprecated", Packer.STRIP);
          p.put(Packer.CODE_ATTRIBUTE_PFX+"Exceptions", Packer.STRIP);
          p.put(Packer.CLASS_ATTRIBUTE_PFX+"LineNumberTable", Packer.STRIP);
          p.put(Packer.CLASS_ATTRIBUTE_PFX+"LocalVariableTable", Packer.STRIP);
          p.put(Packer.CLASS_ATTRIBUTE_PFX+"StackMapTable", Packer.STRIP);
          p.put(Packer.CLASS_ATTRIBUTE_PFX+"SourceFile", Packer.STRIP);
          p.put(Packer.CLASS_ATTRIBUTE_PFX+"Deprecated", Packer.STRIP);
          p.put(Packer.CLASS_ATTRIBUTE_PFX+"Exceptions", Packer.STRIP);
          p.put(Packer.METHOD_ATTRIBUTE_PFX+"LineNumberTable", Packer.STRIP);
          p.put(Packer.METHOD_ATTRIBUTE_PFX+"LocalVariableTable", Packer.STRIP);
          p.put(Packer.METHOD_ATTRIBUTE_PFX+"StackMapTable", Packer.STRIP);
          p.put(Packer.METHOD_ATTRIBUTE_PFX+"SourceFile", Packer.STRIP);
          p.put(Packer.METHOD_ATTRIBUTE_PFX+"Deprecated", Packer.STRIP);
          p.put(Packer.METHOD_ATTRIBUTE_PFX+"Exceptions", Packer.STRIP);          
          p.put(Packer.MODIFICATION_TIME, Packer.LATEST);
          p.put(Packer.DEFLATE_HINT, Packer.FALSE);
          p.put(Packer.UNKNOWN_ATTRIBUTE, Packer.STRIP);

3. kzip the resultant pack file with the following command line option
1  
kzip.exe /rn /q /y /b 40 ...."

 found after a brute force search on block size.

4. using pjt33's zip to gz conversion code to produce the final result.

Are you doing anything different or using different versions?
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #68 - Posted 2009-12-13 13:02:50 »

I have been attempting to replicate your results but so far have been unable to Smiley The closest i have come is 1244 bytes compared to your tool's 1226 bytes for my sample code.

I'm actually doing much less.

For javac: -g:none -target 1.5
For proguard: -optimizationpasses 16 -keep public class *
For pack200: -effort 9 --strip-debug
For 7z: (nothing)
For kzip: -y -b{0,8,16,24,32,....,512}

Ofcourse I could say I added a lot of dirty tricks, but it looks like I'm not even trying, doesn't it?

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

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #69 - Posted 2009-12-13 18:45:56 »

Hey Riven, do you know that your tool works for all Applets? Mine doesn't seem to run. I haven't actually messed with it for, well, a year, so it's certainly possible that something's actually broken in my code, I don't know. I'm just curious if other people have been able to run applets packed with your system (using the 7-zip proguard).

See my work:
OTC Software
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #70 - Posted 2009-12-13 18:55:19 »

kevglass seems to be able to run his Emulator running Mario as an applet, after my shrinker did its job.

Keep in mind that for a *.pack.gz to be run as an applet, you have to request a *.jar from the server, at which time the webserver looks at the Accept-Encoding header, and returns the contents of a (potential) *.pack.gz file instead (thanks Sun, for making it so obvious)

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

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #71 - Posted 2009-12-13 19:00:15 »

kevglass seems to be able to run his Emulator running Mario as an applet, after my shrinker did its job.

Keep in mind that for a *.pack.gz to be run as an applet, you have to request a *.jar from the server, at which time the webserver looks at the Accept-Encoding header, and returns the contents of a (potential) *.pack.gz file instead (thanks Sun, for making it so obvious)
Yeah. I submitted the file to Java4k and it doesn't run there, but assumedly Appel already has that webservice working. Looks like I need to dive back into that source code and see if I can remember what's going on...

See my work:
OTC Software
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #72 - Posted 2009-12-13 19:05:05 »

Hey Riven, do you know that your tool works for all Applets? Mine doesn't seem to run. I haven't actually messed with it for, well, a year, so it's certainly possible that something's actually broken in my code

Then try t run it as a JAR-applet. If it works there, and the pack.gz doesn't work, let me know.

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

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #73 - Posted 2009-12-13 19:10:03 »

Then try t run it as a JAR-applet. If it works there, and the pack.gz doesn't work, let me know.
Yeah, actually it was both applet-able and webstart-able and I just went and tried to compile/run it (using the main method) and all I got was a blank window. So it appears that I broke something somewhere along the way. Thanks.

See my work:
OTC Software
Online pjt33
« Reply #74 - Posted 2009-12-13 21:04:13 »

Hey Riven, do you know that your tool works for all Applets? Mine doesn't seem to run. I haven't actually messed with it for, well, a year, so it's certainly possible that something's actually broken in my code, I don't know. I'm just curious if other people have been able to run applets packed with your system (using the 7-zip proguard).
I'm not using Riven's system, but... I have a Proguard-pack200-kzip compilation script, and somewhere along the line it seems to be breaking the string which encodes my data. Once I work out what's going on there I should be able to upload my first game; my current suspicion is that Proguard is responsible.

Edit: hadn't updated the script and Proguard 4.3 was breaking it. Proguard 4.4 not only fixes that problem but seems to compress a *lot* better.
Offline moogie

JGO Knight


Medals: 13
Projects: 6
Exp: 10 years


Java games rock!


« Reply #75 - Posted 2009-12-13 21:23:02 »

I'm actually doing much less.

For javac: -g:none -target 1.5
For proguard: -optimizationpasses 16 -keep public class *
For pack200: -effort 9 --strip-debug
For 7z: (nothing)
For kzip: -y -b{0,8,16,24,32,....,512}

Ofcourse I could say I added a lot of dirty tricks, but it looks like I'm not even trying, doesn't it?

i still think you have left out the call to doMagicStuff() in your steps Tongue as i have run my sample though the steps you list and have created slightly worse result than I had before (1247 instead of 1244, compared to your 1226)

The only thing i can think of is that we are using different versions of java and proguard and kzip. If it is not too much trouble can you tell me the versions you use? cheers!

Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #76 - Posted 2009-12-14 00:20:25 »

The latest, downloaded them all over the last few days.

Well, except that I used JDK 6u15 instead of 6u17, and all software is running on Linux.

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

JGO Coder


Medals: 4



« Reply #77 - Posted 2009-12-14 01:13:34 »

Quote
A.java => 13931 bytes
A.class => 9627 bytes
A.normal.jar => 6266 bytes
A.progrd.jar => 3817 bytes
A.normal.pack => 4707 bytes
A.progrd.pack => 4430 bytes
A.normal.7z.pack.gz   => 3201 bytes
A.progrd.7z.pack.gz   => 3035 bytes
A.normal.kz.pack.gz   => 3077 bytes
A.progrd.kz.pack.gz   => 2932 bytes

Great stuff there. Now people can worry less on optimising.

Off topic.
Riven, I thought I was going slightly crazy when I saw your display pic. How does it get the username?

Current project - Rename and Sort
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #78 - Posted 2009-12-14 01:19:27 »

Great stuff there. Now people can worry less on optimising.
That indeed is the point. It might not result in the absolute smallest file, but it levels the playing field a bit.



Off topic.
Riven, I thought I was going slightly crazy when I saw your display pic. How does it get the username?
Congratz, you are the first to notice without being told (I guess). It's magic, and it's watching you.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline SimonH
« Reply #79 - Posted 2009-12-14 01:33:21 »

IP based...

People make games and games make people
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #80 - Posted 2009-12-14 01:34:15 »

IP based...

That's too easy.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline SimonH
« Reply #81 - Posted 2009-12-14 01:39:25 »

...but how to get the usernames?

*edit* HAS to be a lookup table!? If not - I give in! It is magic!

People make games and games make people
Offline zammbi

JGO Coder


Medals: 4



« Reply #82 - Posted 2009-12-14 01:57:23 »

Quote
Congratz, you are the first to notice without being told (I guess). It's magic, and it's watching you.
Well I was like wtf, did I really saw my user name in that image. So I right click and said show picture in a new tab. Then its url showed it as png, and then it really freaked me out Tongue (Though maybe chrome supports animated pngs now days too)
Then found out it was really a gif.
I guess it gets the username from the forum somehow, but not totally sure how would it.

Current project - Rename and Sort
Offline moogie

JGO Knight


Medals: 13
Projects: 6
Exp: 10 years


Java games rock!


« Reply #83 - Posted 2009-12-14 02:21:25 »

Now people can worry less on optimising.

I find creating tools to get the most compression the most enjoyable aspect of the competition Smiley but some might call me strange!
Offline steveyO
« Reply #84 - Posted 2009-12-14 08:30:17 »

Quote
I find creating tools to get the most compression the most enjoyable aspect of the competition Smiley but some might call me strange!
Yep!  Thats strange.. Mind you, wont complain if you release version 4  Roll Eyes

Wow.. So we have a magician at JGO.. Very impressive.. However after last refresh I am now pjt33 instead of steveyO.. Pretty cool nevertheless.. When I get 5mins break, gonna figure out how you do this..

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 Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #85 - Posted 2009-12-14 08:31:39 »

Wow.. So we have a magician at JGO.. Very impressive.. However after last refresh I am now pjt33 instead of steveyO.. Pretty cool nevertheless.. When I get 5mins break, gonna figure out how you do this..

Heuristics do fail every once in a while.

Update: should fail less often now.

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

JGO Coder


Medals: 4



« Reply #86 - Posted 2009-12-14 09:19:56 »

I guess one way would be to keep looking at the who's online list when the image is pulled from the server. Enough polls would get it right.

Current project - Rename and Sort
Online pjt33
« Reply #87 - Posted 2009-12-14 10:44:26 »

I guess one way would be to keep looking at the who's online list when the image is pulled from the server. Enough polls would get it right.
I was just thinking along similar lines.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #88 - Posted 2009-12-14 10:50:39 »

I might be wrong, and I'm probably looking at the wrong code, but I think I'm using session hijacking and a zeroday security hole.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Online pjt33
« Reply #89 - Posted 2009-12-14 11:13:14 »

I might be wrong, and I'm probably looking at the wrong code, but I think I'm using session hijacking and a zeroday security hole.
I had a look for JavaScript but I couldn't find any, so I assumed you weren't actually hijacking the session. Hmm.

Packet sniffing doesn't show an actual session hijack, but the referrer should allow you to see who's requesting the image.
Pages: 1 2 [3] 4 5 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.

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

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

toopeicgaming1999 (11 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (28 views)
2014-11-25 11:26:43

Gibbo3771 (24 views)
2014-11-24 19:59:16

trollwarrior1 (37 views)
2014-11-22 12:13:56

xFryIx (76 views)
2014-11-13 12:34:49

digdugdiggy (53 views)
2014-11-12 21:11:50
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

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