Windows support: portable local server launch + clean quit, %APPDATA% data dir, Win32 libs, MinGW/MSVC build docs

This commit is contained in:
Gabe
2026-10-02 15:44:12 -05:00
parent 238cd9c6c3
commit 34fa21139f
8 changed files with 326 additions and 53 deletions

View File

@@ -56,6 +56,56 @@ ninja -C build # safari_client, safari_server, safari_bot
Server only (no GPU needed): `cmake -S . -B build_srv -G Ninja -DBS_BUILD_CLIENT=OFF`.
Built files load assets from the source checkout (`BS_ASSET_DIR` and the engine's asset path are
baked in at configure time), so run them where they were built.
### Windows (MSYS2, recommended)
Install [MSYS2](https://www.msys2.org/) and open the **MSYS2 UCRT64** shell:
```sh
pacman -S --needed git mingw-w64-ucrt-x86_64-{gcc,cmake,ninja,pkgconf,glfw,glm,libepoxy,sqlite3,nlohmann-json}
git clone ssh://git@git.gabjimmy.com:30009/Gabe/Vibe-HD-2D.git
git clone <this repo> Brandling-Safari # side by side with Vibe-HD-2D
cd Brandling-Safari
cmake -S . -B build -G Ninja
ninja -C build # safari_client.exe, safari_server.exe, safari_bot.exe
./build/safari_client.exe
```
The executables find `glfw3.dll`, `libepoxy-0.dll`, `libsqlite3-0.dll` and
`libwinpthread-1.dll` on the UCRT64 shell's `PATH`. To start the game from Explorer or a shortcut,
copy them next to the executables once:
```sh
ldd build/safari_client.exe build/safari_server.exe | grep -i /ucrt64/ | awk '{print $3}' | sort -u | xargs -I{} cp {} build/
```
### Windows (Visual Studio + vcpkg)
In an **x64 Native Tools Command Prompt for VS 2022**:
```bat
git clone https://github.com/microsoft/vcpkg C:\vcpkg && C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg install glfw3 glm libepoxy sqlite3 nlohmann-json --triplet x64-windows
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build
build\safari_client.exe
```
vcpkg copies the DLLs next to the executables. The MinGW build is verified (zero warnings);
the MSVC build has not been compiled yet, so expect possible small fixes there.
Windows notes: the client has no console window. Your identity and a hosted game's `world.db`
and `server.log` live in `%APPDATA%\brandling-safari`. The first time a server runs, allow it
through Windows Defender Firewall on private networks so LAN players can join (UDP 27420 for the
game, 27421 for discovery). The art tools in `tools/` work on Windows with Python 3 (`pip install
requests pillow numpy`); only Company_Sprite_Gen's part-library generator (`pixellab_library.py`)
is Linux/macOS-only.
## Playing
```sh