How can I get a JME game working in a browser, like the .io games?

Hi,

I am looking to put a jMonkeyEngine game I am developing into the browser. If you look at http://agar.io or http://diep.io for example, you simply visit the webpage and the game starts. What is the recommended way to do this with jMonkeyEngine?

I have looked into applets, however there seems to be no clear instructions for them (and they are deprecated and will be removed in java 9?). I tried experimenting with java webstart, but when my browser visits MyGame the browser simply tries to download the file rather than actually doing anything.

In other words, anything pointing my in the right direction and giving me a few basic instructions would be great.

Thanks,
Joe

Applets are pretty much thing of the past. If you’d like to develop for browser, I’d suggest html5 and js.

3 Likes

Yeah,applets have been recently deprecated. You should focus on new HTML5 technologies.

1 Like

Okay, but that doesn’t help me to actually solve the problem I have, of getting a JME game working in the browser. Could you be a bit more specific on how “new html5 technologies” will get a JME game working in the browser?

Even something like pressing a button in a browser and having it open up an OpenGL window would not be a bad second-best.

You can try Java Web Start Java Web Start - Wikipedia but it does not run directly in the browser. Otherwise, you can put a download link for your jme app and let the user download it and run in.

Btw, agar.io uses html5 and js. So if you’d like to create games like that you got to switch technologies.

Currently there is no way to use JME to develop browser applications. Webstart is only way to go as far as I know if it’s not yet deprecated as well. And webstart basically is “browser downloads file and then starts it outside the browser”.

Short answer is: you can’t with jme.
Long answer… There might be ways to do it with gwt, but it’s far from straight forward and you’d spend more time on the pipeline than on the game itself.

If it’s really what you need, maybe you should look into libgdx, that can be deployed as a web app.

Else there are js 3d engines like three.js. You can also look open scene graph that has a js port (osgjs) but doesn’t have any rendering facilities.

2 Likes

Hm. Not good. :frowning

So. Webstart. How do I get that to work? As I said, MyGame just tries to download the file rather than running anything.

http://endcraft.net/Planes/launch.html

This is HTML code created by JME. But when I click it, it tries to download the file and not run it? :frowning:

I think you should give GWT aan try.

It looks like it’s a mature project.

This is the link:
http://www.gwtproject.org/?csw=1

1 Like

I recently found about http://www.jpro.io/
It may be possible through JME-JFX , idk :rolling_eyes:

Well… Mature is a weird term for gwt. It’s been very used for web apps like 5 or 6 years ago but now it’s kind of a dying project…
It was made by Google but they handed the project to the community when they started to focus on angularjs… Since then the cool kids lost interest… But still a pretty solid technology IMO.

Have spent hours on webstart/applets but at the end of the day they all need to be signed, and I can’t do that.

Evidently, GWT does not seem to be portable to from jMonkeyEngine, so it’s pretty much useless to me. :confused:

Plus, these are a dead-end as they both require Java enabled on the browser which not many people do anymore.

Otherwise, self-signing webstart apps is not hard just for testing.

Only for testing. JVM nowadays require trusted signing to run without adding website into exception list. And it is not for free afaik.
It is easier to use HTML5 + JavaScript… There are some open-source libraries. And it is fast and simple

Java web view killer’s face

1 Like

Yea but it is not JME. :frowning:

How do I self-sign them? And, how can I get them signed by other people (even if it costs)?

https://i.gyazo.com/0351257481fd93a73f557224abdb2149.png Go to project properties and try this (I don’t tried it with JME, but with JavaFX it worked. I think there is no difference).

Signing Applets Using RSA Signed Certificates It says "RSA certificates may be purchased from a Certificate Authority
(CA) that supports RSA, such as VeriSign and Thawte. " . But I have never tried by myself.

And a big part of that is that both chrome and edge (now standard for new windows installations) do not support Java in the browser at all.

The skinny is that applets and webstart are the worst parts of java. They caused so much security issues, that they should be disabled. I was surprised that they latest as long as the did.

These days most browsers support is far more consistent form of js+otherstuff all now under the html5 banner. For browser games, its the way to go. Right tool for the job. jME is great but not for browser games. There are some good game libs /“engines” for js as well. Well at least the last time i looked around.

Oh and many of my unity friends have found out how poorly doing anything but direct html5/js works for browser. Basically unity games can cross build, but in practice it doesn’t work that well.