Kongregate

Good news everyone!



I’m making a game that I plan to put on Kongregate.



However, I would like to be able to implement their APIs effectively, particularly I’d like to be able to access the statistics and users and such.



To do so, one would need to pass in the API object from javascript…

Now, I know you can pass in some things to jmonkey from javascript as that is how a jmonkey applet runs.



[java]<!-- ***************************************************** -->

<!-- Copy this section into your website to use the applet -->

<!-- ***************************************************** -->

<script src=“http://www.java.com/js/deployJava.js”></script>

<script>

var attributes = {code:‘org.lwjgl.util.applet.AppletLoader’,

archive:‘lwjgl_util_applet.jar, lzma.jar’,

codebase:’.’,

width:640, height:480};

var parameters =

{

AppClass:‘mygame.Main’,

al_title:‘MyGame’,

al_main:‘com.jme3.app.AppletHarness’,

al_logo:’’,

al_progressbar:‘appletprogress.gif’,

al_jars:‘code.jar, data.jar, lwjgl.jar.pack.lzma’,

al_windows:‘windows_natives.jar.lzma’,

al_linux:‘linux_natives.jar.lzma’,

al_mac:‘macosx_natives.jar.lzma’,

al_solaris:‘solaris_natives.jar.lzma’,

separate_jvm:‘true’,

boxborder:‘false’,

centerimage:‘true’,

image:’’,

java_arguments:’-Dsun.java2d.noddraw=true -Dsun.awt.noerasebackground=true -Dsun.java2d.d3d=false -Dsun.java2d.opengl=false -Dsun.java2d.pmoffscreen=false’

};

var version = ‘1.5’ ;

deployJava.runApplet(attributes, parameters, version);

</script>

<!-- ***************************************************** -->

<!-- ***************************************************** -->

[/java]



Here is what you get from Kongregate in their most java-friendly api version, the javascript one:

http://developers.kongregate.com/docs/api-overview/client-api







So basically somehow that API object needs to be accessed by Jmonkey. Any ideas on how this can be done?



I already posted a Jmonkey applet up on there using an iframe, and that worked fine, however, to really stand out on Kongregate you need Kongregate badges, which require implementation of their statistics API.



If I could get a decent jmonkey game on Kongregate it would probably be favorable publicity for JME and Java for games in general (which seems to me to currently have a bad rap) with a few notable exceptions like Runescape.

1 Like

Oh, 2 important things I forgot!


  1. Here’s the link to the applet: Play Test, a free online game on Kongregate


  2. Is this the best part of the forum to have posted this sort of thing?

Read this: Java games discussion on Kongregate

And the posts from Markus Persson (developer of minecraft) here: http://www.java-gaming.org/index.php?topic=21718.0



In short: Kongregate does not support Java.

@polygnome said:
Read this: http://www.kongregate.com/forums/7/topics/107648
And the posts from Markus Persson (developer of minecraft) here: http://www.java-gaming.org/index.php?topic=21718.0

In short: Kongregate does not support Java.


That information is very outdated. To demonstrate, click the link in my previous post, where you will see I have a Jmonkey applet on Kongregate already. Please excuse the uglyness of the formatting and simplicity of the content. I just threw it on there to verify that it could be done.

@valentiinro said:
Oh, 2 important things I forgot!

1) Here's the link to the applet: http://www.kongregate.com/games/Valentiinro/test_preview?guest_access_key=8370e5d3f73de5204b886226b7be4a1d17962ce8e1c47da5224c98632a06fdbd

2) Is this the best part of the forum to have posted this sort of thing?


However, I do appreciate your looking for information, the second link does have some useful information in it about putting applets in browsers effectively.

Oh crap, I may have just answered my own question. I’ll need to do some research, but here is something that seems very related:

http://docs.oracle.com/javase/tutorial/deployment/applet/invokingJavaScriptFromApplet.html

@valentiinro said:
That information is very outdated.

Yeah, i feared that, but there isn't much information available at all.

Cool! Do badges etc… work too?

@memonick said:
Cool! Do badges etc... work too?


I haven't yet tested the statistics, as I don't have a playable game right now, but one of the first steps of a project should be feasibility testing, which is why I am trying to find this out now before I make the game in jmonkey.

However, judging from the last thing I posted about accessing javascript from inside an applet, it looks like the statistics API could work.

To get badges for a game you need a rating around 4 or higher for your game, and a functioning statistics API. Once I've run some tests that the statistics api can work, the next step is making a game that people will rate 4 or 5. If your game has statistics and a 3.75-5.00 rating, Kongregate will usually make badges for you. You can not make them yourself as a developer.

The question is, can Jmonkey produce a game people will rate 4 or 5 stars. The answer may be yes, however, it does have distribution problems on older computers with OpenGL less than 2. If they can not play the game, then they will probably rate it 1, which will screw with the ratings and thus prevent one from getting badges.

i think you are paranoid, 99% of the people will have opengl 2+.

I dont think that some 90 year old grandma that has no knowledge of computers,

will come to kongregate to play your game.

@valentiinro said:
however, it does have distribution problems on older computers with OpenGL less than 2. If they can not play the game, then they will probably rate it 1, which will screw with the ratings and thus prevent one from getting badges.


Make sure your prerequisites are CLEARLY stated. That is YOUR responsibility. If you advertize your game as working on everything and that's not the case, you will get flak for it. If someone rages because he was too dumb to read, that's not your fault and you will most likely not suffer from a down voting spree.
@tralala said:
i think you are paranoid, 99% of the people will have opengl 2+.
I dont think that some 90 year old grandma that has no knowledge of computers,
will come to kongregate to play your game.


I've done research on this subject, and among my friends, the number of people who had issues with running jmonkey programs was closer to 10% than 1%. I am not sure what it would be like on Kongregate.

@madjack said:
Make sure your prerequisites are CLEARLY stated. That is YOUR responsibility. If you advertize your game as working on everything and that's not the case, you will get flak for it. If someone rages because he was too dumb to read, that's not your fault and you will most likely not suffer from a down voting spree.


I do plan to clearly state them with a warning screen written in something EVERYONE will be able to see. Maybe a simple HTML form with a cool background image from the game or something.

I am just worried that people will be idiots and downvote it because they can't play it regardless of if the requirements are clearly stated in both the description, first screen you see in the game, and anywhere else information is displayed about it. People are jerks sometimes.
@valentiinro said:
I've done research on this subject, and among my friends, the number of people who had issues with running jmonkey programs was closer to 10% than 1%. I am not sure what it would be like on Kongregate.



I do plan to clearly state them with a warning screen written in something EVERYONE will be able to see. Maybe a simple HTML form with a cool background image from the game or something.

I am just worried that people will be idiots and downvote it because they can't play it regardless of if the requirements are clearly stated in both the description, first screen you see in the game, and anywhere else information is displayed about it. People are jerks sometimes.


You could try to do a trace on those. You could try to see if they have support for OpenGL 2, and if they don't, record the user information (IP/Username) and present to Kongregate later, if they downvote you.

10% run into trouble with JMonkey because sometimes they have a different Java installation, like Java 1.5 on Mac, OpenJDK on Ubuntu users. I've seen a solution to this, that is to put a running JRE in the software distributuin for Mac/Windows/Ubuntu users, as they are more propense to have problems with this. But you can't do this :/
@shirkit said:
You could try to do a trace on those. You could try to see if they have support for OpenGL 2, and if they don't, record the user information (IP/Username) and present to Kongregate later, if they downvote you.

10% run into trouble with JMonkey because sometimes they have a different Java installation, like Java 1.5 on Mac, OpenJDK on Ubuntu users. I've seen a solution to this, that is to put a running JRE in the software distributuin for Mac/Windows/Ubuntu users, as they are more propense to have problems with this. But you can't do this :/


Hmm, that's a good idea. I wonder what Kongregate would think of that. It would be pretty easy to record their usernames when they have a low java level or open gl level. Might be a little hard to parse though. Last time I tried to parse that diagnostic information I got a mess.

Oh, plus then there would be solid statistics on the subject, which would be nice to have.