Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (498)
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 ... 11
  ignore  |  Print  
  J4K  (Read 44994 times)
0 Members and 1 Guest are viewing this topic.
Offline mlk

Junior Member




Muppet!


J4K
« Posted 2004-12-21 23:22:02 »

I don't know if many of you read the game forums at sun, but the last few years I've run the J4k competition. Write a game, which fits in a 4K JAR (include all needed resources).

The (rather organic) rules are:

  • The game (byte code + resources) must be 4096 bytes (4kb) or under
  • Must be a playable game
  • Must be pure Java (no JNI)
  • The program should be entirely self-contained and must not reference resources from another pc over network.
  • The presentation (jar, class, or other) does not matter, as long as the code can be directly run from the shell.
  • The target JRE is 1.5.


I invite you all to come join in the fun..

Offline jbanes

JGO Coder


Projects: 1


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


« Reply #1 - Posted 2004-12-28 17:19:03 »

The SuperPackME toolset is now available! This release includes the complete toolset for generating SuperPackME files, as well as the Hexidecimal encoder and Class Inliner! With these tools, you should be able to get an 80% or more reduction in code and data sizes!

To download, simply visit:

http://jgcwiki.datadino.com/jgcwiki/index.php?title=Image_Compression_Technology

Scroll to the bottom of the page, and click on "SuperPackME Tools" to download. The page itself describes the SuperPack and SuperPackME formats.

I will be happy to help anyone who's has questions about the toolset. You can reach me here or by email at jbanes@gmail.com.

Good luck everyone, and let's make this a year for the record books!

Edit: BTW, I dished out some numbers on the Official 4K contest thread. Some highlights:

Quote
... Current results for 3-4 color images, is 37% of the original crushed PNG size! I've also developed a new tool that allows the data to be inlined into the class file. This not only saves space from the ZIP Headers, but it also allows the data to be processed without expensive references to the java.io package. Current results have 1126 bytes of PNG data, plus SuperPack loader, plus fullscreen support fitting into ~1.6K. That leaves about 2.4K for game logic! ...

Quote
... The new format can pack images with up to 255 colors. And the fewer colors you use, the better the images pack! With about 127 colors, you can get between 5-15% reduction over crushed PNG files. With 63 colors, you can get about 25% reduction! Even better is that the output file compresses even more in the JAR!  ...

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

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2005-01-01 17:58:36 »

Here's my first entry:

http://www.cokeandcode.com/4k/tilt

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mlk

Junior Member




Muppet!


« Reply #3 - Posted 2005-01-01 22:07:14 »

Kevglass, that was great.

re: one letter var names, private var names are
compiled out, as are method params and vars in
methods if compiling with -g:none, public stuff can
be removed with a obfuscator.  If you are really evil
(like me) you can even use a precompiler (stop
stairing at me like that).
I hope you don't mind, but I took the liberty of
throwing it through ProGuard [
http://proguard.sourceforge.net/ ], shrinking the
size of the jar to 3936 bytes (giving you loads of
space for more levels, yeay!).

--

Current Entrys:
oNyx
No Manifest, requires sound bank (JDK)
http://kaioa.com/games/jm4k.zip

mdb47
http://www.meatfighter.com/4k

--

Woogly has also dontated webspace for entrys, see JDC thread

Mlk
(must learn to preview Smiley )

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #4 - Posted 2005-01-01 23:26:04 »

Quote

Woogly has also dontated webspace for entrys, see JDC thread

Mlk
(must learn to preview Smiley )


How about a section on JGF? I've got some placeholders pencilled-in for programming competitions (c.f. the thread on here about rules, sizes, etc, that is being used as the basis for a JGF competition, although that's not ready yet). With 4k games, the biggest issue is simply how to integrate the comp information with the JGF site so that all the information is there but the rest of JGF doesn't get in the way.

Current thinking is/was (open to better ideas):
- games entered for competitions have a unique category in the DB
- each competition can be selected individually, giving a list of entries + metadata + a screenshot + logo for each one
- ...or all competitions at once, with sort-by-size, sort-by-date, sort-by-name, etc
- a "competitions" index page acts as a bookmarkable entry point with:
   - news on current and upcoming competitions
   - section listing winners of all recent competitions
   - links to rules + details of organizers + etc for each known competition
   - quick-links for submitting games to competitions via the JGF site (free hosting, game appears in the main JGF games list as well, etc)

If you'd like to get a set of pages up on the JGF preview site (http://javagamesfactory.org) I can get it up and running pretty fast (it's only cunning stuff like automatic JNLP that is broken - the basic stuff like making new pages etc is all working fine Smiley).

malloc will be first against the wall when the revolution comes...
Offline mlk

Junior Member




Muppet!


« Reply #5 - Posted 2005-01-02 02:34:26 »

Thanks blahblahblahh, the more places to upload the merrier Smiley  I'm all for it.  Grin

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #6 - Posted 2005-01-02 09:56:54 »

If you could collate all the existing info you have (rules, guidelines, useful links, previous games, current games - anything you can think of) then I'll format it all into pages (and stick your name on it as the contact Smiley).

Just copy/paste into a long email to ceo @ grexengine.com all the info you have.

(Obviously, in the future, I'd hope to have this A) automated and B) something you can administer/configure directly as the "owner" of the competition; right now I'm concentrating on getting games + auto-jnlp working :/)

malloc will be first against the wall when the revolution comes...
Offline Markus_Persson

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #7 - Posted 2005-01-03 09:44:38 »

ooh. I'll try whipping up an entry.  Cheesy

Play Minecraft!
Offline woogley
« Reply #8 - Posted 2005-01-03 10:12:20 »

lol, Wurm 4K... Grin
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #9 - Posted 2005-01-03 15:28:49 »

Interesting....

Like alot of people I suppose, I've missed the previous years.  Are the entries archived anywhere?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mlk

Junior Member




Muppet!


« Reply #10 - Posted 2005-01-03 22:02:23 »

Quote
 Are the entries archived anywhere?

Alas not, you can most of last years. (alas Sun changed the way URLs work(1) on the forums). The first 4K was Inappropriate content and killed. Yeay sun Roll Eyes

(1) Read: Made them stop working.  

Offline jbanes

JGO Coder


Projects: 1


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


« Reply #11 - Posted 2005-01-04 01:01:45 »

I posted a list of some of the cooler ones here. The second year can be found here. Saber X used to have an archive of the first year here, but it looks like it's gone. :-(

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

Junior Member




Muppet!


« Reply #12 - Posted 2005-01-04 05:20:11 »

I love archive.org
I wonder howmany are still live?

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2005-01-04 05:29:45 »

Reakon Woogley would extend the current j4k site to include a definitive list of entries each year?

Kev

Offline Markus_Persson

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #14 - Posted 2005-01-04 08:43:14 »

This is more fun than I thought it would be. =D

Play Minecraft!
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #15 - Posted 2005-01-04 12:40:09 »

Quote
Reakon Woogley would extend the current j4k site to include a definitive list of entries each year?

Kev


...trying to get it all into JGF at the moment, which would preserve them all indefinitely, using W's design + data along with all the other info. It's a bit worrying that on the first pass of a list of pages needed for the competition I forgot to include a results-per-year page  Roll Eyes. So, um, if anyone can think of any other pages that are needed and not present on W's site, please post them.

Hoping to get the site minus binaries up PDQ (today?), with binaries to follow once the game-submission thing is tested/working.

malloc will be first against the wall when the revolution comes...
Offline Markus_Persson

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #16 - Posted 2005-01-04 21:58:24 »


http://www.mojang.com/j4k/

Play Minecraft!
Offline woogley
« Reply #17 - Posted 2005-01-04 22:09:45 »

Quote
Reakon Woogley would extend the current j4k site to include a definitive list of entries each year?

Kev


yes I wouldn't mind publishing a more complete J4K site, and I think it would be a great idea for its home to be on JGF (seeing as it is a java gaming resource site)

p.s. Markus: great job in that Sonic game. Will you be releasing the source? Cheesy
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #18 - Posted 2005-01-04 22:14:23 »

Phew, that sonic game is smooooooth!

Nice one!

Kev

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #19 - Posted 2005-01-04 22:52:45 »

Shocked

Wow Grin

And it even runs ultra smooth on my old hardware Smiley

弾幕 ☆ @mahonnaiseblog
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


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

Quote


No window decorations AT ALL on linux (no title bar, no edges, nothing) - or is my X playing up right now with some weird bug? Sad

Apart from that, works fine. One suggestion: make the avatar into a hovercraft or something else that skids. It's weird that Sonic has greased shoes Huh

malloc will be first against the wall when the revolution comes...
Offline mlk

Junior Member




Muppet!


« Reply #21 - Posted 2005-01-05 00:22:03 »

Quote

Very cool.
Needs someone to race against. Wink
Sonics slides quite a lot, and no real feeling of speed (or my computer is incredible slow Wink )

Offline Markus_Persson

JGO Wizard


Medals: 12
Projects: 19


Mojang Specifications


« Reply #22 - Posted 2005-01-05 06:55:50 »

[I moved this to another thread to prevent potential threadjacking]

Play Minecraft!
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #23 - Posted 2005-01-06 09:21:21 »

Is it allowed to 'assume' tools.jar (J/SDK) is in the classpath, and read/write access in user.dir?

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #24 - Posted 2005-01-06 10:32:02 »

I would have thought read/write access in user.dir was fine but tools.jar isn't part of the jre so I'd guess that one was out.

Kev

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #25 - Posted 2005-01-06 11:17:53 »

Dynamic compiling would have been so great.. :-/

My zipped sourcecode is way smaller than my zipped bytecode. I use -g:none and use 1 letter fields.
(take out all line feeds and as much as possible spaces)

But well, for now I have more than enough space anyway, for my ridiculously simple game Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline jbanes

JGO Coder


Projects: 1


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


« Reply #26 - Posted 2005-01-06 12:28:28 »

Did you actually write the compiler interface and loader? I'm willing to bet that the number of class references you'd make for the compilation and loading would completely erase any advantages you'd gain by compressing text. :-(

FWIW, the class embedding part of my SuperPackME tools is predicated around the fact that the Deflate algorithm compresses text better than binary data. In order to embed data, SuperPackME actually has you double the size of the data by reencoding it in hexidecimal. But when compressed, the hex is actually smaller than the original binary! Can't beat that. :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #27 - Posted 2005-01-06 18:19:08 »

zipped -g:none bytecode: 2.4kb
sourcecode: 1.4kb

and then this case is optimized for bytecode-size.
i never reuse values, i recalc them everytime (lot's of source-code, less bytecode), so no doubt i can bring sourcecode down to 1.1kb vs 2.4kb bytecode.

that's 1:2 Shocked
enough to consider dynamic compilation, if it was allowed. Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #28 - Posted 2005-01-06 18:25:51 »

Quote
zipped -g:none bytecode: 2.4kb
sourcecode: 1.4kb

and then this case is optimized for bytecode-size.
i never reuse values, i recalc them everytime


Uh, why?

I can imagine that increasing bytecode size stupidly - inlining is usually used to INCREASE code size, sacrificiing it to gain performance...

malloc will be first against the wall when the revolution comes...
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #29 - Posted 2005-01-06 18:31:09 »

for every action i try a couple of versions. then i use the one with the smallest class-file.

easy as that. in *most* cases recalculating values requires less bytes in the classfile.

I'm not assuming things, these are facts Smiley

The state of the game is now like: 1 giant long[]

Update:
Another example you wouldn't expect: (or at least I didn't)
> new Color(0, 0, 0, 64);
is 13 bytes smaller than
> new Color(0x40000000, true);
but maybe i'm missing something here

You can save quite a few bytes with trial and error.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Pages: [1] 2 3 ... 11
  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.

xsi3rr4x (16 views)
2014-04-15 18:08:23

BurntPizza (14 views)
2014-04-15 03:46:01

UprightPath (27 views)
2014-04-14 17:39:50

UprightPath (12 views)
2014-04-14 17:35:47

Porlus (29 views)
2014-04-14 15:48:38

tom_mai78101 (51 views)
2014-04-10 04:04:31

BurntPizza (110 views)
2014-04-08 23:06:04

tom_mai78101 (211 views)
2014-04-05 13:34:39

trollwarrior1 (179 views)
2014-04-04 12:06:45

CJLetsGame (185 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!