Live data from Hacker News

14kb WASM game written in D

skoppe.github.io

71–80 of 115 posts

Re: 14kb WASM game written in D

#71

Wow, what an impressive game for the web browser, and in such a small size! I'm particularly impressed by the variable lighting of the bullets down hallways, that's really quite masterful work. Kudos! Edit: I am impressed because I'm impressed. I spent a few weekends recently messing around with pygame, and I had a really hard time organizing my code and my thoughts. I do primarily numerical, technical work, and I se…

Making a sticky game is much harder that it seems.

Many of us could code something like this technically but it would play horribly and look worse - and would be more than 14kb of WASM

It is the little things, the lighting, the little sound effects, even the unlimited ammo

Re: 14kb WASM game written in D

#72
post #63

Earlier quoted context omitted.

Unreal 4 offers a WASM target. https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing...

I know, but that wasn't the question, rather what has been actually produced with it, given that Infinity Blade was created with Unreal 3 for iOS in 2008. An hardware that WebGL 2.0 is supposed to be much better. Instead most online games look like Amiga 500 stuff instead.

This is more because there isn't an incentive (monetary or otherwise) to do that. When Flash gaming was big, web-based games were on the desktop but web games never took off on mobile which got pretty much all the audience they used to have on the desktop. Instead mobile games are largely native (or at least in app form).

I agree that it took many years for HTML5/JS to reach Flash's capabilities (and some stuff like easily swapping around SWF files is still not as easy to do) and i dislike how Flash was forcibly killed instead of losing its popularity "naturally" (though it being proprietary technology instead of some open standard or at least an open source project help its murder considerably), but the reason you do not see Citadel-level stuff on HTML5/JS has more to do with not being much of an incentive to do something like that than the technology being able or not (demos like After the Flood[0], which has as much gameplay as Citadel yet it shows more advanced rendering techniques - you can even look yourself in the glass reflections :-P - show that it is technically possible).

[0] https://playcanv.as/e/p/44MRmJRU/

Re: 14kb WASM game written in D

#73
post #64

Earlier quoted context omitted.

Literally every major engine allows exporting to WebGL/WASM. So Unreal, Unity, Godot, etc... graphics can all be done in WebGL (without a few of the bleeding edge Vulkan/DirectX features).

A few of the bleeding edge features ? You obviously don't know what you're talking about - WebGL 2.0 is not supported on Safari and iOS [1] and WebGL 1.0 is based on an API that was released in 2007 ! Even WebGL 2.0 is based on ES 3.0 which is from 2008... [1] https://caniuse.com/webgl2

Safari is already shipping experimental support for WebGL 2. It will be months, not years, before it is enabled by default.

Also, OpenGL ES 3.0 is not from 2008. The specification was publicly released in August 2012, and of course it took years before enough devices supported it well enough (lots of driver bugs…) for it to be worth targeting.

The web is certainly a few years behind the native-code state-of-the-art, but it's not a decade behind. There's a lot you can do with these mature APIs.

Re: 14kb WASM game written in D

#74
post #37

Earlier quoted context omitted.

Yeah I first tried this in Safari and just had a black screen - edge/chrome worked just fine. Notice/pop-up would be helpful

This may be due to requiring WebGL 2 specifically, and not WebGL generally.

I don't think so. It works on my laptop that only supports WebGL 1.

Re: 14kb WASM game written in D

#75

Earlier quoted context omitted.

A few of the bleeding edge features ? You obviously don't know what you're talking about - WebGL 2.0 is not supported on Safari and iOS [1] and WebGL 1.0 is based on an API that was released in 2007 ! Even WebGL 2.0 is based on ES 3.0 which is from 2008... [1] https://caniuse.com/webgl2

Safari is already shipping experimental support for WebGL 2. It will be months, not years, before it is enabled by default. Also, OpenGL ES 3.0 is not from 2008. The specification was publicly released in August 2012, and of course it took years before enough devices supported it well enough (lots of driver bugs…) for it to be worth targeting. The web is certainly a few years behind the native-code state-of-the-art,…

And finally gets supported in Safari, on the year when graphics card are moving into mesh shaders and raytracing, with WebGPU still one year away as MVP 1.0.

Re: 14kb WASM game written in D

#76
post #24

Also, what is the advantage using D for this? Could this be D's niche market? It looks really exciting.

> Could this be D's niche market?

Maybe it could be, but our goal is not to have "niches". If anything, our niche is making people who would otherwise not be, productive enough to deliver what they want to make.

D isn't a gimmick language, it's a Programming (with a capital P!) language.

Re: 14kb WASM game written in D

#77
post #44
post #24

Also, what is the advantage using D for this? Could this be D's niche market? It looks really exciting.

They’re not the best metrics but the related Spasm toolkit had surprisingly many stars and forks for being D. This was the more interesting tool I discovered here, rather than the JS game port to D, where honestly the impressive part is already done in JS. So yes it got me thinking the same thing. https://github.com/skoppe/spasm

> had surprisingly many stars and forks for being D.

Github stars are an extremely weak signal. Some D users have actually said to me that they feel slightly confused that their projects have more stars than the actual language implementation on github just because of hype, for example.

Re: 14kb WASM game written in D

#78

Earlier quoted context omitted.

A few of the bleeding edge features ? You obviously don't know what you're talking about - WebGL 2.0 is not supported on Safari and iOS [1] and WebGL 1.0 is based on an API that was released in 2007 ! Even WebGL 2.0 is based on ES 3.0 which is from 2008... [1] https://caniuse.com/webgl2

Safari is already shipping experimental support for WebGL 2. It will be months, not years, before it is enabled by default. Also, OpenGL ES 3.0 is not from 2008. The specification was publicly released in August 2012, and of course it took years before enough devices supported it well enough (lots of driver bugs…) for it to be worth targeting. The web is certainly a few years behind the native-code state-of-the-art,…

>It will be months, not years, before it is enabled by default.

So in a few months we'll have feature parity with 2012 mobile HW ?

I have quit 3D development around 2015 but I remember trying to use MRT on webgl to do some basic deferred shading and you could run on FF and Chrome desktop only. It's infuriating that 7 years later it's still the case. I used this technique when I was learning 3D programming in 2007. Calling this cutting edge is just...

Re: 14kb WASM game written in D

#79
post #35

Earlier quoted context omitted.

Ok, I'm not trying to take anything away from the developer here but calling this "masterful" makes me think you must have incredibly low expectations for webtech games and/or developers.

Or incredibly low expectations for programmers in general, which is fair. If you pick 100 random run-of-the-mill programmers from any corporation, and ask them to repeat this exercise, 95 of them would not even get out of the starting blocks. I liked it.

The remaining 5 would talk like an elitist about their peers?

Re: 14kb WASM game written in D

#80
post #5

This uses webgl, right? Maybe feedback to the user in case of missing support would be useful. Else folks get stuck at "Initializing..." with an exception in the console. Not everybody checks the console. (TypeError: can't access property "createBuffer") Edit: stuck at "Initiating..."

Yeah I first tried this in Safari and just had a black screen - edge/chrome worked just fine. Notice/pop-up would be helpful

work fine on Firefox
Post reply on HN