Picking right technologies for a web-game

I am thinking of making a web-game in java and javascript, but I don’t know which technologies should I use for this project. This is mainly because I don’t know about many technologies that could be usefull for me.

The game is going to be 2D turn based multiplayer strategy. I want to have a database for users, items. I am also thinking of using distribued computing.

So far I was considering using Hibernate and Spring data for database access. I am also considering using Spring web services and Spring integration. However I don’t know where to go next.

My main goal is to create a web-app, that uses all the modern technologies and works very well. I am not asking you to create whole architecture, but only technologies that you recommend. However you can give us your ideas about architecture if you wish so.

Hi

J2EE is not used for games as far as I know. Why not using an applet for the client? Slick (LWJGL) or JGame (JogAmp) for 2D with hardware acceleration? HTTP requests and MySQL? Paul Lamb Sound Library for the sound?

Plenty of games using j2ee on the backend, and if you’re familiar with Spring and Hibernate then there’s nothing wrong with them as choices. I don’t understand how ‘distributed computing’ would fit in though, unless you’re using a very broad definition.

Depending on your game your client could just be vanilla html, html+javascript or a java applet (or flash, or any number of other options…). Pick whichever one you’re most comfortable with.

Although if this is your first game then starting off with a turn based multiplayer game sounds like you’ll be overreaching yourself somewhat. Perhaps start by making a prototype turn based game that’s entirely client side first to get a feel for the mechanics and how you want it to work?

Which ones? Do you have at least one example? I have nothing against J2EE but I know zero example of game using it.

I have already programmed it a bit as an applet, but I did not like the results. Applet seem to me as very outdated technology for web applications.

I am intersted in solution using j2ee technologies because I want to improve in this area as well.

Applets are not outdated. Their support is perfectible but it has been improved. Moreover, up to date or fashionable != mature and reliable. WebGL is a recent technology but it is still unreliable. Some days ago, I tried to run an application using WebGL with the latest stable version of Firefox, native-gl=true, a nice NVIDIA QuadroFX with the latest driver, I only got a pretty black screen. Applets and Java Web Start are more mature, more reliable and more crossplatform than HTML5 + Javascript.

J2EE could be used for a turn based game but maybe it is just too much for your needs. I used RMI for a 2D fighting game some years ago, I’m still not sure it was a good idea.

Well I did the backend for Albion as a j2ee app on top of google app engine, so there’s that. I’ve also worked on one console game who’s servers were entirely j2ee based, and know of a couple of other backends for (console) games that are j2ee but I probably shouldn’t name names. :persecutioncomplex: I suspect a j2ee login / matchmaking server is lurking behind a lot more games than you realise.

Mr Proper: if you’re not keep on applets, have you tried html canvas? Depending on what’s going on in your game it could be a good fit.

[quote=“gouessej,post:6,topic:39044”]
Sadly there is some truth to Java Applets being an outdated client side tech if you consider the number of recent problems and hoops that users have to jump through just to use them.

They are also not more cross platform then HTML5 + WebGL (WebGL is a core part of major browsers like Chrome, Firefox, Opera, etc). WebGL has come a long way since its introduction and the javascript engines are getting faster and more impressive all the time. Some implementation even have Direct3D and software backends for even more compatibility and work on stuff like tablets and smartphones (unlike java applets).

There is a general shift towards getting rid of browser plugins all together (as seen with the introduction of Metro and continually with Apple products). The reasons for this shift are pretty strong e.g. plugins are an additional security risks as they provide another avenue of attack (as seen by the recent drive by attacks), require additional maintenance from user, they usually have a closed source nature, etc.

A good option these days is to use a java library like LibGDX or PlayN, that way you can easily target multiple deployment methods including WebGL, Java Applet, iOS, etc.

I spoke about Java Web Start too and the latest problem with it in Google Chrome has been mostly solved. I’m not a big fan of applets but I have been very disappointed by WebGL, most of my attempts of trying some demos using it almost always fail even with nice hardware and an up to date web browser. There are still some problems with applets but WebGL is not mature enough anyway.

I read a French article some days ago that tends to prove that performances of WebGL are horrible on smartphones. WebGL is not yet as cross platform as you pretend as I get a black screen with several major web browsers including Mozilla Firefox and Google Chromium. If it is noticeably slower than native or Java applications or if it simply doesn’t work, it’s not very useful yet. When this technology is more mature, it will be enough for lots of 3d projects but I don’t expect it from completely replacing all heavy clients based on Java and OpenGL.

When trying to play Java applets I get a white screen on both my Macs (iMac 10.6.6 and a relatively new Macbook Air, Chrome on both). Applets have also given me woes on my old Windows Vista laptop, and of course don’t seem to work at any public library/school/etc. On the other hand, most of the HTML5/WebGL demos have worked flawlessly.

Generally speaking, the more the merrier – you should try to support applets, HTML5 canvas, WebGL and even Flash. But since you’re working on a multiplayer game, maybe a single platform (i.e. applets only, or WebGL only) would be better.

try any of the “WebGL” links on this site: http://libgdx.badlogicgames.com/documentation.html

Let me know if none of them work for you.

I will also vote for html5. It’s not like that applet is really that bad but what Kappa said is true. PlayN is good choice, although never try it with other lib like Slick.

I get this for Super Jumper + black screen:

[quote]GwtApplication: exception: (TypeError): zl.c.setVolume is not a function
stack: Kn([object Object])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1083
xb([object Object])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1055
Bb()@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1087
Td([object Object],[object Object],10,[object Object])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:977
je([object Object],[object HTMLImageElement])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:752
Rd([object Event])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1087
([object Event])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:838

fileName: http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html
lineNumber: 1083
(TypeError): zl.c.setVolume is not a function
stack: Kn([object Object])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1083
xb([object Object])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1055
Bb()@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1087
Td([object Object],[object Object],10,[object Object])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:977
je([object Object],[object HTMLImageElement])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:752
Rd([object Event])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:1087
([object Event])@http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html:838

fileName: http://libgdx.badlogicgames.com/downloads/demos/superjumper/com.badlogicgames.superjumper.SuperJumperGwt/1163A8EE170D9058D53DDD240386C126.cache.html
lineNumber: 1083
[/quote]
Vector Pinball works but it is quite slow.

GDX Invader gives this + black screen:

[quote]GwtApplication: exception: (TypeError): a.c.play is not a function
stack: Ed([object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:550
Zl([object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:799
zb([object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:1062
Db()@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:1104
ke([object Object],[object Object],21,[object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:990
Ce([object Object],[object HTMLImageElement])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:747
ge([object Event])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:1104
([object Event])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:883

fileName: http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html
lineNumber: 550
(TypeError): a.c.play is not a function
stack: Ed([object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:550
Zl([object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:799
zb([object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:1062
Db()@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:1104
ke([object Object],[object Object],21,[object Object])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:990
Ce([object Object],[object HTMLImageElement])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:747
ge([object Event])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:1104
([object Event])@http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html:883

fileName: http://libgdx.badlogicgames.com/downloads/demos/gdxinvaders/com.badlogic.gdxinvaders.GdxInvadersGwt/3D4017E8F384A089D236F2E7F15B6641.cache.html
lineNumber: 550
[/quote]
Backyard Pirates only gives me a black screen.

I use Mozilla Firefox ESR 10.0.4 at home.

Sorry, WebGL doesn’t work flawlessly, keep it in mind. Java Web Start is more reliable than WebGL.

Cool, thanks for testing. Agreed, WebGL isn’t were it should be yet. Chrome seems to give the best results on all platforms, followed by Firefox, followed by Safari.

The demos actually require Flash to run (except the Vector Pinball demo). It looks like that’s what you are missing.

Vector Pinball runs pretty well even on my EEE PC. In Chrome though, Firefox’s JS VM is pretty slow :confused:

I tested WebGL demos, not Flash demos. Secondly, I use Gnash as Adobe Flash doesn’t work anymore on my machines (I’m unable to use Youtube with Adobe Flash).