Advertisement

What languages should I know for HTML5 game development?

Started by December 20, 2016 05:43 AM
5 comments, last by King Mir 8Β years ago

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.

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

Advertisement

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.

πŸ™‚πŸ™‚πŸ™‚πŸ™‚πŸ™‚<←The tone posse, ready for action.

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.

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.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.
Advertisement

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.

This topic is closed to new replies.

Advertisement