3
\$\begingroup\$

I have absolutely no knowledge about game development, and for 2 years I have been a web application developer (in PHP & JS).

I'd like to learn game development, and I'd also like to free myself from PHP and Javascript and learn some game related concepts in C/C++/C# (whatever is required for game development).

Can browser-based games be developed in a language like C/C++/C#/Python and not using Javascript or Flash? Additionally, would these be superior (in terms of graphics and browser compatibility,support) to games developed using Javascript/HTML5?

EDIT:

  1. By browser based games I'm looking at this.
  2. Java/Python/C++ which among these would provide a better support for browser game dev (interms of compatibility, graphics)?
\$\endgroup\$

closed as off-topic by Alexandre Vaillancourt Nov 30 '18 at 15:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – Alexandre Vaillancourt
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ It seems like you're really fixated on the programming language. The language doesn't automatically empower you to create a good game. If you want a game with 3D graphics that runs in a browser, definitely check out Flash or Unity3D. \$\endgroup\$ – bummzack May 20 '12 at 12:51
5
\$\begingroup\$

Yes, using WebAssembly (“Wasm”) released in 2017.

The past few years of browser development have been an interesting time. JavaScript runs slowly and browser vendors (particularly Mozilla and Google) have been trying to speed it up. That raised the question: why use JavaScript at all?

In comes WebAssembly: it's an assembly language for the web which other languages such as C++ can compile into and run in the browser. At the time of writing it primarily targets C/C++ and Rust. It's a built-in browser feature and requires no plugins, applets, extensions, or external dependencies. It's currently implemented in Firefox, Chrome, Safari, and Microsoft Edge; you can see the latest support table for WebAssembly on Can I Use.

Its version 1.0 MVP launched in 2017 and further development is ongoing. Currently WebAssembly is 32-bit only (“wasm32”). Support for 64-bit (“wasm64”) is a work in progress.

It will take some time for languages to properly adopt compilation into WebAssembly. It is built with C/C++ and Rust in mind and Java, C#, and Python are not there yet.

Read more here:

Rendering

Your options are currently pretty much just:

Otherwise: It's JavaScript or bust.

The only real option beside Wasm is ordinary JavaScript. You'll either use JavaScript straight-up, or you'll transpile into JS from one of its precompiler languages (e.g. CoffeeScript, Coco, LiveScript, or TypeScript). You may be able to transpile your code into the ASM.JS subset which is a high-performance subset of JavaScript treated as a sort of assembly language—in fact it was one of Wasm's inspirations.

The day of applets is over because of a combination of security concerns and increasing power of modern JS and HTML5 so they are not an option:

Just build for the desktop if you're learning.

If you're just learning to program video games I suggest starting out just with desktop development. You've been developing for the web, but if you're learning C++ or Java or Python, it's going to be easier for you to do that in their normal desktop environments. In a couple of years when WebAssembly is more developed and has wider adoption in development tools you'll be ready for it and it will be ready for you.

\$\endgroup\$
3
\$\begingroup\$

As a web-application developer you probably know that there's a client- and a server-side of the application. The same can be applied for a browser-based game, where you have the game-client (in HTML/JS) and the backend.

The backend can be written in any language you prefer, so you could write that in Python, C++ or any other language.

As for the client-side, you're basically limited to the things Jonathan Hobbs posted in his answer. That's Java (Applet), Actionscript (Flash SWF), .NET languages (Silverlight) or JavaScript. The only thing that runs natively in a browser is HTML5 and JavaScript. All other technologies use a plugin and there are no wide-spread plugins except for the ones mentioned above.

In my opinion, Flash has the best balance between potential user-base and capabilities. It comes with a powerful graphics/video and sound API and there are lots of tools and libraries to be found for Flash.

If you want to target as many devices as possible (including mobile), then your best bet is HTML5 and JS.

Another option that could be interesting for you is Unity3D. It allows you to develop in C# (which is one of your preferred choices) and you can then either deploy for the web using the Unity3D browser-plugin or compile to a SWF (Flash), where you benefit from a bigger user-base.

\$\endgroup\$
2
\$\begingroup\$

If you can get away with the game only working on Chrome there's NaCl which lets you write your game in C++, and run it at almost the same performance as you'd get not using the sandbox.

\$\endgroup\$
0
\$\begingroup\$

The examples you gave use 3D graphics, and to support those you would need to use JavaScript+Canvas or some kind of plugin. The most popular plugins supporting 3D content are Flash and Java. In theory you could run the 3D graphics on the server but this is not commercially viable. As other users have pointed out, the server can be written in any common language (not HQ9+).

If you are willing to work within normal HTTP and HTML limitations, you can build a game without JavaScript. These games will tend to use tables and forms for input, and few or no dynamic graphics. Business games work well in this format, like Simunomics. Real time strategy and 4x games can also fit this mold, such as Merchant Empires (google for screenshots, defunct), Ogame, or SkyLords (have enjoyed all four of these). Dating sims should work well with only HTML/CSS. RPGs - implementing a strictly turn based combat/movement system - would also work well with just HTML/CSS.

All of these could benefit from some touches of progressive enhancement with JavaScript - but none of them require it.

So, yes, browser based games can be developed without JS/Flash, and can be fun to play. However, no, 3D graphics in a browser window do require JS, Flash, or Java (or other less common plugins like Unity3D, Silverlight, etc).

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.