Live data from Hacker News

14kb WASM game written in D

skoppe.github.io

21–30 of 115 posts

Re: 14kb WASM game written in D

#21
post #10

Pretty impressive performance. It seems web assembly is pretty good tech for writing a performant web app. Is there any benchmark comparing web assembly vs javascript? I mean the same logic executed by javascript code vs the web assembly. Also curious to know if there are any serious web apps developed using web assembly.

Figma uses webassembly. We also use it for our web engine at https://castle.xyz, I gave at talk about that you can watch here: https://youtu.be/0FjCaoc1uzs where I go into some details and also do some live wasm game development (not sure how "serious" since we're still working on our app though).

Much, much better performance than JS is possible because (among many other things) you can perform a lot of optimizations during AOT compilation due to eg. LLVM, avoid GC and arrange memory to help cache efficiency.

Re: JS call overhead, ultimately using instanced drawing so you have a constant number of draw calls even for a growing number of objects is what helps.

Re: 14kb WASM game written in D

#22

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…

Impressive? 2011 says hi.

"Unreal Engine 3 Support for Adobe Flash Player - Epic Citadel"

https://www.youtube.com/watch?v=xzyCTt5KLKU

Re: 14kb WASM game written in D

#23
Say if you increased the resolution here to become significantly less blocky, would it work with browsers in general or would it consume considerable amount of CPU?

Re: 14kb WASM game written in D

#25
The original JavaScript implementation: https://js13kgames.com/games/underrun/index.html

(It was a js13kgames submission in 2018; I’m guessing that this being submitted here now is in some way linked to how Q1K3 is currently on the homepage, also a js13kgames submission, though for 2021. Pure speculation.)

Re: 14kb WASM game written in D

#26
post #23

Say if you increased the resolution here to become significantly less blocky, would it work with browsers in general or would it consume considerable amount of CPU?

I think the blockiness is an aesthetic choice, much like in the awesome roguelike Teleglitch. I like it!

Re: 14kb WASM game written in D

#27

The original JavaScript implementation: https://js13kgames.com/games/underrun/index.html (It was a js13kgames submission in 2018; I’m guessing that this being submitted here now is in some way linked to how Q1K3 is currently on the homepage, also a js13kgames submission, though for 2021. Pure speculation.)

Link to author’s site: https://phoboslab.org/underrun/

Source code: https://github.com/phoboslab/underrun

Re: 14kb WASM game written in D

#28

A few errors: • There’s an & that should be either & or &, depending on whether it’s setting HTML or text. • The opening garbage text is mojibaked, so that it looks like… different, not as æsthetically pleasing garbage. • The text that’s supposed to be like “7 SYSTEM(S) STILL OFFLINE” is getting mangled badly, missing much of the string and getting a bunch of U+0000s in it—unchecked and incorrect string index…

For what it's worth, the original 13kb JS only version[1] does not have these problems.

I was confused for a second why this game made its way to HN again (there's a making of for the game itself from 2018[2]). This seems to be a port of the game to D[3] as a demo for a WASM runtime, Spasm, which is also written in D[4].

[1] https://phoboslab.org/underrun/

[2] https://news.ycombinator.com/item?id=18031024

[3] https://github.com/skoppe/spasm/tree/master/examples/underru...

[4] https://github.com/skoppe/spasm

Re: 14kb WASM game written in D

#29
post #19

The style of this game reminds me strongly of "Teleglitch": https://store.steampowered.com/app/234390/Teleglitch_Die_Mor...

The graphics definitely resemble Teleglitch! Though that game is more complex, what with the combination of items...

Re: 14kb WASM game written in D

#30
post #10

Pretty impressive performance. It seems web assembly is pretty good tech for writing a performant web app. Is there any benchmark comparing web assembly vs javascript? I mean the same logic executed by javascript code vs the web assembly. Also curious to know if there are any serious web apps developed using web assembly.

I recently discovered https://lekh.app which uses web assembly. I had a conversation with the developer and he told me that he is using web assembly for the core diagramming and shape recognition logic. The app is for diagramming and whiteboarding. The whole diagramming and AI (to recognize shapes) is compiled into ~1M of web assembly.
Post reply on HN