Live data from Hacker News

BrowserHack: NetHack ported to the web

coolwanglu.github.io

11–20 of 28 posts

Re: BrowserHack: NetHack ported to the web

#11
post #6

Earlier quoted context omitted.

Watching complete strangers nethack is weird, because it's a completely noninteractive medium.

You can send them messages via the mail daemon :)

Yes, just create an account on NAO and press "m" to write to the current player (who might then reply to you with "#" or "E-"). People often give each other advice or commiseration.

And there's also a #nethack IRC channel where sometimes players and watchers will comment on ongoing NAO games.

Re: BrowserHack: NetHack ported to the web

#12

I made a web browser playable Rogue-like about 7 years ago. It was the first incarnation of my Dead By Zombie game. Python and a completely homegrown engine. I later decided the hack novelty of it didn't outweigh the negatives of the inferior latency and increased complexity. So I dropped support for the web UI and rewrote it to have a conventional curses-based UI for play in a terminal. No regrets.

Curses is cool - no bones. But javascript is becoming significant for roguelikes. There's a library called rot.js that is far easier to get started with than the other significant frameworks. They've recently made it work in node.js as well (for the console). Hence, you can easily get a single codebase presenting to both web and terminal.

Re: BrowserHack: NetHack ported to the web

#13

Nethack is how I committed vim keybindings to muscle memory. This is really cool (though a few things, like Ctrl-D to kick and extended commands seem to either not work or be clumsy).

Sometimes when debugging particularly stubborn issues I wish I could kick code with ^D in vi.

#untrap would be useful, too.

Re: BrowserHack: NetHack ported to the web

#14
post #4

This is fucking nuts! All of the game code is Nethack's original C: https://github.com/coolwanglu/BrowserHack/tree/master/src Porting is mainly accomplished by defining a windowing system for 'web' (mostly in C), right next to the definitions for 'X11', 'Qt', etc: https://github.com/coolwanglu/BrowserHack/tree/master/win And compiling through LLVM via Emscripten, resulting in a browser-runnable JS target: https://git…

Mirroring your thoughts, Great effort and results on the port, but seeing tilesets has ruined the experience for me. I spent many wasted hours via a telnet session when I should be working on my 3rd year university projects!

Re: BrowserHack: NetHack ported to the web

#15
post #4

This is fucking nuts! All of the game code is Nethack's original C: https://github.com/coolwanglu/BrowserHack/tree/master/src Porting is mainly accomplished by defining a windowing system for 'web' (mostly in C), right next to the definitions for 'X11', 'Qt', etc: https://github.com/coolwanglu/BrowserHack/tree/master/win And compiling through LLVM via Emscripten, resulting in a browser-runnable JS target: https://git…

Another interesting technical detail is that the nethack code contains a lot of synchronous stuff, which is generally hard to port to the web (where events must be short-lived). To get around that, the port uses Emscripten's emterpreter-async option to build (as you can see here: https://github.com/coolwanglu/BrowserHack/blob/master/build.... ).

That runs the application in a little interpreter designed for Emscripten output; the interpeter is capable of pausing and resuming code, so synchronous code isn't a problem.

More details on emterpreter here: https://github.com/kripken/emscripten/wiki/Emterpreter

Re: BrowserHack: NetHack ported to the web

#16
post #3

For people new to NetHack: You can play NetHack just by running telnet nethack.alt.org And you can save games and resume them from another computer, as well as watch other people play!

Telnet is not installed by default on recent Windows. The steps to enable it are easily found on the net, but you'll probably be better off with dedicated software, like Putty or Mobaterm to name a few. It could be useful for MUDs too, among other things.

Re: BrowserHack: NetHack ported to the web

#17
> You are a neutral male human Monk.

No way, I only play wizard and tourist! Please let us roll our character as standard nethack :)

Very impress beside that, no need to check anymore if my last system has it installed before going on vacation ^^

Re: BrowserHack: NetHack ported to the web

#19
post #8

I'm extremely impressed, although as someone who learned NetHack without tilesets, it's hard for me to imagine wanting to play a multihour game with tilesets. (Maybe a funny hack would be to create an ASCII tileset that recreates the appearance of a character-mode display?) And it's very hard for me to know at a glance what monsters are, but that's presumably just a matter of experience (I immediately know what parti…

Ad funny hack with ASCII tileset: I googled for some `NetHack ASCII tileset` and found [1], made userstyle [2] that uses this picture and it works seemingly well [3]. So I suppose there will some "true console-looking" tileset soon.

[1] http://geoduck42.deviantart.com/art/Geoduck-NetHack-Tiles-40...

[2] https://userstyles.org/styles/112589/browserhack-geoduck42-t...

[3] http://static.userstyles.org/style_screenshots/112589_after.... This certain sprite seems nice in original, but I had to transform it from 20×40 to 32×32, because re-positioning would be overkill (Haven't found any 32×32 alternative) I just wanted to try such proof-of concept…

Post reply on HN