AP
apowers313/nethack-3d
A Three.js-powered 3D UI for playing NetHack in the browser. It uses @neth4ck/neth4ck (NetHackJS) to run NetHack WebAssembly inside a Web Worker, with a React hooks/Zustand frontend handling rendering, input, and game UI.
NetHack 3D
Play in browser: https://jamesiv4.github.io/nethack-3d/
NetHack 3D lets you play classic NetHack in a fully interactive 3D dungeon, right in your browser.
Screenshots
| Combat (Gnomish Mines) | Enhanced Combat Visuals (Tile shake, damage numbers, blood) |
|---|---|
![]() |
![]() |
| Attributes | Inventory |
![]() |
![]() |
Current Features
- Play NetHack in a 3D dungeon view while keeping core game rules and depth.
- Minimap for full-level awareness, with viewport box and drag-to-center camera navigation.
- Camera panning and rotation.
- Crisp ASCII monsters and items.
- Tiles coming, maybe more ;) FPS mode anyone?
- Dynamic darkness and lighting around your hero.
- Combat feedback effects (screen-space and tile effects)
- Full HUD with level, health, power, stats, armor, gold, hunger, experience, time, and dungeon depth.
- Live message log plus on-screen message popups
- Full mobile touch support for NetHack prompts: yes/no, directional actions, text entry, and tile targeting/look mode.
- Beautiful menus: item category headers, keyboard tips, multi-pickup selection, and menu paging.
- Fast character start: random hero or manual setup (name, role, race, gender, alignment).
- Extended command support with
#so advanced playstyles are available, with all commands available via buttons on mobile. - Desktop-friendly controls: keyboard-first with mouse support for map interaction and camera control.
- Mobile-friendly controls: tap/swipe movement, quick actions, extended command sheet, and mobile log view.
Extras
- Quick reopen for the latest info panel with
Ctrl+M. - Power-user debug tools in browser devtools for tile refresh, status inspection, and game updates.
Run Locally
npm inpm run dev- Open
http://localhost:5173/
Scripts
npm run dev- Start Vite dev server.npm run build- Build production bundles.npm run preview- Preview production build locally.npm run glyphs:generate- Regenerate glyph catalog from runtime artifacts.npm run glyphs:check- Verify checked-in glyph catalog is up to date.
Architecture
- Main app bootstrap/debug helpers:
src/app.ts - React entry:
src/main.tsx - React UI shell:
src/ui/App.tsx - 3D engine and client-side interaction:
src/game/Nethack3DEngine.ts - Glyph catalog + behavior rules:
src/game/glyphs/* - Runtime worker bridge:
src/runtime/WorkerRuntimeBridge.ts - Worker runtime host:
src/runtime/runtime-worker.ts - NetHack callback adapter/state machine:
src/runtime/LocalNetHackRuntime.ts
GitHub Pages Deploy
- Push this repo to GitHub.
- In repository settings, go to
Settings > Pages. - Set
SourcetoGitHub Actions. - Ensure your deploy branch matches
.github/workflows/deploy-gh-pages.yml(mainby default). - Push to
main(or run the workflow manually).
The workflow builds with Vite and deploys the dist/ folder.



