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 (535)
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
  ignore  |  Print  
  t4kns [fits in 4k now!]  (Read 24036 times)
0 Members and 1 Guest are viewing this topic.
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #30 - Posted 2007-12-07 20:49:59 »

t4nks.jar went from 3934 bytes to 3899! Thanks =D

[edit:]

Wow, but kzip brought it to 3878 bytes. Awesome!

Try this combination of obfuscators:

Original JAR > JShrink > JoGa > ProGuard > JoGa > Done!  (and then bjwflate or kzip)

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline tom
« Reply #31 - Posted 2007-12-07 21:10:32 »

I get the best compression on the class file with kzip and the /b128 option. Beats bjwflate with 20 bytes. However it is not stable. A little refactoring and it use 40 bytes more.

Btw, is there a way to run JoGa from the command line?

Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #32 - Posted 2007-12-07 21:13:43 »

Better yet - search the formus for 4KJO (moogie's tool so one of his post if that keyword doesn't do the trick). It uses several zip tools and obfuscators and will probably shave a whole bunch of bytes of the project (that's why I mentioned it earlier). The pack200 embedding stuff doesn't work though, disable that. Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom
« Reply #33 - Posted 2007-12-07 22:01:24 »

I haven't found a working link to 4KJO. Here is the 4KJO thread on javagaming:
http://www.java-gaming.org/forums/index.php?topic=15497.0

Does anyone got a copy they can share.

Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #34 - Posted 2007-12-07 22:08:00 »

I haven't found a working link to 4KJO. Here is the 4KJO thread on javagaming:
http://www.java-gaming.org/forums/index.php?topic=15497.0

Does anyone got a copy they can share.


Yeah, I can't find the download either..

Play Minecraft!
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #35 - Posted 2007-12-08 02:02:10 »

I could share it but I'd like moogie's permission for that first... :/

Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #36 - Posted 2007-12-08 03:07:10 »




You can play it the game now!
Unfortunately, it's quite a few bytes over 4kb, so I'll probably end up having to cut something out.. Undecided

Play Minecraft!
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #37 - Posted 2007-12-08 04:29:52 »

bloody hell it's hard.....

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

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #38 - Posted 2007-12-08 09:41:47 »

I could share it but I'd like moogie's permission for that first... :/

go for it Smiley

I do plan to make a newer version as i believe it may not work with java 1.6
Offline JonathanC

Senior Newbie





« Reply #39 - Posted 2007-12-08 09:59:34 »

Wow, I am impressed...

The one thing I'd really like to see, space permitting, is for the map to scroll with the unit you are controlling. Using the minimap to shift the player's view is clunky.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #40 - Posted 2007-12-08 10:49:01 »

The one thing I'd really like to see, space permitting, is for the map to scroll with the unit you are controlling. Using the minimap to shift the player's view is clunky.

Ah, you can use the arrow keys. =)

Play Minecraft!
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #41 - Posted 2007-12-08 12:11:35 »

Arrow keys weren't working all the time. Just every now and then, for no apparent reason. Apart from that, it's looking very cool. I'd rather see an apparent health bar for the tanks than having four variants, though... Smiley

Here's 4KJO: http://www.x2d.org/java/4k/Moogies4KJO.zip

I didn't have the original, so I just threw all the files I thought were relevant from my 4KJO folder in a zip. Let's hope everything is in there. If not, tell me. Might be one or two files from something I've done that isn't relevant.

Offline DzzD
« Reply #42 - Posted 2007-12-08 15:50:53 »

looks awesome,I really hope that you will be able to fit it into 4k! a 4ko full RTS would be really impressive....

EDIT:
another things... I think that's really nice that it work as an applet  Smiley

Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #43 - Posted 2007-12-08 17:09:09 »

Here's 4KJO: http://www.x2d.org/java/4k/Moogies4KJO.zip

I didn't have the original, so I just threw all the files I thought were relevant from my 4KJO folder in a zip. Let's hope everything is in there. If not, tell me. Might be one or two files from something I've done that isn't relevant.

Unfortunately, that results in a bigger jar than just jarg + kzip.

I still need to cut out some 604 bytes.. Not easy.

Play Minecraft!
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #44 - Posted 2007-12-08 18:41:27 »

Looking good... but 604 bytes is a lot   Undecided I wish you luck!

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

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #45 - Posted 2007-12-08 20:05:17 »

I notice it's an Applet. There is a requirement that all games must be webstart, hopefully that won't mess everything up for you  Roll Eyes

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

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #46 - Posted 2007-12-08 21:21:32 »

Webstart supports launching applets!

Play Minecraft!
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #47 - Posted 2007-12-09 08:51:07 »

I see that you have embedded data. Perhaps actually injecting the data into the generated bytecode? similar to what i did for the image data in my 2007 entry (http://javaunlimited.net/hosted/moogie/SubPar/source.html)
Offline thijs

Junior Member




Lava games rock!


« Reply #48 - Posted 2007-12-09 09:26:21 »

Way cool!

But kind of unfortunate too, as this game would be so cool with decent AI and / or multiplayer... but thats just not gonna happen in 4K  Undecided

Maybe it's time to move on to 64KB demos! Wink

<a href="http://www.dzzd.net">3DzzD!</a>
<a href="http://www.arcazoid.com">Arcazoid!</a>
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #49 - Posted 2007-12-10 01:02:57 »

Well, it is not much but i have shaved 15 bytes from the version on your website by this combination:

PROGUARD OPTIMIZER
JODE OPTIMIZER
JOGA OPTIMIZER
JARG OPTIMIZER
KZIP with split of 288

http://www.cuteandcuddlypet.com.au/tank/tankApplet.jar.BEST_OPT_COMPRESSED.jar

It potentially could save more if given the original source. (i decompiled your already optimised version)
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #50 - Posted 2007-12-10 13:57:59 »

You *might* gain a few bytes by replacing the usage of Random#nextInt(int) with your own implementation, as they do pull in a rather large set of constant pool entries.

The jdk uses :-

1  
2  
3  
4  
5  
int seed = System.currentTimeMillis();
int next() {
       seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
       return (int)(seed >>> (48 - 32));
}


But i'm sure something smaller, & slightly less random would suffice.

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: 14
Projects: 19


Mojang Specifications


« Reply #51 - Posted 2007-12-10 14:37:46 »

Thanks for the shrinking suggestions. =)

I'm down to some 450 bytes over the limit now after squeezing it down some 200 bytes or so by removing the third silo (you drop crystals in the base now) and getting rid of some minor eye candy stuff.. I'll probably remove the Scanner unit as well since it doesn't actually DO anything yet, which should save me perhaps another 50 bytes or so if I'm lucky.. but after that I really don't want to remove anything more.. argh.

I tried getting rid of the fancy fog of war so the map stays lit after you've explored it, but that didn't save many bytes at all, and it really adds a lot to the gameplay.
I guess I could cut out all keyboard controls to save another 50 bytes or so.. but then the game starts to become annoying to play, which is bad.

Play Minecraft!
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #52 - Posted 2007-12-10 14:55:57 »

Perhaps someone should approach innaworks for a 3 month demo license, that limits output jar size to ~8kb...
http://www.innaworks.com/mBooster.html.

It would be good publicity for their tool.
I attempted to pass your latest t4kns jar through it, just to confirm that it will give significant reductions.... but our mbooster servers have a maximum library jar size limit of 4mb (rt.jar is more than 40! Cry )


Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline DzzD
« Reply #53 - Posted 2007-12-10 15:16:22 »

Quote
(rt.jar is more than 40!  )

you may take another rt.jar ?
Java 1.4.2.2 rt.jar 25.2 mo
Java 1.5.06 rt.jar 32.1mo
Java 1.6.0.1 rt.jar 39.3 mo
Java 1.6.0.2 rt.jar 39.4 mo

I never notice that rt.jar was significantly increaing in size... every days

Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #54 - Posted 2007-12-10 15:57:51 »

Perhaps someone should approach innaworks for a 3 month demo license, that limits output jar size to ~8kb...
http://www.innaworks.com/mBooster.html.

It would be good publicity for their tool.
I attempted to pass your latest t4kns jar through it, just to confirm that it will give significant reductions.... but our mbooster servers have a maximum library jar size limit of 4mb (rt.jar is more than 40! Cry )

Shouldn't it be possible to make a "fake" library jar containing empty java.lang.Math and java.awt.Applet and so classes, then pointing mbooster at that?

Play Minecraft!
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #55 - Posted 2007-12-10 16:02:12 »

Shouldn't it be possible to make a "fake" library jar containing empty java.lang.Math and java.awt.Applet and so classes, then pointing mbooster at that?

yeah, tried that..... but my stub generator tool doesn't handle java1.5+ constructs, and I can't be bothered updating it  Wink

I got the upload limit upped..... and got this lovely error when trying to mbooster it Smiley

1  
2  
3  
4  
5  
6  
7  
8  
9  
     [java] ERROR - Internal failure detected at step id: 1
     [java] ------------------------------------------------------
     [java] java.lang.IllegalStateException: Ooops! default case reached.
     [java] at java.lang.Void.<unknown>(Unknown Source)
     [java] at java.lang.Void.<unknown>(Unknown Source)
     [java] at java.lang.Void.<unknown>(Unknown Source)
     [java] at java.lang.Void.<unknown>(Unknown Source)
     [java] ------------------------------------------------------
     [java] Please contact Innaworks support at support@innaworks.com


Might have a closer read of the documentation - I have a sneaking suspicion the entry point has to be a subclass of MIDlet Shocked

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: 14
Projects: 19


Mojang Specifications


« Reply #56 - Posted 2007-12-10 16:14:52 »

aww

I've been kinda toying around with the idea of writing my own java compiler. Wink

Play Minecraft!
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #57 - Posted 2007-12-10 16:29:46 »

aww

I've been kinda toying around with the idea of writing my own java compiler. Wink

Adding new optimisations (and bug fixes!) to Proguard would be an excellent contribution =D

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: 14
Projects: 19


Mojang Specifications


« Reply #58 - Posted 2007-12-10 16:43:17 »

but less fun, hehe

Play Minecraft!
Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #59 - Posted 2007-12-14 21:57:55 »

I had to cut a lot of fancy artwork stuff and one building and one unit had to go, but it now fits in 4kb!! YAAAY!

I've tweaked the difficulty a bit as well, but I'm not sure how playable it is. Wink

Play Minecraft!
Pages: 1 [2] 3
  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.

E.R. Fleming (20 views)
2014-07-29 03:07:13

E.R. Fleming (7 views)
2014-07-29 03:06:25

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

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

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

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

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

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

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

MustardPeter (45 views)
2014-07-16 23:30:00
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!