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