appel
|
 |
«
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)
|
|
|
|
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?
|
|
|
|
Morre
|
 |
«
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. 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
|
|
Markus_Persson
|
 |
«
Reply #34 - Posted
2007-12-07 22:08:00 » |
|
Yeah, I can't find the download either..
|
|
|
|
Morre
|
 |
«
Reply #35 - Posted
2007-12-08 02:02:10 » |
|
I could share it but I'd like moogie's permission for that first... :/
|
|
|
|
|
|
Abuse
|
 |
«
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! 
|
|
|
moogie
|
 |
«
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  I do plan to make a newer version as i believe it may not work with java 1.6
|
|
|
|
|
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!
|
|
Markus_Persson
|
 |
«
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. =)
|
|
|
|
Morre
|
 |
«
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...  Here's 4KJO: http://www.x2d.org/java/4k/Moogies4KJO.zipI 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.
|
|
|
|
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 
|
|
|
|
Markus_Persson
|
 |
«
Reply #43 - Posted
2007-12-08 17:09:09 » |
|
Here's 4KJO: http://www.x2d.org/java/4k/Moogies4KJO.zipI 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.
|
|
|
|
appel
|
 |
«
Reply #44 - Posted
2007-12-08 18:41:27 » |
|
Looking good... but 604 bytes is a lot  I wish you luck!
|
|
|
|
appel
|
 |
«
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 
|
|
|
|
Markus_Persson
|
 |
«
Reply #46 - Posted
2007-12-08 21:21:32 » |
|
Webstart supports launching applets!
|
|
|
|
|
|
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  Maybe it's time to move on to 64KB demos! 
|
|
|
|
|
|
Abuse
|
 |
«
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! 
|
|
|
Markus_Persson
|
 |
«
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.
|
|
|
|
Abuse
|
 |
«
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!  )
|
Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! 
|
|
|
DzzD
|
 |
«
Reply #53 - Posted
2007-12-10 15:16:22 » |
|
(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
|
|
|
|
Markus_Persson
|
 |
«
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!  ) 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?
|
|
|
|
Abuse
|
 |
«
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  I got the upload limit upped..... and got this lovely error when trying to mbooster it  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 
|
Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! 
|
|
|
Markus_Persson
|
 |
«
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. 
|
|
|
|
Abuse
|
 |
«
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.  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! 
|
|
|
Markus_Persson
|
 |
«
Reply #58 - Posted
2007-12-10 16:43:17 » |
|
but less fun, hehe
|
|
|
|
Markus_Persson
|
 |
«
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. 
|
|
|
|
|