Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
nimby sync "${{ github.event.repository.name }}/nimby.lock"
- name: Run release tests and all-game determinism
run: nim r -d:release -d:audioTest -d:bassyNativeStrict -d:replayEvents tests/all.nim
- name: Test display settings
run: nim r -d:release tests/test_displays.nim
- name: Test lockstep training API
run: nim r -d:release -d:headless -d:bassyNativeStrict games/gods_of_the_arena/tests/test_lockstep.nim
- name: Test presentation audio without an output device
Expand Down
13 changes: 6 additions & 7 deletions games/gods_of_the_arena/tools/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ and select the compiler version used for this guide:
```sh
nimble install -y nimby
export PATH="$HOME/.nimble/bin:$HOME/.local/bin:$PATH"
nimby use 2.2.10
nimby use 2.4.0
export PATH="$HOME/.nimby/nim/bin:$PATH"
nim --version
git lfs version
Expand All @@ -74,18 +74,17 @@ Run this block from the directory where you want that workspace:
mkdir gota-workspace
cd gota-workspace
git lfs install
git clone https://github.com/Metta-AI/polyworld.git
git clone https://github.com/Metta-AI/polyworld_art.git
git clone https://github.com/softmax-universe/polyworld.git
git clone https://github.com/softmax-universe/polyworld_art.git
git -C polyworld_art lfs pull
nimby create
nimby install polyworld/polyworld.nimble
nimby sync polyworld/nimby.lock
cd polyworld
```

The install step includes dependencies declared in the Nimble file. The sync
step then applies the repository's dependency lock file.
Run both steps from `gota-workspace`, not from inside the `polyworld` checkout.
The sync step installs the repositories and exact revisions recorded in
`nimby.lock`. Run it from `gota-workspace` so dependencies become siblings of
the `polyworld` checkout.
Assets now live in `polyworld_art`, not the older `polyworld_data` repository.
For assets stored elsewhere, set `POLYWORLD_ART` to that checkout's absolute path.

Expand Down
12 changes: 6 additions & 6 deletions nimby.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ bassy 0.1.0 https://github.com/treeform/bassy a9effcaab13abc9dfe42d7658cf87ee478
curly 1.1.1 https://github.com/treeform/curly 29558e2d2b76244a2c65fea08e9f4efff16c1997
libcurl 1.0.0 https://github.com/Araq/libcurl eecbfc31e17ae2f09f0b6d2aaefcfb970c7d2be4
fixxy 0.1.0 https://github.com/treeform/fixxy 05e5446dffb70093056cebb0c57721a60deaf52a
silky 0.2.0 https://github.com/treeform/silky 6816ab1fa1260acb0afd06ee8e86a5c1d0202b09
pixie 6.1.0 https://github.com/treeform/pixie 17f3fc06705d493ff97dc050af02bf09d3844369
silky 0.2.0 https://github.com/treeform/silky a68b2524d5e21e06f8098f19e78b145237f3f8f2
pixie 6.1.0 https://github.com/treeform/pixie 0d89de14462790de0aaf451717a60ea3908bf98d
vmath 3.0.0 https://github.com/treeform/vmath bc260143102153b76328783e1c76c96e52c52a4b
chroma 1.0.0 https://github.com/treeform/chroma 08b0d65590221bb964544fd9badf29a146b9091a
zippy 0.10.20 https://github.com/treeform/zippy c625c0cee926c30126493581b237aeb861d8849c
Expand All @@ -12,9 +12,9 @@ nimsimd 1.3.2 https://github.com/treeform/nimsimd dd27017fbfd1c6c00d37776a8f5d32
bumpy 1.1.3 https://github.com/treeform/bumpy 93583f6f8056a6259aaa96c89f4c143ba55bc6f0
spacy 0.0.4 https://github.com/treeform/spacy fe53651c7740bda18cd657bdadbb8d98f7d37d0e
pathy 0.0.2 https://github.com/treeform/pathy d8cbb2af4876842069ab54530fad114692f873f4
crunchy 0.1.11 https://github.com/treeform/crunchy 98eb6526982bb8aae8eec6e8781f4539fa19e049
crunchy 0.1.11 https://github.com/treeform/crunchy 04ec91b0d6ced30447e66468b7e8173e07c422b9
shady 0.1.5 https://github.com/treeform/shady faf1079b35e488adac986e552d6e04bf2a878a38
windy 0.5.0 https://github.com/treeform/windy bf6b93d872de6826a69b34752c6d766e46204530
windy 0.5.0 https://github.com/treeform/windy 69874af89646c57d49ce50501f0f43fb855b2fd0
slappy 0.4.0 https://github.com/treeform/slappy c7c81acc468af632fcc8155c92dec48676c098ad
openal 0.2.0 https://github.com/treeform/openal 1882b562f3d550959794f8b09a1d7538404f300c
supersnappy 2.1.4 https://github.com/treeform/supersnappy 81bf6974ebb928fbd5254c6a5919ec6b82896b79
Expand All @@ -25,8 +25,8 @@ dx12 0.1.0 https://github.com/treeform/dx12 65049f4e2ec1acbbf1987bfa79817d472650
vk14 0.1.0 https://github.com/treeform/vk14 183cf440d6460d97c6b35d6346079d9982f8cd57
metal4 0.1.0 https://github.com/treeform/metal4 eaec6cef21c446d512bbf18e6fa949eeae47a583
jsony 1.1.6 https://github.com/treeform/jsony ce1ea84458c721947bd8e86ec065eeefab2656f1
fluffy 1.0.0 https://github.com/treeform/fluffy 535c5f234b41cd097b762203b5c216da1f4aeb1c
gltf 0.2.0 https://github.com/treeform/gltf adbf72a1dbfe797e5b87136cf9c1ad6665b222d9
fluffy 1.0.0 https://github.com/treeform/fluffy 85e37b8e544ff53301fe3f84a4a499b1720f88cd
gltf 0.2.0 https://github.com/treeform/gltf 0673a92c515966852c91f9f987bb899d0f6794e9
webby 0.2.1 https://github.com/treeform/webby fe515be4ab5d02695289f88fca0d27f703a05599
noisy 0.4.5 https://github.com/treeform/noisy 9625ee0a9dbdae44c427df95a4f8de006c061150
benchy 0.1.0 https://github.com/treeform/benchy 6425417b578dc54008285aad020625b4b4f61f7b
Expand Down
24 changes: 14 additions & 10 deletions src/polyworld/displays.nim
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,20 @@ when not defined(emscripten):
Windowed

proc windowSizeLimit*(window: Window): IVec2 =
## Leaves room for window decorations and the desktop on the current screen.
let screens = getScreens()
if screens.len == 0:
return window.size
var screen = screens[0]
for candidate in screens:
if window.pos.x >= candidate.left and window.pos.x < candidate.right:
screen = candidate
break
((screen.size.vec2 - vec2(80, 140)) * window.contentScale).ivec2
## Leaves desktop room when the backend can enumerate screens.
when declared(getScreens):
let screens = getScreens()
if screens.len == 0:
return window.size
var screen = screens[0]
for candidate in screens:
if window.pos.x >= candidate.left and window.pos.x < candidate.right:
screen = candidate
break
((screen.size.vec2 - vec2(80, 140)) * window.contentScale).ivec2
else:
# Do not cap requested resolutions at the current window size.
ivec2(int32.high, int32.high)

proc updateWindowSettings*(window: Window) =
## Applies queued OS changes outside drawing and waits for fullscreen.
Expand Down
7 changes: 7 additions & 0 deletions tests/test_displays.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import
windy,
polyworld/displays

when not defined(emscripten) and not declared(getScreens):
let limit = Window(nil).windowSizeLimit()
for resolution in WindowResolution:
let size = resolution.resolutionSize()
doAssert size.x <= limit.x and size.y <= limit.y,
"Backends without screen enumeration must allow every size preset"

when defined(macosx) and not defined(emscripten):
import windy/platforms/macos/macdefs

Expand Down
7 changes: 4 additions & 3 deletions tools/gameserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM ubuntu:24.04 AS compiler
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc git curl ca-certificates xz-utils \
gcc libc6-dev git curl ca-certificates xz-utils \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://github.com/nim-lang/nightlies/releases/download/2026-04-24-version-2-2-bfeb3146d1638b39f69007a4ae5a23e23ae4e5ef/nim-2.2.10-linux_x64.tar.xz \
| tar xJ -C /opt
ENV PATH=/opt/nim-2.2.10/bin:$PATH
WORKDIR /src/polyworld
COPY nimby.lock nimby.lock
COPY coworld/tools/sync_dependencies.nim coworld/tools/tooling.nim coworld/tools/
RUN nim r --hints:off coworld/tools/sync_dependencies.nim
ENV POLYWORLD_DEPS=/src/polyworld/tmp/coworld/deps
RUN nim r --hints:off coworld/tools/sync_dependencies.nim
COPY config.nims config.nims
COPY src/polyworld/rooms.nim src/polyworld/relays.nim src/polyworld/
COPY src src
COPY games/gods_of_the_arena games/gods_of_the_arena
COPY tools/gameserver.nim tools/gameserver.nim
RUN nim c --threads:on -d:release -o:/out/gameserver tools/gameserver.nim
FROM ubuntu:24.04
Expand Down
Loading