Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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
  ignore  |  Print  
  Let's do this.  (Read 5988 times)
0 Members and 1 Guest are viewing this topic.
Offline woogley
« Posted 2005-12-01 06:26:11 »

got home late from work today, so I'll post a *full* list of rules tomorrow. but I didn't want to dissapoint anybody who was waiting for 12:00 AM of December 1st to arrive, so the submission page is open!

http://javaunlimited.net/games/submit.php

screenshots and custom homepages are a plus (saves me some work Wink). currently the FTP Hosting link is unavailable but I will be offering free hosting to whoever needs it this year.

be sure to select "Java 4K 2006" as the contest, and also be sure your minimum Java requirement is at 1.4 or earlier.

games will enter an approval queue where I will approve the games based on content. game sizes will not be validated until the contest closing, so feel free to post unfinished previews if desired Wink. Approval queue is checked daily, so expect to see your game in at least 24 hours or less.

also, this is the first public run of the submission page. please alert me of any bugs - we can't afford to lose track of any games Smiley

finally, judges are needed, so feel free to volunteer if you're not submitting an entry.
Offline anarchotron

Junior Duke




...precious bodily fluids.


« Reply #1 - Posted 2005-12-01 17:10:10 »

I know this is a n00bish question and there is probably somewhere that I could RTFM, so I humbly and shamefully apologize in advance for asking this question, but.

What external libs, if any are allowed to be used?  Is the 4k game required to only use what comes with the JRE SE?

Thanks!
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #2 - Posted 2005-12-01 17:16:27 »

I believe all of your questions will be answered this evening and/or night, when woogley gives us the full rules.

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

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2005-12-02 11:27:06 »

Ahem, rules?

EDIT: Oh - is this going to be posted at the other java games forums btw? (http://forum.java.sun.com/forum.jspa?forumID=406)

Kev

Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #4 - Posted 2005-12-02 12:40:48 »

I'd like to see the rules as well Smiley
Oh, and unlimited still says "Launching dec 1". It's dec 2 now, so... =P

Offline woogley
« Reply #5 - Posted 2005-12-02 17:12:54 »

sorry for the wait Lips Sealed

anyway I think this covers everything: http://javaunlimited.net/contests/java4k.php

the only thing I have to setup now is free hosting but nobody has even asked for it yet so ...

anarchotron, no external libs Wink

any other specific questions (after reading the rules)... hit me Tongue
Offline woogley
« Reply #6 - Posted 2005-12-02 17:14:06 »

ooh, kev, good idea (even though it is more than dead over there). cant hurt to inform the rest of the community though
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #7 - Posted 2005-12-02 17:16:42 »

woogley, you're confused. I didn't ask about external libs, it was somebody else. Cheesy

Let me see if I understand the rules:
If I use webstart, then the SIGNED jar (if I need a signature) has to be below 4k?
Fine, so I'll just submit a normal JAR as the official entry and link to a webstartable version anyway... which brings me to my next question: If I submit both links (JAR and webstart) on the submission site, which version will you use to check size? I hope you'll use the archive, because I really wish to be able to provide webstart on the site as well so that people can try the games, and still have my JAR ar the official, size-checked entry.

How are things going with those comments fields for games on the site? Will that be possible soon? Smiley

Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #8 - Posted 2005-12-02 17:17:22 »

So, we're saying you're not allowed:

java -cp myjar.jar Game

this year then? It'd have to have a manifest inside it? But I am allowed to use webstart and the main-class attribute in there?

All fine by me if that is the case, just wanted to be sure.

Kev

Offline woogley
« Reply #9 - Posted 2005-12-02 17:22:20 »

Sorry Morre, I'm on flu medicine atm Cheesy

Kev, yes you can use Webstart's main-class attribute, nothing wrong there. As long as it executes from the link on Java Unlimited with no command line, you're in the clear. This year's contest is shooting for a "plug and play" type of feel.

Also don't forget you don't need a manifest in a JAR if there is only one class file in the JAR (or at least that's how it used to be in the 1.2 days).

edit: Morre, about your question. You can use a signed JAR that is above 4K for webstart if you also provide the same JAR unsigned that is below 4K as a download as well. If you submit both a webstart and unsigned JAR version, the only size I check is the unsigned JAR.
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 #10 - Posted 2005-12-02 17:28:10 »

Excellent. Thank you for making that clear Smiley

EDIT: Sorry to hear you've got the flu :S

Offline jbanes

JGO Coder


Projects: 1


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


« Reply #11 - Posted 2005-12-02 17:30:39 »

Hi Woogley,

A Question: If a game has both an Archive URL and a Webstart URL, which one is used for official judging? I understand that you can force the Webstart URL to be invalid by making the JAR larger than 4K via a signature, but what if both JARs fit?

For example, someone could create two separate versions of their code, one with full screen support, the other without. That would allow the Webstart version to work without a signature. Yet that developer may not actually want the Webstart version to be the one judged. How would this be resolved?

Java Game Console Project
Last Journal Entry: 12/17/04
Offline woogley
« Reply #12 - Posted 2005-12-02 17:44:31 »

Morre, thanks Wink

jbanes, interesting. like I said above... when it comes to size, the archive URL is the one validated. As far as which file is judged, the gameplay itself should be the same on both launch options, so does it matter? You might want to put in your submission notes that the archive URL runs fullscreen which could potentially be more fun than a non-fullscreen webstart version.

Be careful when you have differences like that though... because the game is disqualified if any part of the gameplay is different between launch types (i.e. extra in-game feature due to extra space on the unsigned jar...). Fullscreen counts as a launch feature so that won't be marked against you.

Either way I'll have judges play both webstart and archives so you'll be in the clear. Either way like I said.. best you can do is say in your submission notes if one launch version could be more fun due to fullscreen or whatever.
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #13 - Posted 2005-12-02 18:01:19 »

woogley, I suggest you modify the top post with a bold text that says "Rules" or something, so that it's clearly visible. Right now the link's in the middle of the posts, a bit confusing.

Offline woogley
« Reply #14 - Posted 2005-12-02 18:05:21 »

hmm I'll just make another topic for it.
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #15 - Posted 2005-12-02 18:06:12 »

That works.

Offline Rick

Junior Duke


Projects: 1


Java games rock!


« Reply #16 - Posted 2005-12-03 17:27:16 »

Woogley, Can I take you up on the hosting offer for the 4k contest. I see that my entry LadyBug is not showing the screen shot as it is bieing hosted on the free site tripod which replaces direct links to images with a plug for their site. What are the FTP details to upload my image to your site.
Offline f.l.x

Senior Duke


Projects: 3


there is no place like 127.0.0.1


« Reply #17 - Posted 2005-12-05 17:05:01 »

Is there any "j4k guide for n00bs" anywere? I have been doing something (just to try) and i have just reached 4061B only with input and rendering implemented and i don't know how sqash my code harder Undecided

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline nonnus29

Senior Duke




Giving Java a second chance after ludumdare fiasco


« Reply #18 - Posted 2005-12-05 17:27:07 »

Check some of the threads from last year, lots of people posted source code to their games (including me).  Warning, 4k can be addictive.....    Grin
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #19 - Posted 2005-12-05 18:16:43 »

Is there any "j4k guide for n00bs" anywere? I have been doing something (just to try) and i have just reached 4061B only with input and rendering implemented and i don't know how sqash my code harder Undecided

Some hints:

- Use only one class
- The class should inherit from JFrame if it is a webstart app.  That way the close box automagically works, although you need to call isVisible() from time to time & do a System.exit(0), if the Frame is no longer visible.
- Put the entire game in the constructor if possible.  Each function added to the class has overhead
- Avoid using class variables, unless you absolutely need them (e.g. more than one function accesses them) as these are more expensive in space than local variables in a function.
- If you declare any constants as class variables, declare them as private final static.  This will get them inlined.
- Use the minimum number of class library methods.  Everytime you use one of these, the full name (class+method) ends up in the .class file.
- Use long variable names as usual, except for the class name, which should be a single letter.  Use an obfusticator such as proguard.  This will reduce all variables in the .class to single letters, remove unused functions.
- Unjar the file proguard produces and then rejar using a standard zip compressor such as 7zip or kzip.  Remember to specify the command line switches to get maximum compression.
- You don't need a manifest if you use webstart as the only starting method.  If you do include a manifest (& it is a nice touch) you only need the version and main-class statements.

Good Luck

Alan

Time flies like a bird. Fruit flies like a banana.
Offline f.l.x

Senior Duke


Projects: 3


there is no place like 127.0.0.1


« Reply #20 - Posted 2005-12-05 18:35:11 »

woah, thanks i wasn't following most of these statements

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #21 - Posted 2005-12-06 01:38:39 »

- If you declare any constants as class variables, declare them as private final static.  This will get them inlined.
You save even a little more space by manually removing the constants and putting the value in their place.

From the start you can program a little more normally, so it is easier to follow your own code.  Then remove constants and replace them with their values.  Don't use temporary variables for calculations, just put the calculation inline.  Don't worry about using single letter variables, because an ofuscator will take care of that for you.  It also removes class information for reflection, because you won't need them.

Offline jbanes

JGO Coder


Projects: 1


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


« Reply #22 - Posted 2005-12-06 01:44:21 »

Don't use temporary variables for calculations, just put the calculation inline.

If you do use a variable, however, don't be a scrooge with them. Since local variables are all on the stack, it doesn't matter to the compiled code if you reuse one variable or ten. It generates pretty much the same code. So I guess the other lesson to get out of this is to watch out for false economy. Smiley

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

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #23 - Posted 2005-12-06 17:40:12 »

Actually, that's a good trick, first obfuscating, and then repacking... saved me 0,1 kb or something, and that's when the jar was only 2,5kb in total Cheesy

Offline Anon666

Junior Duke




aka Abuse/AbU5e/TehJumpingJawa


« Reply #24 - Posted 2005-12-06 18:30:16 »

Quote
Don't use temporary variables for calculations, just put the calculation inline

That is certainly a false economy - any halfway decent peep-hole optimiser will automagically inline such assignments.
(a value written to, and immediately read back from a local)

Keeping the number of entries in the constants pool to less than 256 will give a very real gain.
It will avoid use of the larger ldc_w instruction.
(and may also help compression, because you will potencially have one less unique symbol to compress)

Also, *never* use double or long constants - they use up 2 entries in the constants pool,
and are read from the pool using a different instruction.
It is best to store them as float/int and let them be cast upto the needed type.

A good example of this (as most will be using it Wink) is enableEvents(long).
If you simply pass in a constant to this method (regardless of whether it is an int or a long),
it will be expanded to a long by javac, and stored in the constants pool as such.

It is better to store the value in the constants pool as an integer, and then cast it to a long when it is passed into the method.
However, i'm unsure if you can perform this optimisation using the Java syntax;
or whether the java compiler will always evaluate the constant, and extend it to a long.
(it is certainly an optimisation worth automating with BCEL)

[crazyness]
infact, if you are using a small value (10 or less) for the enableEvents flag  (for example 6 Wink) - the optimal solution turns out to be enableEvents((long)(3+3)) as this completely eliminates the constants pool entry! (there are specific instructions for pushing the integer values -1 through to +5 onto the stack)[/crazyness]

The same goes for people using Math.PI; cast it to a float before you use it, to avoid the overhead of a huge 8byte! constants pool entry.

Structuring your code so the active scope of a variable is as small as possible will also give you gains.
Due to Java's smaller-bytecode instructions for accessing the first 4 local variables (1byte rather than 2),
keeping the active set of local variables as small as possible will help your code size.
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #25 - Posted 2005-12-06 18:42:51 »

@Anon666 Loads of stuff I didn't know there, although I had found that changing the scope of local variables sometimes improved matters & sometimes didn't, for no obvious reason  Smiley

Time flies like a bird. Fruit flies like a banana.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #26 - Posted 2005-12-06 19:19:05 »

[crazyness]
infact, if you are using a small value (10 or less) for the enableEvents flag  (for example 6 Wink) - the optimal solution turns out to be enableEvents((long)(3+3)) as this completely eliminates the constants pool entry! (there are specific instructions for pushing the integer values -1 through to +5 onto the stack)[/crazyness]

Are you trying to tell me that javac doesn't evaluate the 3+3 and put a 6 in the bytecode when compiling the source code?  I have a hard time believe that, but not enough energy to check Smiley.

Offline Anon666

Junior Duke




aka Abuse/AbU5e/TehJumpingJawa


« Reply #27 - Posted 2005-12-06 20:08:08 »

[crazyness]
infact, if you are using a small value (10 or less) for the enableEvents flag  (for example 6 Wink) - the optimal solution turns out to be enableEvents((long)(3+3)) as this completely eliminates the constants pool entry! (there are specific instructions for pushing the integer values -1 through to +5 onto the stack)[/crazyness]

Are you trying to tell me that javac doesn't evaluate the 3+3 and put a 6 in the bytecode when compiling the source code?  I have a hard time believe that, but not enough energy to check Smiley.


oh no, you are absolutely right! javac *does* evaluate it (and infact expands it to a long constant 6L ).
Thats the problem, and why the optimal solution cannot be achieved by compiling with javac - without later performing such bytecode optimisations with a tool like BCEL.
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #28 - Posted 2005-12-06 20:30:46 »

Heh... I had no idea about that. I'm just not that good a programmer >)

Offline f.l.x

Senior Duke


Projects: 3


there is no place like 127.0.0.1


« Reply #29 - Posted 2005-12-06 22:44:04 »

hmmm

i have made some test on that  long constants optimizing

Mi early state game with this:

df = (int)((getWidth() / 2) / Math.tan(Math.PI / 4));

jared  3918b

with this
df = (int)((getWidth() / 2) / (float)Math.tan(Math.PI / 4));

3920b

but, it's not significative, i have been noticing something very strange:

before doing nothing to the code: 3920b
after adding a new blank line 3916b

 Undecided

the actual size of the bytecode can be affected simply by recompiling??!!

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Pages: [1] 2
  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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (44 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (38 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (68 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (87 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!