Hacker News new | ask | show | jobs
by daredevildave 4493 days ago
If you're interested in writing games in Javascript, you might like to take a look at PlayCanvas [playcanvas.com] which has Unity/UE4-like tools for building WebGL/Javascript games.
1 comments

Has WebGL solved the local storage limitation yet? I've been waiting for a few years for that. There's still no way to "install" a game into a browser, as far as I know, and redownloading 1GB+ of assets every time the game loads isn't an option.
If, for whatever reason, you're hell-bent on producing a AAA-quality game with javascript and WebGL, you could always use something along the lines of node-webkit[0] and distribute it the usual way.

Personally, I rather significantly doubt that people would play more AAA games if they could download them in their browser rather than Steam.

[0] https://github.com/rogerwang/node-webkit

Why wouldn't you want to produce a AAA-quality game with javascript and WebGL? It should be the default, not some crazy thing.

The best argument against javascript + WebGL is "javascript is bad." But the disadvantages of JS are sometimes strengths. The lack of static typing, for example, allows a REPL. It's true that with an average gamedev team, you'll get below average results. But with an above-average team, powerful languages tend to translate into stellar results.

Oh well, I guess I'll wait a few more years for browser vendors to implement some kind of concept of a webapp installation.

> The lack of static typing, for example, allows a REPL

Uh? Languages with static typing can have REPLs. See: Scala, Haskell and more. I don't think that is what makes JS an option for game development, but rather its ubiquity in browsers. If you remove that, I don't see why you would choose it for serious development.

Why does Haskell have a REPL but not Go?
Haskell has an interpreter as well as a compiler. No one cares enough about making one for Go.

I used a C interpreter a decade ago.

A quick Googling would have shown two REPLs for Go, though they're old and haven't been updated in a long time. I'm guessing the Go playground and "go run file.go" compiling and running so quickly, make it not a real concern.
I don't know why Go doesn't have a REPL, I'm not familiar with the language. My point is that having static typing does not preclude a nice REPL.
Because Go sucks? What point are you trying to get at here?
> Why does Haskell have a REPL but not Go?

Because no one's bothered to create a REPL for Go.

> Why wouldn't you want to produce a AAA-quality game with javascript and WebGL? It should be the default, not some crazy thing.

Performance. Show me some like gears of war running in a browser and then I will be convinced.

> The best argument against javascript + WebGL is "javascript is bad."

That is the worse attempt to portray the other side's argument I have seen a while.

> The lack of static typing, for example, allows a REPL.

You can also just have a console implemented, like most AAA games. They are also built into engines like Source.

> It's true that with an average gamedev team, you'll get below average results. But with an above-average team, powerful languages tend to translate into stellar results.

I don't understand how javascript would allow someone like John Carmack to make anything new, I write Javascript every day but when it comes to games I much prefer something like c#.

Look up Unreal engine in the browser. It runs quite nicely.

You're right that I did a poor job explaining why people are against JS for gamedev. Sorry about that.

The only game demo I can currently find for UE4 in the browser is Flappy Chicken (I know they had some up earlier, but they seem to be taken down). Not really a compelling AAA demo. And their 3D games still only run about half as fast as a native C++ engine. That's very impressive, but you won't be putting out AAA games with a 50% performance hit.

And even then, unreal engine in the browser doesn't run Javascript written by developers. It compiles the C++ code into asm.js. Huge difference. Unless you can code asm.js by hand, you won't be able to do that. Here's a sample of the Flappy Chicken UE4Game-HTML5-Shipping.js file, because the code is just too long and ugly to paste.[0] Definitely not 'JS for gamedev.'

[0] http://i.imgur.com/O3w61XI.png

This has been up for three hours, and it's telling that no one has replied to it with a rebuttal.
You could always package the game as a node-webkit app.
AppCache?
It sounds like AppCache limit is 5MB. I can't find very much info, though, but a reasonable limit for gamedev circa 2014 would be 16GB or so.

http://grinninggecko.com/2011/02/24/developing-cross-platfor...

http://stackoverflow.com/questions/6757945/cache-manifest-si...

There are the HTML5 local filesystem extensions, in addition to that. Just no idea how these are called.