Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (108)
games submitted by our members
Games in WIP (536)
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 4 ... 11
  ignore  |  Print  
  J4K  (Read 46801 times)
0 Members and 1 Guest are viewing this topic.
Offline jbanes

JGO Coder


Projects: 1


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


« Reply #30 - Posted 2005-01-06 18:53:32 »

Quote
zipped -g:none bytecode: 2.4kb
sourcecode: 1.4kb
that's 1:2 Shocked
enough to consider dynamic compilation, if it was allowed. Smiley


Yes, but have you actually attempted the dynamic compilation class? If the class to compile and load the dynamic classes is larger than the savings from compressing source code, then your net gains are actually worse than if you'd just used bytecode!

@Blah^3:
Quote
I can imagine that increasing bytecode size stupidly - inlining is usually used to INCREASE code size, sacrificiing it to gain performance...  


This isn't C/C++, Blah. Every reference to a method or class eats up significant constant pool space over simply inlining it. i.e. implementing a "min(int a, int b)" would be far more costly than implementing "(a < b) ? a : b" in ten different places! The reason is that you have maybe three bytes (in the form of bytecodes) for the "?:" statement. For the method you need:

"min" (3 bytes) +  CONSTANT_UTF8_Info structure (3 bytes)
"(I)II" (5 bytes) + CONSTANT_UTF8_Info structure (3 bytes)
method_info structure (8 bytes)
attribute_info structure (6 bytes)
code data (3 bytes - guesstimation)

That's 31 bytes for the method if no one uses it! Using the "?:" syntax is already smaller by one byte, and compresses better to boot! That's not to mention the bytecode associated with each method call, plus various overhead with the stack that I'm not even counting.

Being small in Java very much about avoiding method calls and class fields as much as possible.

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

JGO Coder


Medals: 1


http://t-machine.org


« Reply #31 - Posted 2005-01-06 19:28:28 »

Quote

@Blah^3:

This isn't C/C++, Blah. Every reference to a method or class eats up significant constant pool space over simply inlining it. i.e. implementing a "min(int a, int b)" would be far more costly than implementing "(a < b) ? a :


Um, yeah, I konw that - I was thinking of non trivial code.

I was a bit surprised by the source == much smaller than code stat, usually when I'm doing these my source is approx the same size as the classfiles, prior to squeezing everything (IIRC). But... aggressive unrolling and inlining of non-trivial instructions would eat up code space.

Still, it's been so long since I was doing this that I simply don't know whether the code space is eaten up more or less quickly than the source code expands, post-compression. Hence I was wondering why he was inlining.

PS I don't tend to consider inlining a min or max method call to be inlining per se - technically speaking you could say that "every statement that is not a single method call is in fact inlined source" but I tend to think "inlining" == "multiple lines of source / non-trivial groups of statements".

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

JGO Coder


Medals: 1


http://t-machine.org


« Reply #32 - Posted 2005-01-06 20:32:04 »

Well, a very incomplete first version of the competitions module is now up on JGF, and lucky j4k gets to be the beta test Grin :

http://javagamesfactory.org/views/view-gameprogramming-competition?name=j4k

mlk - tell me your JGF username and I'll give you editor access for the competition, so you can post news, change the description / prize info / etc.

Although I recommend only doing news postings for now, and limiting them to just one paragraph per item, until I finish off the module Smiley.

Logo taken from Woogley's page - is this the official one?

Once I've got the other management features working, we can transfer across all other info into appropriate extra pages and get multiple editors setup (who do you want? give me a list of JGF usernames and I'll give them appropriate access...). But, for now, only the front page is working. Including...you'll be able to upload all the previous entries for each of the "previous rounds". But not yet Sad.

malloc will be first against the wall when the revolution comes...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mlk

Junior Member




Muppet!


« Reply #33 - Posted 2005-01-06 23:16:36 »

My JGF username/password is "mlk".

As to official imagery, I was not aware it had any official anything, other than a set of rules Wink

The JGF page is great.

Offline woogley
« Reply #34 - Posted 2005-01-07 01:07:57 »

well, if you need an official one, feel free to take mine. not like I put hours of work into it Wink
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #35 - Posted 2005-01-07 06:48:42 »

As I said via email, assuming mlk's happy, I'm keen for you (or anyone else) to take over the j4k pages on JGF, at least as far as is possible. Right now there's not much of the page design you can alter, due to technical issues (I haven't implemented those aspects yet Smiley), but the editing of data is half-working already and I should be adding rich controls real soon.

malloc will be first against the wall when the revolution comes...
Offline woogley
« Reply #36 - Posted 2005-01-07 17:34:21 »

I'd like to take it over if I had HTML-based control of the design (so J4K would have a unique look). If your module has colors settings and all that through web-based options, have an option for the coder to override all of that with custom HTML, that would make it alot easier to style it up in its unique way Tongue

as far as data goes, though, I can manage that if nobody else wants to. I'm interested in designing it, I dont really care about adding data etc Wink
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 751
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #37 - Posted 2005-01-07 22:08:23 »

On your j4k website (http://www.woogley.net/java4k.html) you specified the login settings for your ftp-server, but don't supply the password. I guessed it in 2 times, and came in, but it wouldn't be bad to just put it there.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline woogley
« Reply #38 - Posted 2005-01-07 22:50:55 »

many thanks for pointing that out Skippy, I didn't even notice it was missing Roll Eyes

fixed now
Offline kevglass

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #39 - Posted 2005-01-14 14:08:15 »

Nice stack of entries the year Smiley

Kev

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

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #40 - Posted 2005-01-17 13:38:34 »

Anyone got a concise complete list of the games this year? I wanted to show a collegue?

If not, I'll collate one.

Kev

Offline kevglass

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #41 - Posted 2005-01-18 12:15:16 »

Anyone alive out there?! Smiley

Heres the list I have so far, some data needs updating since I can't get to some webservers at the moment:

http://www.cokeandcode.com/4kgames.html

Kev

Offline woogley
« Reply #42 - Posted 2005-01-18 12:41:14 »

ooh, sorry I didnt reply sooner! I have a complete list (thus far) here:

http://woogley.net/games.html
Offline kevglass

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #43 - Posted 2005-01-18 12:53:50 »

Ah ha, beautiful!

In that case I'd like to annonce Snake, Trooper and Ball4k.. assuming of course we're allowed multiple entries?


Snake

http://www.cokeandcode.com/games/4k/snakez/snakez.jnlp
http://www.cokeandcode.com/games/4k/snakez/snakez.jar
Main-Class: S


Trooper

http://www.cokeandcode.com/4k/trooper/trooper.jnlp
http://www.cokeandcode.com/4k/trooper/trooper.jar
Main-Class: T


Ball4k

http://www.cokeandcode.com/games/4k/ball4k/ball4k.jnlp
http://www.cokeandcode.com/games/4k/ball4k/ball4k.jar
Main-Class: R

EDITED: To remove snippy nature of post.

Kev

Offline woogley
« Reply #44 - Posted 2005-01-18 13:25:24 »

I just posted trooper on the games list, but I cant download the other two! i'm assuming your games subdomain is having a DNS problem?

about the multiple games, I don't see a problem with it. Maybe we should start a poll?
Offline kevglass

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #45 - Posted 2005-01-18 13:45:35 »

Updated the links above. I think a poll might be a good plan. I was in two minds:

Pro: Multiple games means you'll get more entries, more fun, stimulates the community...

Con: Means you'll get lots and lots of entries to judge and quality may drop down a bit?

Kev

Offline jbanes

JGO Coder


Projects: 1


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


« Reply #46 - Posted 2005-01-18 14:10:07 »

Personally, I see nothing wrong with multiple games. For many coders, this is their first year entering the 4K competition. Thus they may need to code a game or two to "get a feel" for what they can fit. I remember that the first year, I only used runtime generated graphics since I figured that pixmaps would be too costly. That first entry gave me a good feel for things, and the next year I came up with my SuperPack method for storing images.

Again, I felt that only bitmaps (1 bit == 1 pixel) could ever possibly fit. Yet my experience from that translated into this year's SuperPackME tools with support for up to 255 colors! (Sadly, they don't seem to be very popular. *sniff* Oh well, just means that I'll trounce everyone. ;-))

The only downside I see to multiple entries is that it makes judging that much more difficult. Still, judging only happens once, so I think the judge(s) can live with sorting through a few extra games. :-)

Speaking of which, does anyone else think that we should appoint a panel of judges instead of picking just one? The combined score from, say, three of them would help remove any unconscious bias that a given judge might have. I'm thinking that maybe ChrisM would make a good judge if we can finagle him into it. :-) BlahBlahBlahh would make another excellent judge (if not a little... ok, a  lot... cynical). Any other ideas for judges?

I'm thinking that the games should then be judged on the following criteria:

1. Graphics (points: 0-10)
2. Gameplay (points: 0-10)
3. Sound (points: 0-5)
4. Self Executing [i.e. java -jar] (points: 0 or 1)
5. Music (points: 0 or 5)

That gives a maximum score of 31 points. Items 3-5 will only be awarded if those features exist. For music, I figured that anyone who could actually fit it should get a large bonus. :-)

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

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #47 - Posted 2005-01-18 14:16:52 »

Its a good break down (especially the music bonus) - after looking carefully at your points break down.

Kev

Offline woogley
« Reply #48 - Posted 2005-01-18 15:55:58 »

The judging bonuses look pretty good, and I agree that ChrisM would be a great judge.

kev your links work for me now, so I'll update the list in a little while Tongue
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #49 - Posted 2005-01-18 16:39:58 »

Very nice site woogley. I saw two of my games on the unofficial list. I guess I should go ahead and let them be official, assuming that I can continue developing them.

The games would be Slalom and Late

http://valhallawebdesign.com/Slalom/
http://valhallawebdesign.com/Slalom/Slalom.jnlp
http://valhallawebdesign.com/Slalom/s.jar
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Announcements;action=display;num=1106049623

http://valhallawebdesign.com/Late/
http://valhallawebdesign.com/Late/Late.jnlp
http://valhallawebdesign.com/Late/l.jar
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Announcements;action=display;num=1105724937

Should be enough of links I hope Tongue

Points seems quite OK. Only thing I can think of "replay points". Quite often, java games are something you only play once.  It could naturally be baked into gameplay. Would be nice to promote games that you would actually come back to. Hard to judge, but just a thought.

Offline woogley
« Reply #50 - Posted 2005-01-18 17:14:42 »

Quote
Very nice site woogley.

Thank you Smiley

I will add your games to the list when your server comes online again.

Quote

Only thing I can think of "replay points". Quite often, java games are something you only play once.  It could naturally be baked into gameplay. Would be nice to promote games that you would actually come back to. Hard to judge, but just a thought.


This is a very good idea! Cheesy
Offline jbanes

JGO Coder


Projects: 1


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


« Reply #51 - Posted 2005-01-18 17:29:12 »

I'm glad you guys like the judging system. The real thanks goes to mlk, though, for inventing most of it for last year's competition. I just "embraced and extended" it to better reflect the growing popularity of the competition. :-)

Quote
Points seems quite OK. Only thing I can think of "replay points". Quite often, java games are something you only play once.  It could naturally be baked into gameplay. Would be nice to promote games that you would actually come back to.


Actually, I think that's very much a part of "gameplay". If the gameplay is good, then you'll come back. If the gameplay is poor, then you'll be less likely to play again. Note that this is independent of the graphics score which merely judges how technically impressive the game is.

Here's a few other scoring system I considered:

- A "controls" score (i.e. how natural are the game controls). I discounted this because it heavily impacts gameplay, and thus cannot be considered a separate entity.

- An "instructions" score. I discounted this because the small size doesn't provide much space for text. If the text is there, then it's almost certainly at the expense of something else. I figured that it would be best to leave instructions to the "Readme" files, where they can be spun with fun and interesting stories. :-)

- A 3D bonus. 3D is nice, but it can easily detract from the point: making a game. So if the programmer wants to use 3D as his canvas, he can do so, but he won't get any special bonuses for it. He may, however, get a higher Graphics score. :-)

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

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #52 - Posted 2005-01-18 17:50:59 »

Yes, very nice site woogley.

I like the scoring system as well.  And a 3d bonus would be cool.  After working for 2 weeks I have a rotating model in 4k.  Wow, how am I going to squish a game in there...
Offline jbanes

JGO Coder


Projects: 1


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


« Reply #53 - Posted 2005-01-18 17:59:05 »

Quote
I like the scoring system as well.  And a 3d bonus would be cool.  After working for 2 weeks I have a rotating model in 4k.  Wow, how am I going to squish a game in there...


Are you using the Math.xxx methods? If so, I may be able to help you cut down on the size of your class. It just so happens I have some code lying around for Taylor Series computations of sines and the Babylonian method for square roots. If you use these to compute lookup tables, you can significantly reduce your code size by eliminating the overhead of method calls. :-)

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

Junior Member




Muppet!


« Reply #54 - Posted 2005-01-18 23:43:15 »

Ooo, make my 3D engine smaller, please... Grin

Judging, I like the idea of having multiply judges.  
Quote

1. Graphics (points: 0-10)
2. Gameplay (points: 0-10)
3. Sound (points: 0-5)
4. Self Executing [i.e. java -jar] (points: 0 or 1)  
5. Music (points: 0 or 5)

I like.

Bonuses, last year I gave them out to anyone I felt deserved it. I think stating what they should be before hand takes the fun away Smiley


Offline mlk

Junior Member




Muppet!


« Reply #55 - Posted 2005-01-19 00:00:17 »

Re: only one game, well last year some people entered multiply games. I really don't see the problem with it. More stuff to play while board at work, err wait, as I'm currently looking for work, that might be best if I don't mention I just play games at work. No no no, not at all, never play games at work...

Offline jbanes

JGO Coder


Projects: 1


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


« Reply #56 - Posted 2005-01-19 00:45:05 »

Quote
Ooo, make my 3D engine smaller, please... Grin


I'll see what I can do. :-) Here's the Babylonian method for square roots:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public class SquareRoot
{
  public static void main(String[] args)
  {
    double square = Math.abs(Double.parseDouble(args[0]));
    double root = square / 2;
   
    for(int i=0; i<25; i++)
    {
      root = (square/root + root) / 2;
    }  
 
    System.out.println(root);
  }
}


Note that the precision increases or decreases based on the number of iterations.

Here's the Taylor series implementation of sines:

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  
79  
public class Taylor
{
  private static int[] sineSeries = {3, 5, 7, 9, 11, 13, 15, 17};
  private static int[] cosineSeries = {2, 4, 6, 8, 10, 12, 14, 16};
 
  private static double getAngle(double angle)
  {
    boolean sign = (angle >= 0.0);
 
    if(!sign) angle *= -1;
 
    while(angle > 180.0)  
    {
      angle -= 180.0;
      sign = !sign;
    }
 
    while(angle < -180.0)  
    {
      angle -= 180.0;
      sign = !sign;
    }
 
    if(sign) return angle;
    else return -angle;
  }
 
  private static double normalizeAngle(double angle)
  {
    boolean sign = (angle >= 0.0);
 
    if(!sign) angle *= -1;
 
    while(angle > Math.PI || angle < -Math.PI)
    {
      angle -= Math.PI;
      sign = !sign;
    }
 
    if(sign) return angle;
    else return -angle;
  }
 
  public static double sin(double angle)
  {
    double sine = angle;
    double iteration;
 
    for(int i=0; i<sineSeries.length; i++)
    {
      iteration = (Math.pow(angle, sineSeries[i]) / factoral(sineSeries[i])) ;
 
      if(i%2 == 1) sine += iteration;
      else sine -= iteration;
    }
   
    return sine;
  }
 
  public static void main(String[] args)
  {
    double angle = Double.parseDouble(args[0]);
    double radians = normalizeAngle(angle / 180 * Math.PI);
 
    System.out.println("Sine: "+sin(radians));
  }
 
  private static int factoral(int number)
  {
    int result = 1;
 
    for(int i=0; i<number; i++)
    {
      result *= i+1;
    }
 
    return result;
  }
}



That one would need some finessing for 4K. I was originally developing a Math.sin() implementation for a CLDC library, so it's designed to handle any and all input. (No matter how screwy.) Things that you can do to shrink it are:

1. Inline everything.
2. Eliminate the check for negative angles.
3. Replace Math.pow() with a loop.
4. Eliminate the normalization of the angles. That's to handle angles greater than 360 degrees.
5. Replace Math.PI with 3.14xxxxx (how ever many digits you want.)
6. That makes the radian conversion "angle / 180 * 3.14". Alternatively, use radians to begin with.
7. Instead of storing the taylor series values in an array, use a loop like "for(int i=3; i<17; i+=2);"
8. As with the square root, the number of iterations affects the precision. It may be more efficient to unroll the whole damn loop into 3 operations (two additions and one subtraction). That should give plenty of precision for what you're doing.

Other things to keep in mind:

1. Cosine is equal to sin(angle+90)
2. Tangent is equal to sin(angle)/cosine(angle)
3. Generate lookup tables! While code is generally cheaper than method calls, you can easily destroy your savings by including to much redundant code!

If you're unfamiliar with the two methods above, I may suggest visiting Wikipedia and looking up "Taylor Series", "Series Definitions of Sines" and "Square Root". If you have completely forgotten about factorials (like me), you might also want to look those up. Let me know if you have any questions. :-)


Quote
Bonuses, last year I gave them out to anyone I felt deserved it. I think stating what they should be before hand takes the fun away Smiley


True. But the competiton has gotten a lot bigger. How do such bonuses work when there are multiple judges? Do they have to agree on a bonus, are bonuses cumulative across judges, and what if judges disagree about what should get a bonus? Stating them up front makes things a bit easier. Anything truly spectacular is bound to get a really good score. :-)

However, I would like to see comments from judges. It's always nice to hear both their praise and their constructive criticism. :-)

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

JGO Coder


Projects: 2


Fire at will


« Reply #57 - Posted 2005-01-19 10:55:42 »

What about a bonus for cross platform compatability, after all that's a big advantage of java?  It is a shame that so many entrants don't work on OS X, and that there isn't a high resolution timer in 1.4 that we can use (normally I use LWJGL for this) Sad

1.4 compatability is costly bytewise, so a bonus would be nice Smiley

Will.

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #58 - Posted 2005-01-19 12:04:38 »

Quote

True. But the competiton has gotten a lot bigger. How do such bonuses work when there are multiple judges?


Standard approach is that each judge gets to assign each bonus once, assuming the bonus types are decided on in advance, e.g. 1x cross-platform, 1 x coolness.

If the bonuses are secret, just give each judge "3 bonuses of your choice to assign".

Quote

Do they have to agree on a bonus


Generally, no - too much hassle.

Bonuses are inherently subjective. Anything voted on isn't a bonus, it's automatically part of the main criteria! Smiley

Quote

, are bonuses cumulative across judges


Yes, but you make sure their sizes are inversly proportional to the number of judges, for obvious reasons Wink

Quote

, and what if judges disagree about what should get a bonus?


Each judge has absolute discretion, normally.

PS I'd be happy to be a judge. I've run competitions before with up to 12 judges (!) and have a pretty good idea how to deal with most of the issues that might come up.

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

JGO Coder


Projects: 2


Fire at will


« Reply #59 - Posted 2005-01-20 05:09:38 »

any opinions on what is the best compression algo for class files?

I'm using bz2 which compresses them to 65% of their original size.  Anyone getting anything better?

Will.

Pages: 1 [2] 3 4 ... 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.

CogWheelz (17 views)
2014-07-30 21:08:39

Riven (23 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

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

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
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!