Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
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  
  Rule Check - Highscore Tables  (Read 3717 times)
0 Members and 1 Guest are viewing this topic.
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2010-12-07 11:07:45 »

If I add a high score table (doubt I'll have room) does the PHP/JSP that provides the highscore server have to be part of the 4k?

Kev

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #1 - Posted 2010-12-07 11:26:46 »

I like the idea that we should allow games to submit highscores, however we should have a rule that no data should be allowed to be transferred back to the game (other then confirmation of submission).

Maybe Java4k.com could provide a API.
Offline SquashMonster

Senior Member


Medals: 1
Projects: 2



« Reply #2 - Posted 2010-12-07 12:55:46 »

As I understand the rules, you are only allowed to do client/server stuff if both sides are Java programs that fit inside the same 4k.  So you would have to give your program multiple entrances or multiple class files, and somehow fit the overhead from that, the overhead from network calls and your actual highscore logic into the 4k.  At which point it seems wasteful to spend so much room and not be making a game that's primarily about some client/server interaction.

All of which is a shame.  I would completely support Java4k having an API for this sort of thing, if everyone (especially the people in charge!) was in favour of it.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #3 - Posted 2010-12-07 16:56:07 »

There was once a game called World Rally Driver 4k that did have a highscore list. I think he submitted a game without highscore, but publicly told everyone to try it with a highscore list. (not sure)

You're right, there should be an API for this. I'll talk to jojoh and see if he can quickly provide it.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #4 - Posted 2010-12-07 17:37:44 »

It's a simple matter to do. I could provide a URL for a game to invoke to submit a high score. The highscore table would then be shown on the game's view page on java4k, or I could also have a URL that the game can retrieve in order to show the highscore highscore table ingame as well (or that could be the response to the submit).

Problem is preventing cheating. How can we make this "safe"?


see below:

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #5 - Posted 2010-12-07 17:45:05 »

Another way is for me to supply a jar, imported in the applet html tag, that has one static method that takes care of submitting the score to the server (and possibly returning a result). That method encrypts the data being posted, and server has the key to decrypt. Not bulletproof, but enough to prevent easy cheating.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #6 - Posted 2010-12-07 18:07:16 »

Hey. I was on the verge of suggesting this last year. I think it is a really cool idea, and it makes playing the games much more fun IMO. It does break the pure 4K idea a bit and there will have to be a trade-off between adding more features to the game-play or adding high-score, but in general it will be more fun to play the games. If I recall correctly, we decided to judge Rally Driver without the high-score list. I wonder if we should do that again. It is hard to disregard that feature though.

I was thinking that it could work sort of like mochiads high-scores and the likes does it. That way we could gather name and possibly even display highscore list in a "pop-up" inside the applet (overlay). A dev API could also be provided so that it works offline. On java4k the dev can then check if high-score should be used and what format and ordering should be used.

It makes no sense of doing this unless most of you agree with this though, so speak now or forever hold you peace.

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #7 - Posted 2010-12-07 18:15:55 »

nice, however better to avoid putting a pop-up back into the actual applet as that can get messy, much nicer/simpler to just have a separate php page that displays the scores.

Maybe just make it part of the games description page so the scores are visible below the applet and users can config this when submitting/editing their games 4k page.

As for breaking the 4k rule, it does bend the rule slightly but then everyone has equal access to the feature and technically its just throwing a number at some php script. The games also function totally independent of the highscore system, so the feature can easily be disabled and is just an extra feature for visitors of the site. Also highscores are only useful for certain types of games so not everyone will want to use it and can safely ignore it.
Offline pjt33
« Reply #8 - Posted 2010-12-07 19:54:35 »

That way we could gather name and possibly even display highscore list in a "pop-up" inside the applet (overlay).
Given that most people use active rendering and don't do it by implementing paint / paintComponent this could be a bit tricky. I suppose that if you supply a java.awt.Image that's probably compatible with most people's frameworks, but even then there are fairness questions because the method names or NameAndType string pool entries might compress better for some people than for others.
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2010-12-07 20:33:08 »

Active rendering seem to be broken on the lastest mac java anyway.

Kev

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

JGO Kernel


Medals: 42
Projects: 11


Game Engineer


« Reply #10 - Posted 2010-12-07 21:27:23 »

Active rendering seem to be broken on the lastest mac java anyway.

Kev
Yeah, I just checked and I can't play Left 4k Dead anymore.

Suck. Maybe it really will be good when Apple drops Java.

See my work:
OTC Software
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #11 - Posted 2010-12-07 21:43:56 »

Suck. Maybe it really will be good when Apple drops Java.

There's no more AWT/Swing heavyweight components with Apples changes (except for Frame, Window, Dialog, etc), they've changed it all to lightweight so they can for example render it all through OpenGL (or at least thats the plan).

Now with them joining OpenJDK i believe they're planning to donate those changes, so they might find themselves into java on other platforms. However Apple have said work isn't complete yet so it might work in future. So no it won't be good for games (at least initially), these sort of changes have borked performance on libraries like PulpCore and completely broken JOGL/LWJGL applets too.
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #12 - Posted 2010-12-07 22:32:21 »

Ok, tentatively, this will be added as support in the current contest, if there are no objections.

As long as there are no problems, I'll make available a jar (both for development/mocking and production), hopefully tomorrow, although I'll need to test it first.

At least you can make the assumption for your game(s) that this will be supported.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline SquashMonster

Senior Member


Medals: 1
Projects: 2



« Reply #13 - Posted 2010-12-07 23:12:00 »

Will the table be displayed on the game page as HTML, or will we be getting the current table back from the API and expected to render it using game logic?

Also, a suggestion: could the jar have several methods that could do the same thing with different names?  So even though the actual method is something like sendToHighScoreTable(String, int), there are aliases like drawString(String, int, int) that just call the real thing, but allow people to pick whichever one will compress best for their game.
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #14 - Posted 2010-12-07 23:41:00 »

Will the table be displayed on the game page as HTML, or will we be getting the current table back from the API and expected to render it using game logic?

Also, a suggestion: could the jar have several methods that could do the same thing with different names?  So even though the actual method is something like sendToHighScoreTable(String, int), there are aliases like drawString(String, int, int) that just call the real thing, but allow people to pick whichever one will compress best for their game.

The single public static method I'm thinking of having in the API goes something like this:

1  
public static String postScore(String playerName, int score);

Returned value: The resulted highscore table in a csv string, e.g. "name1,score1;name2,score2;...;nameN,scoreN". I thought about returning a List or something like that, but won't it add to size of the game jar?

That way the developer can choose if he wishes to display the highscore in his game, so player won't have to reload the web page to see his position. But this is optional, although offered. And yes, it will be displayed on the page for the games that have enabled highscore feature.

The API identifies the game by using a parameter in the applet tag.

Developer can define the order of the highscore list for his game when he submits the game (or edits it). I can be ordered by score either descending or ascending (lower or higher is better). Number of results on highscore might be either 10 or 20, rest is omitted.



Just what I'm thinking.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #15 - Posted 2010-12-08 01:23:02 »

I had the idea of creating a high score lib to take just the score in a constructor, then applet/image/graphics and returning a boolean for done in an update function. The lib would then take care of getting the user name and displaying the list, so that the impact of adding highscore would be minimal. But if active rendering is not working then it might be problematic, didn't quite follow what the problem was there.

The code change to use highscore would be to create the highscore object and call it each loop until it returns true. Not sure how to handle username input in a 100% reliable way across platforms nowadays especially that works for most types of games, but I am sure that can be handled collectively if it need be. I have to sync with appel tomorrow so that we head in the same direction.

Then again having just a function that takes just name and score is very simple, so that is elegant, but more bytes will be used to gather user name from inside the game, and more effort will have to be made in order to use this feature, so less games will probably use it.

By the way left 4k dead doesn't work on OS X and FF, but fine on Safari and Chrome for me. That could be some specific problem with FF on my machine, since many applets don't work there.

Offline pjt33
« Reply #16 - Posted 2010-12-08 10:06:38 »

In terms of username input, for logged in users you could add a param tag to the applet and then read that in the library.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #17 - Posted 2010-12-08 10:46:54 »

1  
public static String postScore(String playerName, int score);


Such a long method name Smiley
precious bits being wasted in an environment where one letter methods are common Smiley
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #18 - Posted 2010-12-08 12:25:09 »

Really like the idea of using the site login for the username. Would encourage people outside of the 4k community who play to register.

Kev

Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #19 - Posted 2010-12-08 12:51:53 »

In terms of username input, for logged in users you could add a param tag to the applet and then read that in the library.
Yes, that is exactly what I am doing at games4j.com, but the drawback is that you have to be logged in before starting the game. The encouragement to get into the highscore list is not enough for people to go through a registration process in most cases. I plan to add authentication via facebook gmail and the rest to get rid of the whole registration prcess on games4j to see if that works better. We could possibly test that on java4k as well. You also get rid of all the obscenities that are bound to pop up if anyone can type in anything for name, and the whole clientside lib is ready. I could just take the games4j lib and refactor the calls to one letter names. Serverside stuff still remains.

Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #20 - Posted 2010-12-08 13:23:58 »

Really like the idea of using the site login for the username. Would encourage people outside of the 4k community who play to register.

Kev

Problem with that is, they have to be logged in before playing the game.

I think "Type your player name to submit highscore" is the best way.

There will be some penalty in terms of bytes in doing highscore, but I don't think it will be enormous.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #21 - Posted 2010-12-08 13:44:44 »

In that case can we do as described above and have the library pop up a joptionpane instead - can customise the look and feel to fit the site and add all that good stuff (geolocation etc), maybe even add the top 10/5 scores to it.

Kev

Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #22 - Posted 2010-12-08 22:00:46 »

Ok, it's ready and working.

I'm gonna have jojoh peer-review it with me tomorrow before I release it in the open, hard to change afterwards, so better get it right the first time. Then tomorrow night I'll put up the option in the game edit/submit where you can enable this feature, and I'll also publish the jar.

The method is:
1  
public static String[][] p(Applet caller, String name, int score) 

returned is a two dimensional array, list of results, where each row is: 0 = playername, 1 = score
or it returns null on any exception.

The invocation would go something like:

1  
2  
String[][] results = HScore.p(this, "appel", 999);
if(results != null) { ... show results.. } else { ...oops!... }


The reason for applet reference is to retrieve an applet property.


Mocking this will be mostly up to you.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #23 - Posted 2010-12-08 22:03:50 »

In that case can we do as described above and have the library pop up a joptionpane instead - can customise the look and feel to fit the site and add all that good stuff (geolocation etc), maybe even add the top 10/5 scores to it.

Kev

Hmmmm....... need to think about this, but getting too late here now.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #24 - Posted 2010-12-08 23:50:40 »

Have a method in the highscore.jar that calls out to JavaScript with the score. JS would display an animated GIF for a few seconds to get the user's attention and show a submit button. If the user is not logged in it would allow them to specify their name, which could be remembered with a cookie. It would also allow them to specify a password, so we can both accept their high score submission and create a new account in one go. Unregistered users could be annotated in the high score list to differentiate them from real users. Finally, the JS would submit the score via AJAX and refresh the high score table, all without the user leaving the page.

Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #25 - Posted 2010-12-09 00:12:27 »

Have a method in the highscore.jar that calls out to JavaScript with the score. JS would display an animated GIF for a few seconds to get the user's attention and show a submit button. If the user is not logged in it would allow them to specify their name, which could be remembered with a cookie. It would also allow them to specify a password, so we can both accept their high score submission and create a new account in one go. Unregistered users could be annotated in the high score list to differentiate them from real users. Finally, the JS would submit the score via AJAX and refresh the high score table, all without the user leaving the page.
Oh, that's nice. I'll look into that.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #26 - Posted 2010-12-09 18:05:58 »

Yup, that suggestion sounds like it combines the best of all ideas.

Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #27 - Posted 2010-12-09 21:28:24 »

I've decided to expand a bit on the idea, so it won't be ready until by tomorrow or saturday. ty.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #28 - Posted 2010-12-09 22:16:15 »

Yaaay! What do I win? Cheesy

Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #29 - Posted 2010-12-10 01:21:23 »

At my work, if you come up with a good idea... it means that you get to implement it Wink

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.

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

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

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

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
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

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!