coolwanglu / browserhack Goto Github PK
View Code? Open in Web Editor NEWNetHack on the Web!
Home Page: http://www.kongregate.com/games/coolwanglu/browserhack
NetHack on the Web!
Home Page: http://www.kongregate.com/games/coolwanglu/browserhack
Shift-clicking on tile also moves my current character. I just looked into both mouse_event_handler (line 747) and the shift-click event listener (line 782, both win/web/nethack_lib.js) but judging from the early return statements, I couldnt find the root cause..
Again, this is on Firefox
Would be amazing for those of us with fullsize keyboards.
Using requestAnimationFrame for calls to functions like recenter_map
could help improving repaint performance
Control-d is supposed to be kick, but in a browser, that bookmarks. There's no #kick extended command either. Thus kicking a sink, or a locked door, or a chest, or a monster, or even the wall if you're so inclined -- all these are impossible?
E.g., press W to wear something, then press ? to see the list of things that can be worn. This overlay list does not show the item ID (A-Z, a-z). Furthermore, pressing a-z or whatever does nothing if the overlay is shown.
A correct fix would be to show the item IDs and allow pressing a key to indicate which item(s) you want.
Seems like maybe the UI get's into a state that is out of sync with the game state, and locks up.
I'm not sure how to reproduce, but it's some sequence involving dropping or perhaps otherwise selecting items. Perhaps a consequence of selecting nothing.
I get this in the error console
Successfully compiled asm.js code (total compilation time 29ms; unable to cache asm.js in synchronous scripts; try loading asm.js via <script async> or createElement('script'))
It seems this can be fixed by tagging the script tags with the async
attribute. The longer explanation is on MDN: https://developer.mozilla.org/en-US/docs/Games/Techniques/Async_scripts
Very interesting work. Just curious, where will the save file be stored? On our local computer (possibly browser cache), or your server?
With my current keyboard layout (Swiss French), to input a #
symbol for extend commands, the combination is AltGr + 3, which does not work with the current build
Also on a side note, support of the subkeyvalue
option would be greatly appreciated, for the following swap of the Z and Y keys (my QWERTZ keyboard makes it hard to use HJKL YU NM for movement):
OPTIONS=subkeyvalue:121/122
OPTIONS=subkeyvalue:122/121
It just asks for a name and then picks class, gender and alignment randomly.
First of all, this is a really well done port. Thanks you for doing this.
I want to suggest packaging this as an open web app. This would enable BrowserHack to run in Android (as a Cordova/Phonegap app) and Firefox OS.
To work in these runtimes, BrowserHack would need to show a softkeyboard or focus a hidden element to use the system's softkeyboard.
I'd be happy to work on this, if you can guide on which files to touch :-)
Upon restoring my game (after ending the session with S
save), my inventory seems to be in a strange state. None of the objects have retained their names in the inventory hover text on the right. Several objects are now strange object
, but other bizarre names appear as well ((null)
, or merely the empty string.)
The state of what is currently worn and/or equipped appears corrupted as well. A cloak of invisibility appears unequipped, though it was on save and still seemingly renders me invisible on load. A scroll appears to be confused with my throwing daggers, sharing their name and a place in my quiver.
Some other observations:
#adjust
) letters are still correctI can try to conjure up the IndexedDB if you think that'll help, but there doesn't appear to be an easy export option.
Chrome 43.0.2357.124 (64-bit) on OSX 10.10
I get this in the browser developer tools console and indeed, saving games does not work.
Good morning! I'm running into an issue when attempting to compile BrowserHack from source on Linux, specifically Fedora 24.
I've installed the latest emscripten release from the sdk tgz available on the emscripten website.
After cloning this project, I had to edit the EMCC variable in build.sh to point to my emscripten installation. After that, attempting to run ./build.sh results in:
$ ./build.sh
Copying Makefiles.
( cd src ; make )
make[1]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/src'
touch ../src/config.h-t
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c monst.c
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c objects.c
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c -o alloc.o alloc.c
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c -o makedefs.o makedefs.c
makedefs.c:361:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Data);
^~~~~~~~~~~~~~
makedefs.c:361:14: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Data);
^
"%s",
makedefs.c:560:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^~~~~~~~~~~~~~
makedefs.c:560:14: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Code);
^
"%s",
makedefs.c:1235:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Data);
^~~~~~~~~~~~~~
makedefs.c:1235:14: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Data);
^
"%s",
makedefs.c:1357:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^~~~~~~~~~~~~~
makedefs.c:1357:17: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Code);
^
"%s",
makedefs.c:1398:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^~~~~~~~~~~~~~
makedefs.c:1398:14: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Code);
^
"%s",
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c -o dlb.o dlb.c
makedefs.c:1714:14: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^~~~~~~~~~~~~~
makedefs.c:1714:14: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Code);
^
"%s",
makedefs.c:1869:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^~~~~~~~~~~~~~
makedefs.c:1869:17: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Code);
^
"%s",
makedefs.c:1894:17: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
Fprintf(ofp,Dont_Edit_Code);
^~~~~~~~~~~~~~
makedefs.c:1894:17: note: treat the string as an argument to avoid this
Fprintf(ofp,Dont_Edit_Code);
^
"%s",
8 warnings generated.
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc -O3 -I../include -c ../sys/unix/unixres.c
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc makedefs.o -o makedefs
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc --pre-js ../win/web/mount_nodefs.js -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc --pre-js ../win/web/mount_nodefs.js -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
make[2]: Entering directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc --pre-js ../win/web/mount_nodefs.js -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
/home/mmorsi/workspace/tmp/emsdk-portable/emscripten/1.37.9/emcc --pre-js ../win/web/mount_nodefs.js -o makedefs.js makedefs.o ../src/monst.o ../src/objects.o
js ./makedefs.js -o
js ./makedefs.js -p
js ./makedefs.js -z
js ./makedefs.js -m
./makedefs.js:9: ReferenceError: require is not defined
Makefile:198: recipe for target '../include/onames.h' failed
make[2]: *** [../include/onames.h] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:488: recipe for target '../include/onames.h' failed
make[1]: *** [../include/onames.h] Error 2
make[1]: *** Waiting for unfinished jobs....
./makedefs.js:9: ReferenceError: require is not defined
Makefile:200: recipe for target '../include/pm.h' failed
make[2]: *** [../include/pm.h] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:490: recipe for target '../include/pm.h' failed
make[1]: *** [../include/pm.h] Error 2
./makedefs.js:9: ReferenceError: require is not defined
./makedefs.js:9: ReferenceError: require is not defined
Makefile:202: recipe for target '../src/monstr.c' failed
make[2]: *** [../src/monstr.c] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:492: recipe for target 'monstr.c' failed
make[1]: *** [monstr.c] Error 2
Makefile:204: recipe for target '../include/vis_tab.h' failed
make[2]: *** [../include/vis_tab.h] Error 3
make[2]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/util'
Makefile:494: recipe for target '../include/vis_tab.h' failed
make[1]: *** [../include/vis_tab.h] Error 2
make[1]: Leaving directory '/home/mmorsi/workspace/tmp/BrowserHack/src'
Makefile:92: recipe for target 'nethack' failed
make: *** [nethack] Error 2
In case the player might need to take a look at the whole map or to check something far away. This version of game does not seem to support panning so things might become hard if the player cannot find the downstairs or when he just want to check the monsters in the level with telepathy.
Since the user interface does not show the full dungeon map, you can not find out whether the current room you are in is on the far-right, the center or the far-left of the dungeon. If the map was zoomed out, you would see which areas (and which walls of the current rooms) are more likely to contain a hidden door.
The android port tacked this by showing the whole dungeon background in black and surrounding the non-dungeon part (e.g. when scrolled all to the right) in grey. This allowed you to see more correctly where you are in the dungon.
I noticed that browserhack currently only creates <div>
elements for the actual tiles that are being rendered. I am not sure how to address this without showing all currently unknown blocks as black tiles. I tried fiddling with background colors in CSS, but did not make any substantial progress.
Thanks for building this project! How is doing on Kongregate?
What version of Emscripten was this project compiled with? I've tried emcc 1.30.0, which results in a build that doesn't work (I cannot get past the opening dialogs), and emcc 1.34.1, which results in a binary that works perfectly, but is much slower than the build you have up on github.io.
1.34.1 wasn't even out when the last release was made on github.io, so do you happen to have a record of the version you used to make that build?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.