Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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  
  4KJO (4K Java Optimiser) version 3 released  (Read 16430 times)
0 Members and 1 Guest are viewing this topic.
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Posted 2008-01-23 01:12:03 »

Version 3 of my very very dodgy tool which tries to find the best sequence of obsfucators and optimisers has been released.

http://www.cuteandcuddlypet.com.au/moogie/4KJOv3.zip

http://unlimited.woogley.net/hosted/moogie/4KJOv3.zip

To use:

1. unzip into a directory
2. type java -jar <directory>\4KJO.jar

This will give you the command line options. More help is available when using the -gui option.

Improvements since last version:

- should now be 1.5/1.6 complient
- now using proguard 4.1
- jshrink now works with the tool. (well mostly... jshrink does not seem able to correctly process alrealy obfucated/optimised jars and thus is only able to be uses as a first step... this is handeled automatically)
- added Marvin Obsfucator
- added Retroguard Obsfucator
- removed JavaGuard as it seems unable to process java 1.5+
- changed default configuration.
- now using kzip instead of java's zip for intermediate steps


These changes should theoretically improve the compression ratio as compared to the previous version.

Please let me know if it works has errors etc.

Cheers
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #1 - Posted 2008-01-23 03:55:49 »

the default configuration performs 5! permutations so it may take a little while, however once peformed you can use the output config file and skip these permutations.

When your entry has grown/ changed significantly it might be wise to run the default configuration again to see whether a different comibnation now give the best compresion.

Alternatively to speed it up you can make your own config file using the GUI and simply select a smaller number of optimisers to permuate combinations when finding the best solution.
Offline Noya

Senior Newbie





« Reply #2 - Posted 2008-01-23 13:31:09 »

Sounds nice, I'll give it a try Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #3 - Posted 2008-01-23 17:58:43 »

Good stuff! I'll make sure to try it out over the next few days! Smiley

Offline SimonH
« Reply #4 - Posted 2008-01-23 20:53:01 »

Well, I tried it on z4rch and it reduced the jar size from 4091 to 3634 bytes BUT - it broke the code, all the ships vanished!  Sad

People make games and games make people
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #5 - Posted 2008-01-23 21:18:22 »

lol! i suggest creating a script for each optimiser individually to see if you can identify which optimiser is being too aggressive. once/if you have identified it then create a script which is based on the default script minus the offending optimiser Smiley

Is the ship data directly injected into the byte code? i believe all optimisers remove the such data. I do have a undocumented -data option which does inject the data back into the optimised jar.
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #6 - Posted 2008-01-23 23:44:11 »

I used your already compressed jar to test 4KJO.

It seems the JOGA does not like your class at all and gives an error when optimising (that is handled by the tool) however the JODE optimiser seems to be the culprit and aggressively optimises some portions of your code completely away! I unchecked it from the list of optimisers and was able to save 108 bytes (from 4091 to 3983)

here is the config i used:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
<config>
   <classOptimiser>
      <findBestOptimiser>false</findBestOptimiser>
      <usePack200ForEach>false</usePack200ForEach>
      <usePack200atEnd>true</usePack200atEnd>
      <useDummyCompressedSize>true</useDummyCompressedSize>
      <optimisers>
         <count>2</count>
         <orderPosition0>PROGUARD OPTIMIZER</orderPosition0>
         <orderPosition1>JARG OPTIMIZER</orderPosition1>
      </optimisers>
   </classOptimiser>
   <jarCompressor>
      <useKzipOnly>false</useKzipOnly>
      <useBWJDeflateOnly>true</useBWJDeflateOnly>
      <BWJflateFindBestSplitSize>false</BWJflateFindBestSplitSize>
      <KzipFindBestSplitSize>false</KzipFindBestSplitSize>
      <useDefOptAfterEach>false</useDefOptAfterEach>
      <useDefOptAtEnd>true</useDefOptAtEnd>
      <kzipIterations>30</kzipIterations>
      <kzipSplits>30</kzipSplits>
      <BWJflateBlockSize>512</BWJflateBlockSize>
   </jarCompressor>
</config>


You might get better compression when using the original un-optimised jar as input.
Offline SimonH
« Reply #7 - Posted 2008-01-24 00:20:08 »

Thanks moogie! That works fine - trouble is now I'll have to look at my code again and see what I can do with the 110 bytes!!

People make games and games make people
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #8 - Posted 2008-01-24 00:53:47 »

hehe cant help you there... maybe have wave effects?
Offline timfoden

Junior Member


Projects: 2



« Reply #9 - Posted 2008-02-13 10:20:05 »

Hi Moogie,

Just thought I'd give your optimiser a try for my Kart game (else I probably don't have enough space to finish it, doh!)... but the link below doesn't seem to work any more.


Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #10 - Posted 2008-02-13 20:59:49 »

ah,sorry about that. we cancelled that web host... I have uploaded it to the public ftp related to java 4k entries hosted by Woogley. If he objects then i will have to host by the atrocity which is free file hosting Smiley

Here is the new link: http://unlimited.woogley.net/hosted/moogie/4KJOv3.zip

Offline timfoden

Junior Member


Projects: 2



« Reply #11 - Posted 2008-02-20 08:54:36 »

Hi Moogie,

I gave the optimiser a quick go.  It has a couple of problems ATM.  I'm afraid I haven't spent more than about 10 mins on it so far to try to fix them...

1.  There are a lot of errors from the optimisers.  Looks like most of them don't like the class file.  I'm compiling with Java 6, but with -target 1.5 -source 1.5 (at least I think I'm using those options... I should check really Smiley )
2.  I need to inject a bitmap back into the class file before the compression stage.  You mention above that you have an undocumented  -data option to do this?  Could you explain how please.

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #12 - Posted 2008-02-20 11:34:40 »

Quote
1.  There are a lot of errors from the optimisers.  Looks like most of them don't like the class file.  I'm compiling with Java 6, but with -target 1.5 -source 1.5 (at least I think I'm using those options... I should check really Smiley )

Well, if the optimisers generate exceptions, they are skipped... so you will still have a valid output JAR at the end. With some classes, one of the optimisers might be a little too aggressive and actually optimise sections of your code away. In that case the only real option is to remove the offending optimiser from the list of of optimisers using the -gui command line option.

Quote
2.  I need to inject a bitmap back into the class file before the compression stage.  You mention above that you have an undocumented  -data option to do this?  Could you explain how please.


there is a -addData <file> option which will inject the contents of the file directly into the final best optimised class just before the JAR creation step.

I assume you have code in your class which reads in the class itself as input and searches for a unique byte string which indicates the start of the your embedded data? If not then you must do so as it is indeterminable to know what byte offset your data will start at.

Have a look at this thread ( http://www.java-gaming.org/forums/index.php?topic=17869.0 ) to see how I read in the data.


Offline ulfjack

Junior Member





« Reply #13 - Posted 2008-02-20 12:13:20 »

I've just come across another way to insert binary data into the class file. Just define a string and use octal escapes for the characters. For example:

"\000\001\002\003"

represents the bytes 0 to 3. Then you can just do getBytes() on the String and get a byte array of the contents. Optimizers won't strip this String from the class file. There's a caveat however: String.getBytes() uses the platform encoding to turn the string into bytes. The platform encoding of (effectively) all platforms is ascii-safe, so you can use values 0 to 127 (inclusive).
Offline timfoden

Junior Member


Projects: 2



« Reply #14 - Posted 2008-02-20 13:21:45 »

Well, if the optimisers generate exceptions, they are skipped... so you will still have a valid output JAR at the end. With some classes, one of the optimisers might be a little too aggressive and actually optimise sections of your code away. In that case the only real option is to remove the offending optimiser from the list of of optimisers using the -gui command line option.

OK, thanks.

there is a -addData <file> option which will inject the contents of the file directly into the final best optimised class just before the JAR creation step.

Sounds like just the thing.  I'll try to find some time to have a go at this tonight.

I assume you have code in your class which reads in the class itself as input and searches for a unique byte string which indicates the start of the your embedded data?

Yes, I already have code to do this... thanks.

--

I just realised that I had another question... the manifest file seems to disappear from the final .jar.  Is this what you'd expect?

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #15 - Posted 2008-02-20 14:23:45 »

I've just come across another way to insert binary data into the class file. Just define a string and use octal escapes for the characters. For example:

"\000\001\002\003"

represents the bytes 0 to 3. Then you can just do getBytes() on the String and get a byte array of the contents. Optimizers won't strip this String from the class file. There's a caveat however: String.getBytes() uses the platform encoding to turn the string into bytes. The platform encoding of (effectively) all platforms is ascii-safe, so you can use values 0 to 127 (inclusive).

Also be aware that Java uses a modified UTF8 format, one difference being that the char '\000' is encoded using 2 bytes rather than 1.
This coupled with the additional code necessary for converting these 7bit bytes into a more conventional form means that storing binary data as a seperate Attribute within the class file is generally more efficient.

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

Junior Member





« Reply #16 - Posted 2008-02-20 17:21:50 »

Interesting, and good to know. So far no problems here though (and this machine is set to use UTF-8)...
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #17 - Posted 2008-02-20 21:01:32 »

Yes, this is pretty much expected as it is optimising for deployment as a Webstartable JAR... simply load the JAR in a zip utility such as winRAR or 7zip and add your manifest if you want to make it a self executing JAR.

I have found that adding a manifest does eat up much of the bytes gained from the optimisation.
Offline timfoden

Junior Member


Projects: 2



« Reply #18 - Posted 2008-02-20 22:15:34 »

Sounds like just the thing.  I'll try to find some time to have a go at this tonight.

OK, once I added that -addData thing, and added the manifest file back in, it did the job...

Before: 3,999 bytes. (proguard, kzip /b 128)
After: 3,864 bytes. (jode, kzip 30 / 128)

Saved 135 bytes... thanks moogie!

Cheers, Tim.

Try Pipe Extreme -- can you get to the end of the pipe?
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #19 - Posted 2008-02-21 00:52:44 »

no problems Smiley

I just wish i had time this year to enter myself Sad
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #20 - Posted 2009-01-04 01:56:23 »

I can't get this to work; I get lots of Java errors no matter what I do. Can someone copy/paste what they type in the command line to get this to work?

See my work:
OTC Software
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #21 - Posted 2009-01-04 02:27:20 »

if i remember correctly there is a flaw in one or more of the optimisers used that they do not accept spaces in the file/path of the input and output jars... perhaps this is the problem? if you want you can send me the jar you are trying to optimise to see if your jar is some how unique and breaking the tool.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #22 - Posted 2009-01-04 06:01:17 »

if i remember correctly there is a flaw in one or more of the optimisers used that they do not accept spaces in the file/path of the input and output jars... perhaps this is the problem? if you want you can send me the jar you are trying to optimise to see if your jar is some how unique and breaking the tool.
Ah, that must be it. On my system it uses backslash space to denote spaces in file paths, while I noticed causes problems before. The file is in the "Random Code" folder which becomes "Random\ Code". I'll have a looksee if that works.

See my work:
OTC Software
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #23 - Posted 2009-01-06 03:36:08 »

Well, if the optimisers generate exceptions, they are skipped... so you will still have a valid output JAR at the end. With some classes, one of the optimisers might be a little too aggressive and actually optimise sections of your code away. In that case the only real option is to remove the offending optimiser from the list of of optimisers using the -gui command line option.
So just when I thought I was finished I seem to have hit this problem. Something in the processing is optimising out this whole loop:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
                  for (float t=HALF_PI; t<PI*1.5f; t+=0.5f)
                  {
                     final int r = rings_inactiveDecay[i] <= 0 ? 10 : 4;
                     
                     float weight = (float)Math.sin(t) / 2 + 0.5f;
                     float depth = (float)Math.sin(t+HALF_PI);
                     
                     float inv = 1.0f - weight;
                     
                     int x = (int)(rings_x1[i]*weight + rings_x2[i]*inv);
                     int y = (int)(rings_y1[i]*weight + rings_y2[i]*inv);
                 
                     float xBias = (x - camera_centerX) * 0.1f * depth;
                     float yBias = (y - camera_y) * 0.1f * depth;
                     
                     int yellow = (int)(220 + (depth*30));
                     
                     gfx.setColor( new Color(yellow-20, yellow-20, 0) );
                     gfx.fillOval(x-r+(int)xBias, y-r+(int)yBias, r*2, r*2);
                     
                     System.out.println("yellow "+yellow);
                     System.out.println("fillOval 1: "+ (x-r+(int)xBias) + ","+(y-r+(int)yBias)+","+(r*2));
                 
                     gfx.setColor( new Color(yellow, yellow, 0) );
                     gfx.fillOval(x-r+(int)xBias+4, y-r+(int)yBias-4, r*2, r*2);
                     
                     gfx.drawString("x", x-r+(int)xBias+4, y-r+(int)yBias-4);
                     
                     d_xBias = xBias;
                     d_yBias = yBias;
                     d_inv = inv;
                     d_weight = weight;
                     d_t = t;
                  }

Does anyone have any hints as to why this might be getting stripped? Full build log below in case there's some hints I've missed.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
CreateJar:
    [javac] Compiling 1 source file to F:\CodeRepository\NiGHTS4k\Dist\Build
      [jar] Building jar: F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar
     [echo] Unoptimised jar size: 5667
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\N.class
 [proguard] ProGuard, version 4.3
 [proguard] Reading program jar [F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar]
 [proguard] Reading library jar [C:\j2sdk1.4.2_16\jre\lib\rt.jar]
 [proguard] Preparing output jar [F:\CodeRepository\NiGHTS4k\Dist\Build\PostObs.jar]
 [proguard]   Copying resources from program jar [F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar]
    [unzip] Expanding: F:\CodeRepository\NiGHTS4k\Dist\Build\PostObs.jar into F:\CodeRepository\NiGHTS4k\Dist\Build
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\PostObs.jar
     [echo] ProGuard reduced class from 8776 to 8516
      [jar] Building jar: F:\CodeRepository\NiGHTS4k\Dist\Build\NiGHTS4k.jar
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\NiGHTS4k.jar
     [exec] 7-Zip 4.62  Copyright (c) 1999-2008 Igor Pavlov  2008-12-02
     [exec] Scanning
     [exec] Creating archive NiGHTS4k.jar
     [exec] Compressing  N.class
     [exec] Everything is Ok
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\N.class
     [echo] 7Zip reduced jar from 5405 to 4935
     [copy] Copying 2 files to F:\CodeRepository\NiGHTS4k\Dist\Build
     [echo] Final jar size: 4935 bytes
4kjo_Quick:
     [copy] Copying 1 file to C:\4KJO\Temp
     [exec] java.io.IOException: File: BJWFlate.exe already exists!
     [exec]    at Process.copyExecutable(Process.java:1025)
     [exec]    at Process.run(Process.java:81)
     [exec]    at FourKJO.main(FourKJO.java:71)
     [exec] Non main class found! attempting to determine if applet
     [exec] Class: N IS AN APPLET.
     [exec] current optimiser: JARG OPTIMIZER
     [exec] Original Size: 4951
     [exec] Optimised Size: 4960
     [exec] current optimiser: JODE OPTIMIZER
     [exec] Jode (c) 1998-2001 Jochen Hoenicke <jochen@gnu.org>
     [exec] used before: 235648
     [exec] Loading and preserving classes
     [exec] preserving: MethodIdentifier N.<init>.()V
     [exec] Time used: 94
     [exec] Computing reachability
     [exec] Time used: 281
     [exec] used after analyze: 2948488
     [exec] Renaming methods
     [exec] Time used: 0
     [exec] Transforming the classes
     [exec] Time used: 78
     [exec] used after transform: 2989672
     [exec] Writing new classes
     [exec] Time used: 31
     [exec] Original Size: 4963
     [exec] Optimised Size: 4541
     [exec] current optimiser: JOGA OPTIMIZER
     [exec] Original Size: 4543
     [exec] Optimised Size: 4526
     [exec] current optimiser: PROGUARD OPTIMIZER
     [exec] Original Size: 4522
     [exec] Optimised Size: 4433
     [exec] after Pack200/unpack200 Size: 4404
     [exec] FINISHED OPTIMISATION!
     [exec] best size: 4433
     [exec] best order:
     [exec] JARG OPTIMIZER
     [exec] JODE OPTIMIZER
     [exec] JOGA OPTIMIZER
     [exec] PROGUARD OPTIMIZER
     [exec] Compressor: BWJFLATE with split of 64
     [exec] Compressed Size: 4252
     [exec] FINISHED JAR COMPRESSION!
     [exec] best size: 4252
     [exec] best compressor: BWJFLATE with split of 64
     [exec] Size after last OpftDef: 4252
     [exec] renaming: C:\4KJO\Temp\NiGHTS4k.jar.out.zip: true
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\NiGHTS4k.jar
     [copy] Copying 1 file to F:\CodeRepository\NiGHTS4k\Dist\Build
     [echo] Final jar size: 4252 bytes


Pointers greatly appreciated, thanks.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #24 - Posted 2009-01-06 04:44:08 »

So just when I thought I was finished I seem to have hit this problem. Something in the processing is optimising out this whole loop:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
                  for (float t=HALF_PI; t<PI*1.5f; t+=0.5f)
                  {
                     final int r = rings_inactiveDecay[i] <= 0 ? 10 : 4;
                     
                     float weight = (float)Math.sin(t) / 2 + 0.5f;
                     float depth = (float)Math.sin(t+HALF_PI);
                     
                     float inv = 1.0f - weight;
                     
                     int x = (int)(rings_x1[i]*weight + rings_x2[i]*inv);
                     int y = (int)(rings_y1[i]*weight + rings_y2[i]*inv);
                 
                     float xBias = (x - camera_centerX) * 0.1f * depth;
                     float yBias = (y - camera_y) * 0.1f * depth;
                     
                     int yellow = (int)(220 + (depth*30));
                     
                     gfx.setColor( new Color(yellow-20, yellow-20, 0) );
                     gfx.fillOval(x-r+(int)xBias, y-r+(int)yBias, r*2, r*2);
                     
                     System.out.println("yellow "+yellow);
                     System.out.println("fillOval 1: "+ (x-r+(int)xBias) + ","+(y-r+(int)yBias)+","+(r*2));
                 
                     gfx.setColor( new Color(yellow, yellow, 0) );
                     gfx.fillOval(x-r+(int)xBias+4, y-r+(int)yBias-4, r*2, r*2);
                     
                     gfx.drawString("x", x-r+(int)xBias+4, y-r+(int)yBias-4);
                     
                     d_xBias = xBias;
                     d_yBias = yBias;
                     d_inv = inv;
                     d_weight = weight;
                     d_t = t;
                  }

Does anyone have any hints as to why this might be getting stripped? Full build log below in case there's some hints I've missed.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
CreateJar:
    [javac] Compiling 1 source file to F:\CodeRepository\NiGHTS4k\Dist\Build
      [jar] Building jar: F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar
     [echo] Unoptimised jar size: 5667
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\N.class
 [proguard] ProGuard, version 4.3
 [proguard] Reading program jar [F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar]
 [proguard] Reading library jar [C:\j2sdk1.4.2_16\jre\lib\rt.jar]
 [proguard] Preparing output jar [F:\CodeRepository\NiGHTS4k\Dist\Build\PostObs.jar]
 [proguard]   Copying resources from program jar [F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar]
    [unzip] Expanding: F:\CodeRepository\NiGHTS4k\Dist\Build\PostObs.jar into F:\CodeRepository\NiGHTS4k\Dist\Build
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\PreObs.jar
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\PostObs.jar
     [echo] ProGuard reduced class from 8776 to 8516
      [jar] Building jar: F:\CodeRepository\NiGHTS4k\Dist\Build\NiGHTS4k.jar
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\NiGHTS4k.jar
     [exec] 7-Zip 4.62  Copyright (c) 1999-2008 Igor Pavlov  2008-12-02
     [exec] Scanning
     [exec] Creating archive NiGHTS4k.jar
     [exec] Compressing  N.class
     [exec] Everything is Ok
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\N.class
     [echo] 7Zip reduced jar from 5405 to 4935
     [copy] Copying 2 files to F:\CodeRepository\NiGHTS4k\Dist\Build
     [echo] Final jar size: 4935 bytes
4kjo_Quick:
     [copy] Copying 1 file to C:\4KJO\Temp
     [exec] java.io.IOException: File: BJWFlate.exe already exists!
     [exec]    at Process.copyExecutable(Process.java:1025)
     [exec]    at Process.run(Process.java:81)
     [exec]    at FourKJO.main(FourKJO.java:71)
     [exec] Non main class found! attempting to determine if applet
     [exec] Class: N IS AN APPLET.
     [exec] current optimiser: JARG OPTIMIZER
     [exec] Original Size: 4951
     [exec] Optimised Size: 4960
     [exec] current optimiser: JODE OPTIMIZER
     [exec] Jode (c) 1998-2001 Jochen Hoenicke <jochen@gnu.org>
     [exec] used before: 235648
     [exec] Loading and preserving classes
     [exec] preserving: MethodIdentifier N.<init>.()V
     [exec] Time used: 94
     [exec] Computing reachability
     [exec] Time used: 281
     [exec] used after analyze: 2948488
     [exec] Renaming methods
     [exec] Time used: 0
     [exec] Transforming the classes
     [exec] Time used: 78
     [exec] used after transform: 2989672
     [exec] Writing new classes
     [exec] Time used: 31
     [exec] Original Size: 4963
     [exec] Optimised Size: 4541
     [exec] current optimiser: JOGA OPTIMIZER
     [exec] Original Size: 4543
     [exec] Optimised Size: 4526
     [exec] current optimiser: PROGUARD OPTIMIZER
     [exec] Original Size: 4522
     [exec] Optimised Size: 4433
     [exec] after Pack200/unpack200 Size: 4404
     [exec] FINISHED OPTIMISATION!
     [exec] best size: 4433
     [exec] best order:
     [exec] JARG OPTIMIZER
     [exec] JODE OPTIMIZER
     [exec] JOGA OPTIMIZER
     [exec] PROGUARD OPTIMIZER
     [exec] Compressor: BWJFLATE with split of 64
     [exec] Compressed Size: 4252
     [exec] FINISHED JAR COMPRESSION!
     [exec] best size: 4252
     [exec] best compressor: BWJFLATE with split of 64
     [exec] Size after last OpftDef: 4252
     [exec] renaming: C:\4KJO\Temp\NiGHTS4k.jar.out.zip: true
   [delete] Deleting: F:\CodeRepository\NiGHTS4k\Dist\Build\NiGHTS4k.jar
     [copy] Copying 1 file to F:\CodeRepository\NiGHTS4k\Dist\Build
     [echo] Final jar size: 4252 bytes


Pointers greatly appreciated, thanks.

not really an answer per se, but have you tried changing the loop's signature? i.e. perhaps

for (int i = 0; i<(int) ((PI-HALF_PI)*1.5)/0.5;i++)
{
     final t = HALF_PI + 0.5 *i;
...
}

to see whether the loop is still "optimiesd" away?

other than that, you can remove one of the optimisers from the list to identify which one is the culprit and then not use it.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #25 - Posted 2009-01-06 21:49:05 »

For some reason something was stripping out any loop with a float control value. Switching over to using an int control value and calculating the angle from it seems to have fixed it (and pushed my size up by a whopping 400b  Cry ).

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #26 - Posted 2009-01-07 00:20:45 »

that 400b is understanable if it now is using code it previously deleted... it put your hopes up and then deflated them Sad
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

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

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

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

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

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

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

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

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

BurntPizza (49 views)
2014-08-09 21:09:32
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!