Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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  
  Regarding Reducing the jar size  (Read 1498 times)
0 Members and 1 Guest are viewing this topic.
Offline jeevan_gr

Junior Newbie




Java games rock!


« Posted 2003-12-19 07:53:37 »

Hi, Cheesy

          I am having problem in reducing the jar size, If you have any idea please let me know. it may be Image size reduction or Code size Redution. for that Image iknow Clipping, if u know  any new idea pls let me know
Offline mhnsp

Junior Newbie




Java games rock!


« Reply #1 - Posted 2003-12-19 11:12:38 »

1. If you know that a class variable will not change, make it "static final".

2. Use as few methods as possible.

3. Use as few classes as possible.

4. Use method instance variables over class instance variables.  Note: Jury is still out on this for me.  I've seen a reduction using this technique, but not sure if it was truly the idea or the obfuscator made the difference.

5. Use something like ProGuard to further obfuscate and reduce your code.

Other?  I am relatively new to J2ME development, too, so I am still learning the tricks of the trade as I go along.  Smiley
Offline mhnsp

Junior Newbie




Java games rock!


« Reply #2 - Posted 2003-12-19 11:20:18 »

Here's another article that talks about optimization a little more ...

http://www-106.ibm.com/developerworks/wireless/library/wi-pvcperf/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #3 - Posted 2003-12-19 13:50:00 »

@jeevan_gr

It might be a good idea to give us some more information.

Tell us how many classes and images you have. What kind the images are... how you organized em... wich format... how big the palette is.

Also tell us how big that files are and how small it should be etc.

Finally a rule of thumb hint... use an obfuscator or even two... for example the Jax + Jarg combo was quite nice for the 4k game contest. Also 7zip compresses damn well (use "ultra"). Oh and if you use png images crunch em as much as possible with pngout (by Ken Silverman - that's the guy who made the Build engine used by Duke Nukem 3D btw Wink).

弾幕 ☆ @mahonnaiseblog
Offline Jeff

JGO Coder




Got any cats?


« Reply #4 - Posted 2003-12-19 15:12:07 »

On older KVM implementations, the over head for every class and interface is something like .5K  Sad

Unfortunately given the incredible limits those same had sets have on MIDLET size (as little as 64K) the best answer I can give for those environments is to abandon much of your OOP.

Don't use interfaces at all.  Limit yourself to the absolute smallest number of classes you can get away with without  making your code totally impossible to maintain.  Obfuscate to reduce namespace.  Those are the biggies.

If you have a lot of images you may want to look at how you are encoding them and do things like reduce the bit-depth, depending on your target's capabilities...

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
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.

TehJavaDev (12 views)
2014-08-28 18:26:30

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (37 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (29 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (28 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!