Live data from Hacker News

BrowserHack: NetHack ported to the web

coolwanglu.github.io

21–28 of 28 posts

Re: BrowserHack: NetHack ported to the web

#21
post #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/…

Try typing this in the browser console (might need to reload the game first)

nethack.apply_tileset('http://cook.web.eschelon.com/pictures/geoduck20x12.bmp', 12, 20)

I felt that a complete ASCII port worth a separate project, yet it might not be that interesting as we've already got NAO.

But if you guys feel that a ASCII tileset is ok, I'm happy to add it. How about this smaller version?

Re: BrowserHack: NetHack ported to the web

#23
post #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.

There's also libtcod[0], a library to help creating roguelikes. There are bindings in a lot of languages (Common Lisp, Nimrod, Lua, Go, D...) and it's a real pleasure to use! I used to work on a Python roguelike, and I can't recommend this lib enough.

[0] http://roguecentral.org/doryen/libtcod/

Re: BrowserHack: NetHack ported to the web

#24
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!

Also for people new to NetHack, don't expect to last more than a few minutes if you're not using the net. There are websites, forums, chatrooms to help you get started. You can start with a community-made beginners' guide http://nethackwiki.com/wiki/Why_do_I_keep_dying%3F

Re: BrowserHack: NetHack ported to the web

#25
post #23
post #12

Earlier quoted context omitted.

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.

There's also libtcod[0], a library to help creating roguelikes. There are bindings in a lot of languages (Common Lisp, Nimrod, Lua, Go, D...) and it's a real pleasure to use! I used to work on a Python roguelike, and I can't recommend this lib enough. [0] http://roguecentral.org/doryen/libtcod/

Frustration. I wasn't able to get libtcod to build. Tried to get prep'd for 7drl a few months back on debian (previous stable) and when that failed, a clean install of windows 7. I've also had trouble with race conditions with keypresses and the python version, although that was a few years back. I like the libtcod philosophy of it being a library approach (contrast with t-engine, which is more of a sandbox model).

Re: BrowserHack: NetHack ported to the web

#26

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.

The fencepost error jumps, easily evading your clumsy kick.

Re: BrowserHack: NetHack ported to the web

#28
post #19

Earlier quoted context omitted.

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/…

Try typing this in the browser console (might need to reload the game first) nethack.apply_tileset(' http://cook.web.eschelon.com/pictures/geoduck20x12.bmp' , 12, 20) I felt that a complete ASCII port worth a separate project, yet it might not be that interesting as we've already got NAO. But if you guys feel that a ASCII tileset is ok, I'm happy to add it. How about this smaller version?

Pretty neat! And I see you have included that tileset natively. I think that making "pure ASCII image-less tileset" should be piece of cake as well:

  .tile:after {
    display: block;
    text-align: center;
    font: bold 30px/30px monospace;
  }
  .tile158:after {
    content: '@';
    color: yellow;
  }
Post reply on HN