Server launcher and start-up checks for other machines

- server/run_server.sh: checks Godot is 4.7+, imports a fresh copy once
  (the class cache in .godot/ isn't in git), then starts the server
- The dedicated server refuses to start, with a clear reason, on Godot
  older than 4.7 or when the game's scripts failed to load, instead of
  claiming to listen
- tests/run_all.sh imports a fresh copy first
- Setup doc: 4.7+ (not 4.3+), importing a fresh copy, running a server
This commit is contained in:
Paul Bailey
2026-11-04 15:34:28 +00:00
parent d0f473e57b
commit ae2592822e
4 changed files with 97 additions and 4 deletions

View File

@@ -4,14 +4,39 @@ This project is a self-contained git repo. Everything needed to build and run is
in it except **Godot itself** (which you install once per machine). No assets to
download — the M0 world is generated in code.
## 1. Install Godot 4.3+
## 1. Install Godot 4.7+
- **macOS / Windows / Linux:** download the *standard* build (NOT the .NET/C#
build — this project is pure GDScript) from https://godotengine.org/download
- Use **4.7.x or newer 4.x**. The project was upgraded to `4.7.2.stable` (an
older editor will warn that the project is from a newer version).
- Use **4.7.x or newer 4.x**. The project is on `4.7.2.stable`. **Older
versions (4.3 etc.) can't run it**: they fail with script errors. Check
with `godot --version`, or `/Applications/Godot.app/Contents/MacOS/Godot
--version` on a Mac.
- macOS shortcut: `brew install --cask godot`. If Homebrew can't unpack it,
download the zip from the GitHub release page and move `Godot.app` to
`/Applications`.
`/Applications` (replacing any older one).
## 2. First run on a fresh copy: import once
Godot keeps its list of named classes (e.g. `Inventory`) in `.godot/`, which
isn't in git. Opening the project in the editor creates it. If you only run
**headless** (a server, or the tests), import once after cloning:
```bash
godot --headless --path . --import
```
Without it you get errors like `Could not find type "Inventory"`.
`server/run_server.sh` and `tests/run_all.sh` do this for you.
## 3. Running a dedicated server
```bash
server/run_server.sh # settings from server.json
server/run_server.sh --server-name "Paul's island" --password secret --port 24242
```
It checks the Godot version, imports a fresh copy, then starts the server on
UDP 24242 with no window. Settings live in `server.json` (its path is printed
at start-up; on macOS it's under
`~/Library/Application Support/Godot/app_userdata/Valheimlike/server/`).
Stop it with Ctrl+C. Players join with **Join Game** on the title screen. Over
Tailscale, use the server machine's 100.x address or its machine name. See
`docs/MULTIPLAYER_PLAN.md` for all the options.
## Tests
Run everything (fails on any failed check or script error):