aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 9d43332df387a95c9eb24c531b0d54f6080c9c06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# LibreForts

Open-source clone of Forts, a 2D physics artillery RTS. Custom C++ engine,
content driven by Lua. Work in progress. See CLAUDE.md for details.

## Stack

C++20, Meson/Ninja, SDL3, Dear ImGui, a custom mass-spring physics solver,
Lua 5.4 with sol2, and stb_image. Box2D is linked but idle; bgfx, SoLoud, ENet
and EnTT are planned but not yet wired up.

## Build and run

### Container (reproducible, any distro)

```sh
podman build -t forts-clone-dev .
podman run --rm -v "$PWD":/src:Z --userns=keep-id localhost/forts-clone-dev:latest \
  sh -c "cd /src && meson setup builddir && meson compile -C builddir"
./builddir/forts-clone   # run from repo root
```

The container builds every dependency into `/usr/local` and links Lua
statically, so the resulting binary runs on any host. You still run it on the
host (it needs the host's SDL3 and a display).

### Local (Arch Linux)

`meson.build` falls back to system packages, so a native build only needs the
libraries the code actually uses. bgfx, SoLoud, ENet and EnTT are part of the
planned stack but not yet wired up, so they are not required to build.

```sh
# repo packages
sudo pacman -S --needed meson ninja gcc pkgconf sdl3 lua54 glm box2d

# sol2 (header-only Lua bindings) from the AUR, e.g. with an AUR helper
paru -S sol2        # or: yay -S sol2

meson setup builddir
meson compile -C builddir
./builddir/forts-clone   # run from repo root
```

Native builds link Lua dynamically against the system `lua54`, which is fine
when you build and run on the same machine.

### Removing the container image

```sh
podman rmi localhost/forts-clone-dev:latest   # drop the dev image
podman image prune -f                         # drop dangling build layers
rm -rf builddir                               # meson dir, reconfigure after
```

## Assets

The repo ships CC0 placeholders only. If you own Forts, real textures load at
runtime from your install via `forts:` paths (set `$FORTS_DATA`). Nothing
copyrighted is stored here. Forts is copyright EarthWork Games.