Preparations
Devices
You need the following devices to follow these instructions:
- Windows computer — Windows 10 or later, 16 GB or 32 GB RAM, 512 GB or 1 TB SSD space.
Software
- Install the latest Visual Studio version with up-to-date support for .NET MAUI 10.0.
ℹ️ Note: To build the native engine (
GnollHack.sln), you must also install the Desktop development with C++ workload and the Windows 10/11 SDKs. - Clone this GnollHack repository — Clone Repository in Visual Studio.
Build
- Install Tile Sets and FMOD Sound Banks.
- Install Secrets File.
- (Note: You do not need to build the legacy Xamarin.Forms app projects, but you do need the converted XAML UI files. If you are starting fresh or editing XAML files, build the native solution using the Android+Windows configuration first to run the XAML translation. > ⚠️ Warning: The
Android+Windowsconfiguration requires a running WSL environment with SSH configured, as it cross-compiles the Android libraries. If you are building purely for Windows and do not have WSL set up, choose the x64 configuration and run the XAML translation step manually via themakedefsdroidproject.) - Locate
GnollHack.slnin thewin\win32\vsdirectory and open it — Open GnollHack Solution in Visual Studio. - Choose the x64 solution platform in the menu bar for a pure Windows build. (Or Android+Windows if you have WSL configured and need the Android libraries / automatic XAML translation.)
- Select Debug as your solution configuration. You can also use Release, when you plan to build a release build.
- Rebuild the GnollHack solution.
- This will compile the native C library (
gnollhackwin.dll) and copy it together with FMOD runtime DLLs towin\win32\xpl\GnollHackM\Platforms\Windows\libs. - It will also create the NetHack game data file called
nhdatin Windows format, and copy it together withdefaults.gnh,license,symbols,sysconf,xcredits, andrecordtowin\win32\xpl\GnollHackM\Platforms\Windows\gnh. - (It will also build ASCII and GUI versions of GnollHack. You may want to check out Build Instructions for ASCII Version on Windows and Build Instructions for Windows GUI Version on Windows for reference.)
- This will compile the native C library (
- Locate
GnollHackM.slninwin\win32\xpl\GnollHackMdirectory and open it in Visual Studio. - Rebuild the GnollHackM solution.
🛠️ CLI Build Commands
You can also build from the command line:
# Build native solution
$msbuild = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
& $msbuild win/win32/vs/GnollHack.sln /t:Rebuild /p:Configuration=Debug /p:Platform=x64
# (Optional) Run XAML translation manually if building x64 and modifying XAML (requires WSL SSH running)
& $msbuild win/win32/vs/makedefsdroid.vcxproj /t:Build /p:Configuration=Debug /p:Platform=x64
# Build MAUI solution
dotnet build win/win32/xpl/GnollHackM/GnollHackM.csproj -c Debug -f net10.0-windows10.0.19041.0
See also: Troubleshooting Building GnollHack with .NET MAUI
Starting Debugging or Creating Archive
- Open GnollHackM Solution in Visual Studio. This is different from the normal GnollHack solution.
- Select the right solution configuration in the menu bar:
- Debugging — Select Debug.
- Archiving — Select Release.
Debugging
- Rebuild Solution.
- Hit the green Start button to start debugging.