Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
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  
  Poll: Are you entering this year's 4K competition?  (Read 4920 times)
0 Members and 1 Guest are viewing this topic.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Posted 2004-12-30 16:25:46 »

The Java 4K competition is a chance for Java developers to show off their skills, and face a grueling coding challenge like no other. It requires developers to know anything and everything about how Java works in order to squeeze that last bit out of their program.

I'm curious to know if any of you will be entering this year's competition. If you're not, tell us why! :-)

Here's some 4K games from previous years:

Abuse's 4K Shooter
Defender 4000 and WarGames
Tube Blazer
Magic Cutter
Space Invaders 4K
4K Racing Applet

(That's about as many as I'm going to track down. Feel free to add yours.)

Current entries this year are:

JM4K by Onyx
Meat Fighter 4K by MDB47

Java Game Console Project
Last Journal Entry: 12/17/04
Offline woogley
« Reply #1 - Posted 2004-12-30 18:22:37 »

I'm definitely entering (although I'm still not entirely sure what my entry is gonna be- call me a procrastinator if you want!)

I think the contest is a great idea, it's amazing what you can pull off with only 4k. Plus you learn lots of ways to optimize code. Grin

ps - the above link for "Magic Cutter" is wrong, the site has moved. You can find the game at its new location here
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #2 - Posted 2004-12-30 18:35:31 »

"of course" haha Grin

Well, 4k is nuts. Really. But I'm glad that I finally finished it.

And I already decided what I'll do for j4k mk4. It's less insane, but even more like a game (with like 20 levels) Smiley

Nice list btw. Those are my favorite 4k games. The annoying bit is that most of em don't run anymore with 1.5... "corrupted jar yadda yadda"... but actually it's because "Manifest-Version: 1.0" is missing in the manifests. D'oh. (Just run em manually).

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #3 - Posted 2004-12-30 19:21:38 »

Quote
And I already decided what I'll do for j4k mk4. It's less insane, but even more like a game (with like 20 levels) Smiley


Well, you've got two months. Do it this year! You can even use the tools I released to shave off development time. ;-)

Quote
The annoying bit is that most of em don't run anymore with 1.5... "corrupted jar yadda yadda"... but actually it's because "Manifest-Version: 1.0" is missing in the manifests. D'oh. (Just run em manually).


Actually, all they need is an extra carriage return in the Manifest. For example, a Manifest for jm4k.jar would look like:

1  
Main-Class: D


Versions of the JAR format prior to 1.1 were pretty lenient on getting the carriage returns right. Thus the JVM lets JARs with the "Manifest-Version: 1.0" go through. Of course, we 4K programmers strip out all the auto-generated stuff, so that attribute is missing. ;-)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #4 - Posted 2004-12-30 19:44:35 »

>Well, you've got two months. Do it this year!

Nah.

Uhm... maybe. Need to catch up with my master plan. Well, I'll see.

>You can even use the tools I released to shave off
>development time.

I won't use any images. I need 8 different rather simple tiles, which I'll just draw with Java2D methods. fillRect, drawLine and some gradients is everything I'll need Smiley

弾幕 ☆ @mahonnaiseblog
Online princec

« JGO Spiffy Duke »


Medals: 983
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2004-12-31 08:24:09 »

If I'm going to spend any time writing applets, they're going to be slick enough to put on my website! I don't really feel like entering any more competitions...

Cas Smiley

Offline Raghar

Junior Devvie




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #6 - Posted 2004-12-31 21:53:25 »

Naw.

I compressed data from 4 TB to over 30 GB, if I'd compress them more I'd go under shannon limit. ~_^
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #7 - Posted 2004-12-31 23:16:18 »

Quote
Naw.

I compressed data from 4 TB to over 30 GB, if I'd compress them more I'd go under shannon limit. ~_^


Eh? I can compress 4TB to 6 bytes with no problem. Here's a hex dump of the encoded data:

1  
04 00 00 00 00 00 FF


And here's the decompressor:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
long length = 0;
long counter = 0;
int b;

for(int i=0; i<6; i++)
{
  length <<= 8;
  length |= in.read();
}

b = in.read();

while(counter < length)
{
  out.write(b);
  counter++;
}


Grin

Java Game Console Project
Last Journal Entry: 12/17/04
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #8 - Posted 2005-01-01 07:55:29 »

I was considering entering so I had a go, man this is difficult! One simple class that create a frame etc is 1k !

Have I forgotten some command line switch (-makeitsmall) ?

Kev

Offline woogley
« Reply #9 - Posted 2005-01-01 11:16:39 »

well you always have -g:none which will strip out all of the debugging info. Sometimes the -O flag can also reduce class size, but sometimes it can also enlarge it. Test that one carefully.

When you jar the game up, don't forget you can pass the M flag which will skip the manifest entry altogether. The rules say the game must be executable from the command line, it didn't say it had to be self executable Tongue

That's really all the compiler flags I can think of that has anything to do with class size. And really you shouldn't worry too much about the size of one class, because you're probably only going to use one class for the entire game.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #10 - Posted 2005-01-01 11:27:11 »

Just to be sure here, a jar file that is under 4096 bytes is ok? The class inside could be larger? Or is that against the rules?

Kev

Offline woogley
« Reply #11 - Posted 2005-01-01 11:44:16 »

yes, the class inside can be larger. The final package of the game and its resources must be <=4096bytes. Since this is the case, most entries will definitely be jars.

by the way... I just remembered one of the great tricks Abuse uses.
Consider this class that creates a frame:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
import javax.swing.*;
import java.awt.*;
public class G extends JFrame {
      public G() {
            super("Game");
            show();
      }
      public static void main(String args[]) {
            new G();
      }
}

When compiled normally, the class size is 336bytes. When compiled with the -g:none flag, the class is 252 bytes.
But notice this neat trick Abuse uses:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
import javax.swing.*;
import java.awt.*;
public class G extends JFrame {
      public G() {
            super("Game");
            show();
      }
      /* public static void main(String args[]) {
            new G();
      } */

      static {
            new G();
      }
}

when that is compiled with the -g:none flag, the class size 231bytes. The only problem with this is, the JRE will throw an exception in your face for not having a main method Tongue

Now with a class that small, JARing it would probably actually enlarge it (I'm too lazy to test though). You don't need to start JARing until you approach 4K a little closer Wink
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #12 - Posted 2005-01-01 16:38:24 »

Thanks for the tips!

Last Question until I go off an write my second entrant (or not Smiley): Is there some formal way I have to submit the entry or is it just a post here type job?

Kev

Offline woogley
« Reply #13 - Posted 2005-01-01 16:53:53 »

it would be a good idea to post your entry on both of the "official" posts:
JDC Thread
JGO Thread
Offline nonnus29

Senior Devvie




Giving Java a second chance after ludumdare fiasco


« Reply #14 - Posted 2005-01-04 00:16:17 »

I'm gonna give it a whirl.  I've been doing some testing and I think I can fit a 3d software renderer with flatshaded poly's using Graphics.fillPolygon() into a 4k jar.  My basic applet framework with basic matrix functions is 2.7kb right now (with KeyListener).

I'm guess-stimating I can have up to a 7.0 - 7.5kb class file compress down to 4.096.  Does that sound about right?  

6kb of code and 1 kb of meshes;  I'm gonna have some nasty data management with no other classes (maybe one big float[] for verts, normals, triangle indexes and colors... ??? )

We'll see...

Offline tom
« Reply #15 - Posted 2005-01-04 00:36:13 »

I think you could save some bytes by ditching the matrix stuff and do the transformations directly with sin/cos.

Offline mlk

Junior Devvie




Muppet!


« Reply #16 - Posted 2005-01-04 04:25:13 »

http://web.archive.org/web/20030804050840/http://www.saber-x.com/midgarddesign/4k.html
Archive.org rocks Smiley

Ohh, and my entry really will suck
Grin

Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #17 - Posted 2005-02-17 05:37:40 »

Quote
I was considering entering so I had a go, man this is difficult! One simple class that create a frame etc is 1k !

Have I forgotten some command line switch (-makeitsmall) ?

Kev


Now... in retrospect... I think that post is kinda funny Grin

弾幕 ☆ @mahonnaiseblog
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #18 - Posted 2005-02-17 05:46:07 »

Smart arse. But yeah.. this year compo has proved to be a great success. Quality games and lots of them (well, apart from some of my entries Wink)

Kev

Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (158 views)
2017-09-30 02:57:34

theagentd (225 views)
2017-09-26 18:23:31

cybrmynd (306 views)
2017-08-02 12:28:51

cybrmynd (291 views)
2017-08-02 12:19:43

cybrmynd (302 views)
2017-08-02 12:18:09

Sralse (293 views)
2017-07-25 17:13:48

Archive (980 views)
2017-04-27 17:45:51

buddyBro (1109 views)
2017-04-05 03:38:00

CopyableCougar4 (1686 views)
2017-03-24 15:39:42

theagentd (1439 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!