Sign in to follow this  

What languages should I know for HTML5 game development?

Recommended Posts

As of now I only know a little HTML, CSS, and JavaScript. I am interested in creating an online multiplayer game

using HTML5 that can be played in a browser that will be hosted online 24/7. The game I want to create is fairly

simple, and won't require amazing graphics or anything, because I'll make them myself.

 

My question is, what are all the languages I will need to know, as well as any programs or services, to create the

game and a server to host the game? Keep in mind I don't know much about game development in HTML5.

 

So far, this is what I think I'll need to know:

- HTML5

- CSS3

- JavaScript

- Some server side language like PHP or Python

 

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Technically you can get away with just Javascript but, you'd probably find the HTML and CSS useful.  The server side component can be written using any back end component.  If you already know Javascript you could just go with Node.js.

 

 

Alternatively you can write your game using an engine or middleware that exports to HTML5 (Gamemaker, Construct2 etc..).

Share this post


Link to post
Share on other sites

We don't know anything about the game you are going to be making or any of the limitations associated to this game, before we even get to the technical details.  We also don't know your competences and/or those of your teammates (if any), other than the fact that you dabbled in HTML/CSS/JS.

 

So far, what research have you done, do you plan on making everything from scratch, what's your budget?  

From the details we have right now, one could simply say, make an index.html page and put it on a server somewhere or on your machine and add some JavaScript, and there is your game.

 

Have you tried looking over some of the more popular games, such as how agar.io was made, that might be a good first step.

Share this post


Link to post
Share on other sites

Have you tried looking over some of the more popular games, such as how agar.io was made, that might be a good first step.


One of the biggest mistakes of my life involved agar.io. I didn't really need that job anyway.

Share this post


Link to post
Share on other sites

Dart (https://www.dartlang.org/) is better suited for large web projects than "plain" JS imo, with the added benefit that it runs both on the client and the server, without the need of external libraries (Node.js etc).

There's also Typescript (https://www.typescriptlang.org/), which is similar in that it is more structured than JS, although it won't run on the server natively. I prefer Dart personally.

Edited by papulko

Share this post


Link to post
Share on other sites

Dart is very interesting and even though they deprecated the standalone DartVM, it still transpiles to JS quite nicely. It has a really nice approach to not storing too much in memory and instead using streams. I don't know how well this can be applied to the typical architecture of games but it is still awesome.

 

One I might add to the list, especially if you want to use the same language for the entire project is C (or C++). The backend (that runs on a typical server) can be written in C/C++ with one of the many http or websocket libraries (i.e: libmicrohttpd, mongoose, etc)... and then the frontend (that runs on the clients web browser) can be written in C/C++ and compiled using Emscripten (http://kripken.github.io/emscripten-site/).

 

This is also nice because you can use the standard OpenGL(3D) or SDL(2D) libraries to make the web game in exactly the same way as a standard desktop program.

 

This is actually what UE4 and other 3D engines use for their web exporter anyway so is pretty tried and tested these days.

Edited by Karsten_

Share this post


Link to post
Share on other sites

If you want to use the same language for the backend and front end, I'd suggest Javascript over C++. The reason is two fold:

 

1)Using emscripten you still end up calling javascript libraries, for example for the filesystem, so it falls short of requiring no javascript to use.

2)Javascript has a single threaded architectural model, and even if you're compiling c++ to javascript, your c++ code cannot ignore this. Whereas a C++ game may have background tasks, and worker threads*, everything in javascript is done in what in C++ would be called your rendering loop. This requires an asynchronous programing style, which should be easier to do in javascript than c++. Actually this is a way around this, but it requires running an interpreter in javascript; this doesn't give you multithreading, but it does allow you to have long sections of synchronous code that don't cause your browser to hang.

 

I say this as someone who is actively working on making a webgame in C++/emscripten.

 

*there are actually such things as web-workers, but they are heavily restricted compared to c++ threads.

Edited by King Mir

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this