Getting rid of bones levels on Nethack Cocoa

macosnethack

I have been plagued by a problem. I think something's out to kill me (although considering I'm playing Nethack, that "something" is "everything"). Specifically, I'm getting into trouble for something one of my past lives did (namely dying). That death left behind the bones level from hell.

For a level fairly early in the game (not even in the double digits), there are quite a few nymphs (at least four). Not five steps into this level and my armor, weapons, spellbooks, and rations are usually gone (along with my dignity). Invariably, I die on this level (again).

I know that I can go into the playground folder and delete the bones file so this cursed level won't plague me again. However, I don't know where the playground folder is for OSX. Barring that, is there any other way to remove the bones file?

Best Answer

There are two versions of NetHack Cocoa: a standalone version and a Mac App Store version. These store their data in different locations.

According to the source code, standalone NetHackCocoa should set HACKDIR (the internal variable that defines the location of the playground) to ~/Library/NetHackCocoa. You should find your bones file somewhere under there.

If you have the Mac App Store version, things are a little bit more complicated since Apple started enforcing sandboxing of apps. NetHackCocoa will run the same or very similar code, but get back a folder inside its Sandbox Bundle. According to Apple's documentation, Bundles are stored in ~/Library/Containers/ inside an app-specific folder named after the app's "bundle ID". Inside that Bundle will be a replication of the whole Library folder tree, for exclusive use of the app. In this case, your bones file should be in ~/Library/Containers/<bundle_id>/Data/Library/NetHackCocoa or something similar. You can't open a Bundle by double-clicking it, but you can right-click and choose "Show Package Contents", just like you can with an Application Bundle.

Bundle IDs are chosen by the app developer, so they should be something recognisable just by browsing that folder, but they can also be something unhelpful like "MatthewCarpenterMyApp". If you don't have many Mac App Store apps, it should be easy to find since there won't be many to look for. If you have a lot though, it is hopefully something helpful like "NetHackCocoa".