r/nethack • u/glorat-reddit • Oct 19 '26
NetHack 5.0 as a native Mac app, reviving the old NetHack Cocoa port
I've ported NetHack Cocoa, the native Mac app, to NetHack 5.0.0.
I was on holiday and realised NetHack 5 had come out but there was no easy way to play it on macOS. Back in the day I played 3.6 on NetHack Cocoa (mega credit to Dirk Zimmermann and Bryce Cogswell), built locally from source. Across all platforms, it's always been my favourite NetHack UI, but it hasn't been maintained in years. So for my holiday effort, I decided to port it up to 5.0.0.
Then once I did that, I fixed the glitches that had always bugged me. That meant bugs, crashes and a slightly more modern UI.
I learned this game on the keyboard back in 1987 and have preferred the keyboard ever since. So the whole game is still playable from the keyboard, but you have the Mac UI to enhance the visual experience.
Since I'm on a Retina display now, I also made a prettier tile set. It was generated with Nano Banana, so it won't be for everyone, but I like it. It's optional: ASCII mode and the classic 16px tiles are still there.
Now that I can play my favourite game in my favourite UI again, I figured other people might want to as well.
What you get
The full, vanilla NetHack 5.0.0
A universal app for Apple Silicon and Intel Macs, macOS 12 or later
Still there from the original port
ASCII mode with your choice of font, or the classic 16px tiles (or your own tile set)
Mac menus that list commands with their keys, for discoverability
Dialogs for inventory, prompts, directions and character creation
Status and equipment panels, a notes window, and speech
Your
.nethackrcoptions
New in this version
Painted style 64px and 128px tiles for Retina screens, drawn over the floor beneath them, with sharper wand and spell beams
Map zoom with ⌘= and ⌘−, or pinch on a trackpad
An inventory sidebar listing everything you carry, with blessed items in green, cursed in red. Click an item, or anything in the Wearing panel, to choose what to do with it
Status at a glance: hunger, encumbrance and conditions show as coloured badges and an arrow flags a stat that just went up or down
Map marks for peaceful monsters, your steed, item piles and monsters you sense but can't see
Redrawn menus and dialogs: pick lists show each item's picture, wield and quaff offer a menu of suitable items, short questions show one button per answer, and prompts take the same keys as tty
A game-over dialog to start a new game or quit
Fixes for a long list of old glitches and crashes, including stray clicks moving you, the app freezing after a game ends, and dialogs answering the next question by mistake
Download: https://github.com/glorat/nethack-cocoa/releases/latest
It isn't notarized by Apple yet. You need to copy it to Applications. Then the first time you open it it won't open. Go to "System Settings" → "Privacy & Security" and click "Open Anyway".
Since I'm still on holiday, I'm playing it now and it seems solid, but I'm only one player. (The screenshot above is my 10th game and the furthest I've got so far on this build. Bonus points if you know where I'm at). If you are interested in trying it, I'm keen to know how it goes for you. Report problems here or on GitHub Issues. It's open source.
Please let me know if you try it!
3
u/tidyupinhere Oct 19 '26
Omg! You've ruined my life (again) <3
4
u/glorat-reddit Oct 19 '26
So I did the port to play on the airplane, which I did. My kids even got to play on my wife's laptop (cool!!). Now that it's back to work day... I'm still bringing it up during breaks. Only for a little while at a time. Really.
1
u/glorat-reddit Oct 22 '26 edited Oct 22 '26
v5.0.0-7 is out. Release notes and download: https://github.com/glorat/nethack-cocoa/releases/tag/v5.0.0-7
Text size: "View → Bigger Text" and "Smaller Text" scale messages, stats, inventory and menus.
font_size_messagesets the starting size.Resizable inventory: drag the sidebar's left edge.
Tile sets: "View → Tile Set → Import..." copies a set into the app's folder, so it survives a restart. The tile size is now worked out from the image, so the file name no longer matters.
tile_filepicks the set at launch.Options file: "Game → Edit Options File..." opens
.nethackrcin your text editor.Stability: most errors in the app's own windows no longer end the game. If it does crash, the next launch offers to recover your game instead of only deleting it.
It's still not notarised, so approve it once with "Open Anyway".
I was on my playthrough, got to level 12 dungeon and the game just crashed (while doing a farlook an encountering a message the triggered a multi-year bug in the message parser). Fortuantely, I'm the guy maintaining so I get to fix these things and get the game recovered! This new version should prevent such panic from your side too. And if you do get a crash in v6, in theory this version would auto-invoke recover for you and get your game back. (Or run recover yourself if you know how).
1
u/ketarax Oct 19 '26
I love it, even if I'll probably never own another mac. This ... part of the trend if you know what I mean is pretty much irresistable.
1
u/glorat-reddit 29d ago
Ask and ye shall receive.
I'll make a new post about this soon when release ready but if you love this with no mac then https://nethack.app is for you! Same cocoa interface and offline support but cross platform. I'd say it is beta quality now
1
u/walrus127 Oct 19 '26
Thanks. Figured out where to put my .nethack.rc file. Having a hard time getting other tilesets to work. But really enjoying this.
2
u/glorat-reddit Oct 19 '26
Glad you're enjoying!
For anyone else looking, .nethackrc or tiles files go into ~/Library/Containers/io.github.glorat.nethack/Data/.
Make sure the tiles are for NetHack 5.0, not 3.6 or it will get rejected and named per convention.
1
u/walrus127 Oct 21 '26
Is there anyway to increase the message or stats text size. Tried changing in netbackrc but no love.
1
u/glorat-reddit Oct 22 '26
Ask and ye shall receive!
As of v5.0.0-7: "View → Bigger Text" and "Smaller Text" (⌥⌘= and ⌥⌘-) resize messages, stats, inventory and menus together.
1
1
u/glorat-reddit Oct 22 '26
Ask and ye shall received.
Based on your feedback, in v5.0.0-7. "View → Tile Set → Import..." copies a set into the app's folder and makes it available. There's also a menu option to edit your nethackrc rather than hunting for the right location.
2
1
u/SicSemperTyrannis Oct 19 '26
I’m excited to play it because I was a big Nethack Cocoa user back in the day and have missed it on my MacBooks! I’ll let you know if I run into any issues.
Asking out of curiosity and discussion and not out of accusation or malice, but due to the broad discussions and pros and cons of recompiles I’ve seen in the retro gaming space.
How much of the port was done by AI? If so, did you just point it at the problem and get source back or did you have enough MacOS knowledge to focus it on specific tasks?
6
u/glorat-reddit Oct 20 '26
After picking up NetHack in 1987, I was inspired to write my first computer programs in 1988 in BASIC on a Pre-computer 1000. My career is software so I'm as old school as you can get. AI for coding needs to be used very responsibly lest trouble brew in the world.
Fixing the original 3.6.0 port was mainly just a recompile on modern tooling (to fix the light/dark mode that the AppStore version suffers on). I did initially vibe code the 5.0.0 port, it succeeded, it launched, the game was playable for a bit... then I realised how much wrong it got. Changes in extended commands, tiles. Actually reading the code makes it obvious. Then the UI changes/bug fixes, I do those one by one with clear view on what the issue is and how they are to be done (with knowledge on how UI frameworks work), tested and reviewed.
Where AI was largely let loose was making tilesets. I got it to make 3 different styles with nano-banana. The one you see now, I chose. Then had it make a review page to compare my tiles with the original and fine tune the designs. It could probably use some work (some potion styles are off, some gems and runed items have that annoying AI glare, and the walled terrain is a bit simplistic) but I like it anyway for me :)
And finally the quality trade secret that the new modern world should do more of with AI - a UI regression test suite to cover the rendering of the various widgets and scenarios that were previous bug fixes. TDD with red green is a skill every human should enforce on an AI.
Hope that gives some insight on how to code with quality in this era!
1
u/SicSemperTyrannis Oct 20 '26
Thanks for the thoughtful response!
It feels aligned with my understanding too. If you can use it as a tool with an outcome that you can verify, it works great.
About to fire up the port.
1
u/AbacusWizard Oct 19 '26
Related question—is it currently possible to run 5.0 via the Terminal command line on a Mac? I’ve been playing 3.6.6 that way for years and years and I’d like to upgrade to 5.0 but the last time I actually installed something with Terminal was, er, Nethack 3.6.6 and it’s been so long I forget how I did it.
1
u/glorat-reddit Oct 20 '26
brew install nethack
should do it
1
u/AbacusWizard Oct 20 '26
Hm… trying that gives me a bunch of l_require messages, with “Error: 'git' must be installed and in your PATH!” in the middle.
1
u/glorat-reddit Oct 20 '26
Looks like a homebrew issue. Some chat tool can probably help you out on that! - Or
xcode-select --install
1
u/teddyfresh713 Oct 20 '26
Recently this iOS version has been fun. I don’t have a Mac that’s working atm to try this version.
Hopefully I can try the Mac version soon.
1
u/glorat-reddit 29d ago
Ask and ye shall receive.
I've built a Cocoa port at https://nethack.app that is borderline iOS playable in theory. I don't have time to personally test it and don't know if there is genuine interest in such a thing... but if people support and give feedback I think iOS support is not far off at all. Then this would be bona fide NetHack 5.0.0 runnable on tablet in offline mode!
2
2
1
1
u/CrazyCatLady483 7d ago
You are a legend! My childhood memories of playing with my dad on our computer have been revived!
1
3
u/yamamushi Ascended Val Oct 19 '26
Thank you so much!