Need an HTML5 game engine

Hey Everyone,

I may be starting on a new project at work where we are converting an older 2D board game from C++ to HTML5. Issue is I'm not entirely sure which game engine should be used as there are so many out there. ImpactJS is one I've seen. Any other suggestions?

Requirements would be some kind of animation support, strong preference for open source, real-time multiplayer support (oauth login, game lobby).

As far as I was aware HTML on its own is not useful. You need to use javascrip or python with it.

Yeah I thought it was implied that I would need a javascript library. I may also need to look at hosting some of the game server side which could involve PHP or a NodeJS backend.

Well thats not all true, but yes, you need java script to get logic, but HTML 5 has a lot of ability compared to html 4, you can have audio now and some more visual stuff, but to be perfectly honest with you @step1041 just rebuild it from the ground up, I have never heard of a compiler that can take c++ to html5 and javascript, so just rebuild, and take the assets from the game and just rewrite it to work on a website, done, unless your doing this for a chrome app, then that changes the game

My plan was to rebuild completely by adapting the existing C++ code to Javascript. Choosing a game engine in Javascript is what I'm after. I've used the HTML5 canvas in the past, but it was a manual process without a simplified game engine to manage things.

It's more useful then you might think, here's a game made with nothing but css and html : http://victordarras.fr/cssgame/
I'm sure a text adventure game would be entirely possible.

If you really want to reuse your C++ code, I would suggest refactoring it to use a client/server model, with the game logic on the server side. Then the server component would be a good start for your backend.

As per your original question, I think a "game engine" is a bit of a hefty solution unless you need collision detection, which you probably don't in a board game. It sounds like what you really need is an animation library. User input events are already handled very well in plain JavaScript.

I'm not too sure about multiplayer support with the following engines, but they are all solid options.

Impact - http://impactjs.com/
A great overall engine that's very extendable, but is quite expensive.

Phaser - http://phaser.io/
One of the most popular engines at the moment, and its open source!

MelonJS - http://melonjs.org/
Kinda like a free, open source alternative to Impact.

Panda - http://www.pandajs.net/
Another full featured, open source engine.

1 Like

I did not know that HTML 5 was capable of functional programming.

As a JavaScript developer, I've used this one in couple of small projects, and it's just awesome, they have guidelines and nice documentation that you can dig into! Be aware that this one is more closer to me because it's 'JavaSciptish' nature if you'd like to code in something lower level I'd recommend Cocos2D

1 Like

I'll definitely give this one a shot. Doesn't look like it has much for multiplayer though. That may need to be custom regardless.

One thing that is also a bit of a concern may be theft of the game. With Javascript and the way I see these games being programmed, they are all run client side which can be copied easily. Not many game engines seem to have the ability to have some server side code unless its custom programmed in. Ideally I would program this game so it renders graphics and handles all input and output through javascript which can then be sent server side to manage scores, moves, player statuses etc. This also prevents cheating in some way. Although for a multiplayer online game there would have to be server side code to manage all of this so I kind of just answered my own question. Point being that there doesn't seem to be any HTML5/Javascript engines that deal with server and client side code to manage online games. I may just need to do more research but I thought I would ask here to see what is the 'hip' way to do this type of game now due to the constant changing of the web. It seems like every day there is some new Javascript library _____JS or ____.io etc.

I may be entirely wrong about that, but that's how I see it now.

indeed, one of the disadvantages to JavaScript is that your source code is public. unfortunately, there is no perfect way of hiding your code. but there are methods that can help!

Minification simply compresses your code, which makes it harder to read but is still not a very good method of protecting your code on its own.

Another better method for obscuring your code is obfuscating it. which is a simple way to help hide your source code.

and finally there are services i have seen like jscrambler which are designed to try and protect your code.

again none of these methods are perfect due to the nature of JavaScript, but they might be tools that you want to look into if you need to protect your code.

Seems like the best thing is to use something like socket.io and keep as much code on the server as possible and use the client for input/output from the user and graphics rendering. Issue is that I'm not aware of any easy to use libraries that simplify that.

not sure if youre still looking but this is pretty new http://superpowers-html5.com/index.en.html

Hasn't came out yet but I've seen the backend for this and it's pretty awesome: http://overworld.io/

I have used Phaser in the past when I was helping some friendly Canadians with a project. Easy to use and pretty powerful. It is also available as a node package.

1 Like

Necro

@moderators