Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24ddaecd78 | ||
|
|
dedb3755d4 | ||
|
|
d86e8b01ee | ||
|
|
3a917551ca | ||
|
|
d17ecdd6ad | ||
|
|
3c7fe4594c | ||
|
|
63fd36775e | ||
|
|
83ae96e2d7 | ||
|
|
99c2030784 | ||
|
|
fbc71b42de | ||
|
|
cfb212fed9 | ||
|
|
782f4ce1bd | ||
|
|
f1066974ca | ||
|
|
384d9ba5d0 | ||
|
|
4cb621cd26 | ||
|
|
4e9de9a11c | ||
|
|
4ab042e144 | ||
|
|
962c3eca45 | ||
|
|
ce95f7deed | ||
|
|
a20ced034c | ||
|
|
ef0e3be45b | ||
|
|
5744d2d174 | ||
|
|
fc22e8467d | ||
|
|
9a1160573f | ||
|
|
1d38b3f936 | ||
|
|
038252b1ae | ||
|
|
61621e6513 | ||
|
|
1d79584ea4 | ||
|
|
577f718a63 | ||
|
|
b68d259c81 | ||
|
|
600edf7bb9 | ||
|
|
0b3b6f0749 | ||
|
|
343716689d | ||
|
|
35554cd243 | ||
|
|
a0f22cbba7 | ||
|
|
9f04a51259 | ||
|
|
1ea29f7675 | ||
|
|
47981601da | ||
|
|
a4e4bd8317 | ||
|
|
3975480a3b | ||
|
|
d4687b24e2 | ||
|
|
9d65e7e63f | ||
|
|
f3ce8c3bf0 | ||
|
|
bce5c2b560 | ||
|
|
9044950d78 | ||
|
|
9d7436bd64 | ||
|
|
8097ac23b0 | ||
|
|
9662f0f6cb | ||
|
|
951b8387dd | ||
|
|
a84f8c87f9 | ||
|
|
cdce33647a | ||
|
|
34c17f11fc | ||
|
|
6ec42856d7 | ||
|
|
399ead3f46 | ||
|
|
d49973e426 | ||
|
|
575f69d2a3 | ||
|
|
79ff0cb1ee | ||
|
|
2f625ae360 | ||
|
|
c97a2d124c | ||
|
|
218f629535 | ||
|
|
ab72ff14db | ||
|
|
31ba6b37d8 | ||
|
|
f8620d62b0 | ||
|
|
c593ee4478 | ||
|
|
9f89f9253d | ||
|
|
22f8beb771 | ||
|
|
ad0c99d753 | ||
|
|
733cd78a1e | ||
|
|
11abcf65f3 | ||
|
|
d265c2ad41 | ||
|
|
59b1ea7548 | ||
|
|
b83e8b5a5d | ||
|
|
9f024543b7 | ||
|
|
9f4c675c32 | ||
|
|
801d51c9ae | ||
|
|
ede2a251fb | ||
|
|
54c52c84e3 | ||
|
|
1dedc8b33f | ||
|
|
837443532c | ||
|
|
0a5a553881 | ||
|
|
789d0b2915 | ||
|
|
40d9017e68 | ||
|
|
bcecef568c | ||
|
|
bfd949a34a | ||
|
|
84e7b5add2 | ||
|
|
75912da87e | ||
|
|
469d03f57a | ||
|
|
cdc3bab723 | ||
|
|
4d0bd56968 | ||
|
|
8e9ee175a9 | ||
|
|
03e28a245e | ||
|
|
6875132aec | ||
|
|
aecdd895d5 | ||
|
|
310eed25f1 | ||
|
|
4769d75170 | ||
|
|
16bcdc4b0e | ||
|
|
5b258a7c20 | ||
|
|
ba45f95bf8 | ||
|
|
cd7262c516 | ||
|
|
56b06c1b94 | ||
|
|
19b1df8f59 | ||
|
|
15495116c5 | ||
|
|
5fd319d00b | ||
|
|
ff76b33f0b | ||
|
|
69ec31a49d | ||
|
|
b97c4ad155 | ||
|
|
9057384308 | ||
|
|
86a1173f14 | ||
|
|
54a9c8f0e6 | ||
|
|
e00bbc610b | ||
|
|
f1c2861da5 | ||
|
|
e595f89c1b | ||
|
|
5aafe7af9e | ||
|
|
04a63d9094 | ||
|
|
34002780ce | ||
|
|
44da7f8265 | ||
|
|
81faf309bb | ||
|
|
e075fffa28 | ||
|
|
76984235b7 | ||
|
|
62058ba925 | ||
|
|
87643c392d | ||
|
|
397e199690 | ||
|
|
74649ec993 | ||
|
|
2759fc6db7 | ||
|
|
5ead9910a8 | ||
|
|
336dc0d262 | ||
|
|
fb8a0e63ca | ||
|
|
329d311c16 | ||
|
|
87d0c46bf6 | ||
|
|
60e568235d | ||
|
|
b5099759a5 | ||
|
|
7b91023137 | ||
|
|
3a49815b2f | ||
|
|
fc67022b2e | ||
|
|
9c571c1bce | ||
|
|
dca73bbe65 | ||
|
|
e6998a4273 | ||
|
|
8a79394aff | ||
|
|
7b447b1065 | ||
|
|
7351c3998e | ||
|
|
64084d77af | ||
|
|
1eb3db02d9 | ||
|
|
b6dba5a621 | ||
|
|
4e1d97ee22 | ||
|
|
94209aaaf6 | ||
|
|
89719c7422 | ||
|
|
66d787cf13 | ||
|
|
e708a64461 | ||
|
|
c2e06963a6 | ||
|
|
67f1719d0e | ||
|
|
4c736be46a | ||
|
|
6ec6e565b4 | ||
|
|
61c328f0dc | ||
|
|
ff6cbeb7f5 | ||
|
|
e931bc7b44 | ||
|
|
a6e7a3a7a0 | ||
|
|
167d67ec2f | ||
|
|
7153e0b717 | ||
|
|
81a79fdf74 | ||
|
|
0a32d97bae | ||
|
|
3c67ccc6c1 | ||
|
|
c90c5a2078 | ||
|
|
b68c0a650d | ||
|
|
494523978e | ||
|
|
592b01a7c6 | ||
|
|
f7f5c5b003 | ||
|
|
7fcb46d1df | ||
|
|
fc51992a7e | ||
|
|
f066c257c9 | ||
|
|
f3912112b2 | ||
|
|
4126d5e3d2 | ||
|
|
7f625aa3a0 | ||
|
|
465ab85e66 | ||
|
|
feac00205d | ||
|
|
a3c65cd041 | ||
|
|
2e0bf83819 | ||
|
|
15f2417f6a | ||
|
|
6e03bc9199 | ||
|
|
2de41ae5fd | ||
|
|
4973c5f1d5 | ||
|
|
b24b89f920 | ||
|
|
c9f3d07eb5 | ||
|
|
c827e29b63 | ||
|
|
d692e067cb | ||
|
|
ab2533a1a3 | ||
|
|
4f0313af55 | ||
|
|
904fbbfc1e | ||
|
|
ce59b93165 | ||
|
|
a321e98fd0 | ||
|
|
a9bfd7d4fa | ||
|
|
5e1cb4ced7 | ||
|
|
518a628553 | ||
|
|
c8cbc3e3cb | ||
|
|
05d7fd38fc | ||
|
|
3f06bf815f | ||
|
|
2223f94579 | ||
|
|
8453be8dc3 | ||
|
|
e0cf4f8809 | ||
|
|
f1f33b05d1 | ||
|
|
88eb3e3c73 | ||
|
|
88b0290186 | ||
|
|
572c674e43 | ||
|
|
d161df18ed | ||
|
|
607da50209 | ||
|
|
d490fd8bd4 | ||
|
|
9f6ea739b8 | ||
|
|
168a4718a8 | ||
|
|
a4ea7f478e | ||
|
|
1081f981fc | ||
|
|
d55174f3a0 | ||
|
|
0393f54f26 | ||
|
|
4614e00eab | ||
|
|
7270ddc069 | ||
|
|
63786f98e5 | ||
|
|
d8e77289db | ||
|
|
a4a5b4633f | ||
|
|
79e5c979e0 | ||
|
|
951ec3b017 | ||
|
|
1330f0bdaf | ||
|
|
8295f446c7 | ||
|
|
c53c31c00b | ||
|
|
4cbec6c826 | ||
|
|
711aa46d0c | ||
|
|
ed54b29c7b | ||
|
|
f396577e8f | ||
|
|
e2e62e706a | ||
|
|
7a1a9d017c | ||
|
|
c6c02192ff | ||
|
|
142ab20ba2 | ||
|
|
1b03880209 | ||
|
|
e6fdb07c39 | ||
|
|
c91badc15b | ||
|
|
90bf6fcb3a | ||
|
|
558f85f803 | ||
|
|
6337fb45d2 | ||
|
|
a22dd332f7 | ||
|
|
10b461b739 | ||
|
|
623bc8ced5 | ||
|
|
1a20d89b9d | ||
|
|
ddfe8b0427 | ||
|
|
7c19ec27ea | ||
|
|
40c1db8abf | ||
|
|
2482087ea8 | ||
|
|
9980b9698e | ||
|
|
689913a09e | ||
|
|
9a19c441f7 | ||
|
|
d1cbce9e7d | ||
|
|
3f2036eabe | ||
|
|
313a1d63c8 | ||
|
|
317b33e406 | ||
|
|
4a275b608d | ||
|
|
1e8ca43cee | ||
|
|
f648b6cb24 | ||
|
|
2dea8f6c70 | ||
|
|
27977a87dc | ||
|
|
a422135709 | ||
|
|
da22f9b453 | ||
|
|
313b6c2191 | ||
|
|
c94e7053e1 | ||
|
|
956387d89f | ||
|
|
dfc738fcc6 | ||
|
|
5db4184dc6 | ||
|
|
b83a259b53 | ||
|
|
c31d985492 | ||
|
|
62379e5614 | ||
|
|
36ea3fb80c | ||
|
|
7d128e1bde | ||
|
|
ecfee9b0b8 | ||
|
|
aa51dfccc6 | ||
|
|
ad8b012089 | ||
|
|
0c3e9f9353 | ||
|
|
2fb25f8101 | ||
|
|
4a5505422c | ||
|
|
beb5fe7d35 | ||
|
|
1f47875802 | ||
|
|
ddc75bc62b | ||
|
|
9e435d02cf | ||
|
|
68f0d2d303 | ||
|
|
30ddad86f6 | ||
|
|
3804028ab5 | ||
|
|
1b496ca7de | ||
|
|
8b2efdb4f2 | ||
|
|
c65fd673d8 | ||
|
|
e7a85652f3 | ||
|
|
6c8842c376 | ||
|
|
2689fcbe25 |
No files matched your search
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: How to install
|
||||
url: https://github.com/Cesarus85/ringfall-mjolnir-vr#install-on-meta-quest-3--3s
|
||||
url: https://github.com/Cesarus85/mjolnir-vr#install-on-meta-quest-3--3s
|
||||
about: Step-by-step installation for the Quest 3 / 3S and the Steam Frame.
|
||||
@@ -13,7 +13,7 @@ name: Build
|
||||
# - a newer push to the same branch cancels a run still going;
|
||||
# - pushes that only change documentation do not build;
|
||||
# - Windows, whose minutes cost twice Linux's, builds only Windows;
|
||||
# - Ringfall: Mjolnir VR builds only Android (the VR app): the Linux and
|
||||
# - Mjolnir VR builds only Android (the VR app): the Linux and
|
||||
# Windows jobs are kept, off (if: false), so that upstream's changes to
|
||||
# them still merge;
|
||||
# - artifacts are kept for three days.
|
||||
@@ -24,7 +24,7 @@ name: Build
|
||||
# gives the latest build; the last five are kept. Its web build is then the
|
||||
# site on GitHub Pages (https://halocombatevolved.com/, port/web/README.md).
|
||||
on:
|
||||
# (Ringfall: Mjolnir VR: main only; its branches are tried on the headsets
|
||||
# (Mjolnir VR: main only; its branches are tried on the headsets
|
||||
# from local builds)
|
||||
push:
|
||||
branches: [main]
|
||||
@@ -52,7 +52,7 @@ env:
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
# (off: Ringfall: Mjolnir VR ships the Android app only)
|
||||
# (off: Mjolnir VR ships the Android app only)
|
||||
if: ${{ false }}
|
||||
# Arch Linux has what the build needs as packages: clang 22 (for the
|
||||
# profile-guided optimisation in pgo/), and CMake, pkg-config and
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
python -m pytest -q tools/test_linux_port.py tools/test_android_asm_convert.py tools/test_host_watch_hash.py tools/test_touch_menu.py tools/harness tools/test_profile.py
|
||||
python -m pytest -q tools/test_linux_port.py tools/test_android_asm_convert.py tools/test_android_mirror_uploads.py tools/test_android_ce_texture_cache.py tools/test_host_watch_hash.py tools/test_touch_menu.py tools/harness tools/test_profile.py tools/stagekit/tests tools/test_net_compare.py
|
||||
python tools/test_light_storage.py
|
||||
|
||||
- name: Compile cache
|
||||
@@ -125,10 +125,15 @@ jobs:
|
||||
- name: Install the toolchain
|
||||
run: |
|
||||
mkdir -p "$RUNNER_TEMP/tools"
|
||||
# (each download checked against the hash it had when it was pinned)
|
||||
curl -fsSL -o ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
|
||||
curl -fsSL -o ccache.tar.xz https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz
|
||||
sha256sum -c - <<'EOF'
|
||||
6f98805688d19672bd699fbbfa2c2cf0fc054ac3df1f0e6a47664d963d530255 ninja.zip
|
||||
80cab87bd510eca796467aee8e663c398239e0df1c4800a0b5dff11dca0b4f18 ccache.tar.xz
|
||||
EOF
|
||||
unzip -q ninja.zip -d "$RUNNER_TEMP/tools" && rm ninja.zip
|
||||
curl -fsSL https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz \
|
||||
| tar -xJ -C "$RUNNER_TEMP/tools" --strip-components=1 ccache-4.10.2-linux-x86_64/ccache
|
||||
tar -xJf ccache.tar.xz -C "$RUNNER_TEMP/tools" --strip-components=1 ccache-4.10.2-linux-x86_64/ccache && rm ccache.tar.xz
|
||||
echo "$RUNNER_TEMP/tools" >> "$GITHUB_PATH"
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
@@ -198,7 +203,7 @@ jobs:
|
||||
retention-days: 3
|
||||
|
||||
windows:
|
||||
# (off: Ringfall: Mjolnir VR ships the Android app only)
|
||||
# (off: Mjolnir VR ships the Android app only)
|
||||
if: ${{ false }}
|
||||
# The runner image has LLVM, Python and Visual Studio's x86 libraries and
|
||||
# Windows SDK.
|
||||
@@ -212,8 +217,11 @@ jobs:
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-WebRequest -OutFile ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip
|
||||
Expand-Archive ninja.zip -DestinationPath "$env:RUNNER_TEMP\tools"
|
||||
Invoke-WebRequest -OutFile ccache.zip https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-windows-x86_64.zip
|
||||
# (each download checked against the hash it had when it was pinned)
|
||||
if ((Get-FileHash ninja.zip -Algorithm SHA256).Hash -ne "F550FEC705B6D6FF58F2DB3C374C2277A37691678D6ABA463ADCBB129108467A") { throw "ninja.zip: unexpected SHA-256" }
|
||||
if ((Get-FileHash ccache.zip -Algorithm SHA256).Hash -ne "6252F081876A9A9F700FAE13A5AEC5D0D486B28261D7F1F72AC11C7AD9DF4DA9") { throw "ccache.zip: unexpected SHA-256" }
|
||||
Expand-Archive ninja.zip -DestinationPath "$env:RUNNER_TEMP\tools"
|
||||
Expand-Archive ccache.zip -DestinationPath $env:RUNNER_TEMP
|
||||
Copy-Item "$env:RUNNER_TEMP\ccache-4.10.2-windows-x86_64\ccache.exe" "$env:RUNNER_TEMP\tools"
|
||||
Remove-Item ninja.zip, ccache.zip
|
||||
@@ -271,7 +279,7 @@ jobs:
|
||||
retention-days: 3
|
||||
|
||||
web:
|
||||
# (off: Ringfall: Mjolnir VR ships the Android app only)
|
||||
# (off: Mjolnir VR ships the Android app only)
|
||||
if: ${{ false }}
|
||||
# Emscripten (emsdk, the version below, cached) builds the web port's
|
||||
# site (port/web/README.md); the tests check its graph, the page's
|
||||
@@ -381,18 +389,26 @@ jobs:
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir release
|
||||
# (Ringfall: Mjolnir VR publishes its Android builds only, under
|
||||
# (Mjolnir VR publishes its Android builds only, under
|
||||
# its own name: Updater.java looks for them; the desktop ports are
|
||||
# built to keep them building)
|
||||
for config in debug release; do
|
||||
(cd "artifacts/halo-android-$config" &&
|
||||
zip -qr "$GITHUB_WORKSPACE/release/ringfall-mjolnir-vr-android-$config.zip" .)
|
||||
zip -qr "$GITHUB_WORKSPACE/release/mjolnir-vr-android-$config.zip" .)
|
||||
done
|
||||
# the Steam Frame's installer (port/android/STEAM_FRAME.md): its
|
||||
# bundle with the release APK, and the desktop file that fetches it
|
||||
python3 tools/steam_frame_bundle.py artifacts/halo-android-release/app-release.apk release "$GH_REPO"
|
||||
# the APK itself, for sideloading on the Quest (SideQuest, adb)
|
||||
cp artifacts/halo-android-release/app-release.apk release/RingfallMjolnirVR.apk
|
||||
cp artifacts/halo-android-release/app-release.apk release/MjolnirVR.apk
|
||||
# the same under the names before "Mjolnir VR" (Ringfall: Mjolnir
|
||||
# VR, builds 302 to 313): their updaters (Updater.java, the Frame's
|
||||
# launcher) and the links already shared ask for them
|
||||
cp release/mjolnir-vr-android-debug.zip release/ringfall-mjolnir-vr-android-debug.zip
|
||||
cp release/mjolnir-vr-android-release.zip release/ringfall-mjolnir-vr-android-release.zip
|
||||
cp release/mjolnir-vr-steam-frame.zip release/ringfall-mjolnir-vr-steam-frame.zip
|
||||
cp release/Install-Mjolnir-VR.desktop release/Install-Ringfall-Mjolnir-VR.desktop
|
||||
cp release/MjolnirVR.apk release/RingfallMjolnirVR.apk
|
||||
ls -l release
|
||||
|
||||
- name: Publish
|
||||
@@ -407,15 +423,15 @@ jobs:
|
||||
readme="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
|
||||
{
|
||||
printf '%s\n\n' "$subject"
|
||||
printf '**Ringfall: Mjolnir VR** is an unofficial VR mod for Halo: Combat Evolved. It needs a disc image of your own, purchased Xbox copy of the game; no game files are included.\n\n'
|
||||
printf '**Mjolnir VR** is an unofficial VR mod for Halo: Combat Evolved. It needs a disc image of your own, purchased Xbox copy of the game; no game files are included.\n\n'
|
||||
printf '| Headset | Download | How to install |\n| --- | --- | --- |\n'
|
||||
printf '| Meta Quest 3 / 3S | `RingfallMjolnirVR.apk` | [Install on Quest](%s#install-on-meta-quest-3--3s) |\n' "$readme"
|
||||
printf '| Steam Frame | `Install-Ringfall-Mjolnir-VR.desktop` (open it in Desktop Mode) | [Install on Steam Frame](%s#install-on-steam-frame) |\n\n' "$readme"
|
||||
printf 'The other files are for the built-in updater and the Steam Frame installer.\n\n'
|
||||
printf '| Meta Quest 3 / 3S | `MjolnirVR.apk` | [Install on Quest](%s#install-on-meta-quest-3--3s) |\n' "$readme"
|
||||
printf '| Steam Frame | `Install-Mjolnir-VR.desktop` (open it in Desktop Mode) | [Install on Steam Frame](%s#install-on-steam-frame) |\n\n' "$readme"
|
||||
printf 'The other files are for the built-in updater and the Steam Frame installer (those named `ringfall-…` / `Ringfall…`: the same, for the builds before the name Mjolnir VR).\n\n'
|
||||
printf 'Commit: %s\nBuild: %s\n' "$COMMIT_URL" "$RUN_URL"
|
||||
} > notes.md
|
||||
gh release create "$tag" release/* --target "$GITHUB_SHA" --latest \
|
||||
--title "Ringfall: Mjolnir VR, build $GITHUB_RUN_NUMBER (${GITHUB_SHA:0:7})" --notes-file notes.md
|
||||
--title "Mjolnir VR, build $GITHUB_RUN_NUMBER (${GITHUB_SHA:0:7})" --notes-file notes.md
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# The Windows builds' executables and PDBs to Sentry, which turns the
|
||||
@@ -457,7 +473,7 @@ jobs:
|
||||
done
|
||||
|
||||
pages:
|
||||
# (off: Ringfall: Mjolnir VR ships the Android app only)
|
||||
# (off: Mjolnir VR ships the Android app only)
|
||||
if: ${{ false }}
|
||||
# The release's web build to GitHub Pages, which serves it at
|
||||
# https://halocombatevolved.com/ (port/web/README.md, "Hosting"). Only
|
||||
@@ -578,7 +594,7 @@ jobs:
|
||||
title="Build failed"; color=15548997
|
||||
fi
|
||||
latest="$SERVER/$REPOSITORY/releases/latest"
|
||||
downloads="[Quest]($latest/download/ringfall-mjolnir-vr-android-release.zip) · [Steam Frame]($latest/download/Install-Ringfall-Mjolnir-VR.desktop) ([all builds]($latest))"
|
||||
downloads="[Quest]($latest/download/mjolnir-vr-android-release.zip) · [Steam Frame]($latest/download/Install-Mjolnir-VR.desktop) ([all builds]($latest))"
|
||||
if [ -n "$RELEASE_TAG" ]; then
|
||||
release="[$RELEASE_TAG]($SERVER/$REPOSITORY/releases/tag/$RELEASE_TAG)"
|
||||
if [ "$PAGES" = success ]; then
|
||||
|
||||
@@ -16,7 +16,7 @@ end.
|
||||
| --- | --- |
|
||||
| `source/` | The game: 466 C files of the decompilation, compiled as they are with few changes (each marked, below) |
|
||||
| `port/linux/src/` | The platform layer the three ports share: Direct3D 8 on OpenGL (`d3d8_gl.c`), DirectSound and XInput on SDL3, files, threads, memory, sockets, settings (`port_config.c`), the mods folder (`port_mods.c`), internet play (`p2p*.c`) |
|
||||
| `port/linux/game/` | The port's game-side code, compiled as the game's sources are: the distributed netcode (`network_*.c`), co-op, map sharing (`map_share*.c`), the menus (`menu_tags.c`, `menu_functions.c`), Custom Edition maps (`custom_edition_*.c`, `cache_file_formats.c`), the tag validator (`tag_validate.c`, `tag_schema_*.c`), mods (`mods.c`, `mod_*.c`), streamer mode's word filter (`text_filter*.c`), touch, FOV and more |
|
||||
| `port/linux/game/` | The port's game-side code, compiled as the game's sources are: the distributed netcode (`network_*.c`), co-op, OpenCE's gametypes (`game_modes.c`, `infection.c`, `gun_game.c`), map sharing (`map_share*.c`), the menus (`menu_tags.c`, `menu_functions.c`), Custom Edition maps (`custom_edition_*.c`, `cache_file_formats.c`), the tag validator (`tag_validate.c`, `tag_schema_*.c`), mods (`mods.c`, `mod_*.c`), streamer mode's word filter (`text_filter*.c`), touch, FOV and more |
|
||||
| `port/linux/include/` | The port's headers: the limits (`halo_port_limits.h`, with `HALO_PORT_NETWORK_VERSION`), capacities (`halo_port_capacity.h`), the prefix header, `halo_linux_source_fixups.h` (port functions the game's sources call) |
|
||||
| `port/include/xdk/` | Stand-ins for the Xbox SDK's headers (declarations only) |
|
||||
| `port/windows/` | The Windows build's own files (`win32_*.c`, headers) |
|
||||
@@ -25,7 +25,7 @@ end.
|
||||
| `port/assets/` | What the builds embed or ship: high-res HUD (`hud/`), fonts, titles, menus (`menus/`), icons, network brokers |
|
||||
| `port/third_party/` | Vendored libraries, each with a README naming its upstream, version and checksum |
|
||||
| `port/tools/` | Stand-alone tools (`cache_file_report.c`) |
|
||||
| `tools/` | Build scripts (`linux_build.py`, `windows_build.py`, `android_build.py`, `web_build.py`, `ci_build.py`, `web_serve.py`), generators (`ce_menus.py`, `port_settings.py`, `hud_assets.py`, `title_assets.py`, `embed_assets.py`, `xdk_headers.py`) and tests |
|
||||
| `tools/` | Build scripts (`linux_build.py`, `windows_build.py`, `android_build.py`, `web_build.py`, `ci_build.py`, `web_serve.py`), generators (`ce_menus.py`, `port_settings.py`, `hud_assets.py`, `title_assets.py`, `embed_assets.py`, `xdk_headers.py`), tests, and `stagekit/` (scenarios staged and instrumented on the real engine, no retail assets) |
|
||||
| `docs/` | Longer design notes (`custom_edition_caches.md`, `mods.md`) |
|
||||
| `pgo/` | Profile-guided optimisation profiles |
|
||||
| `assets/` | Game data for local runs (gitignored: `maps/`, `custom_maps/`) |
|
||||
@@ -39,7 +39,7 @@ ninja linux # build/linux/halo
|
||||
ninja android # the Android guest image and native libraries
|
||||
ninja android_apk # the APK (Gradle)
|
||||
ninja web # build/web/site (Emscripten: port/web/README.md)
|
||||
ninja windows # on Windows only
|
||||
ninja windows # on Windows, or on Linux after configure.py --windows-cross
|
||||
python tools/ci_build.py linux release # what CI builds
|
||||
```
|
||||
|
||||
@@ -83,8 +83,10 @@ setting (`game.custom_edition`), checked at run time with
|
||||
|
||||
```sh
|
||||
python -m pytest -q tools/harness tools/test_touch_menu.py # the engine's functions in a fake world
|
||||
python -m pytest -q tools/stagekit/tests # scenarios on the real engine, no retail assets (Linux)
|
||||
python -m pytest -q tools/test_linux_port.py # the build, the maps' checks (needs assets/maps)
|
||||
python -m pytest -q tools/test_mods.py # mods played over a map (needs assets/maps)
|
||||
python -m pytest -q tools/test_bots.py # the bots in local games (needs assets/maps)
|
||||
python -m pytest -q tools/test_cache_file_formats.py tools/test_bmp_files.py tools/test_profile.py
|
||||
python tools/test_touch_layout.py # the Android touch layout (JDK 17+)
|
||||
python tools/test_light_storage.py
|
||||
@@ -92,10 +94,14 @@ python tools/test_death_timing.py
|
||||
python -m pytest -q tools/test_web_build.py # the web build's graph, sockets, menus
|
||||
node --test "port/web/tests/*.test.js" # the web page's importer and service worker
|
||||
node port/web/tests/webrtc_native.mjs chromium firefox # the native builds' WebRTC with browsers (Playwright)
|
||||
python -m pytest -q tools/test_net_compare.py # net_compare.py's judging of logs, its copies and their processes
|
||||
python tools/net_compare.py --a build/linux/halo --b <other build> --data <game data> --swap
|
||||
# two builds in one network game, in step (retail maps: local only)
|
||||
```
|
||||
|
||||
`tools/harness/README.md` explains how to add an asset-free test: the code
|
||||
under test is taken from the sources, not copied.
|
||||
under test is taken from the sources, not copied. `tools/stagekit/README.md`
|
||||
explains how to add a scenario: the real engine, with no retail assets.
|
||||
|
||||
Running the game without a person at it:
|
||||
|
||||
@@ -232,5 +238,6 @@ The decompilation's upstream, punpckhdq/halo, is AGPL 3.0 from 17 October
|
||||
| [port/assets/menus/UNWIRED.md](port/assets/menus/UNWIRED.md) | Menu functions that do nothing yet |
|
||||
| [port/assets/fonts/README.md](port/assets/fonts/README.md) | The fonts and their licences |
|
||||
| [tools/harness/README.md](tools/harness/README.md) | Asset-free regression tests |
|
||||
| [tools/stagekit/README.md](tools/stagekit/README.md) | Scenarios staged and instrumented on the real engine, no retail assets |
|
||||
| `port/third_party/*/README.md` | Each vendored library |
|
||||
| [AUTHORS.md](AUTHORS.md) | Art credits |
|
||||
@@ -10,6 +10,8 @@
|
||||
weapons' reticles): redraws by MrBruh (`port/assets/hud`), based on
|
||||
reference photos by Aerocatia. The sniper rifle's zoom labels (2x, 10x)
|
||||
are set in Overpass (`port/assets/fonts`).
|
||||
- **The menus' mouse cursor** (the blue arrow the menus show for the
|
||||
mouse): by pugzysixtyfour (`port/assets/cursor`).
|
||||
|
||||
## Third-party art
|
||||
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
<p align="center">
|
||||
<img src="port/android/steam_frame_grid/library.png" width="640" alt="Ringfall: Mjolnir VR">
|
||||
<img src="port/android/steam_frame_grid/library.png" width="640" alt="Mjolnir VR">
|
||||
</p>
|
||||
|
||||
# Ringfall: Mjolnir VR
|
||||
# Mjolnir VR
|
||||
|
||||
**A VR mod for Halo: Combat Evolved** (the original Xbox game) on the
|
||||
**Meta Quest 3 / 3S** and the **Steam Frame**. Play the campaign and
|
||||
multiplayer in full 6DoF virtual reality, with your hands in the game.
|
||||
|
||||
Ringfall: Mjolnir VR runs on your headset by itself, without a PC. It
|
||||
Mjolnir VR runs on your headset by itself, without a PC. It
|
||||
brings no game files: it uses a disc image of **your own, purchased copy**
|
||||
of the game.
|
||||
|
||||
> **Unofficial fan project.** Ringfall: Mjolnir VR is a free,
|
||||
> **Unofficial fan project.** Mjolnir VR is a free,
|
||||
> non-commercial fan project. It is not affiliated with, endorsed,
|
||||
> sponsored or approved by Microsoft, Xbox Game Studios, Halo Studios or
|
||||
> Bungie. See [Legal](#legal).
|
||||
|
||||
Until build 313 it was called *Ringfall: Mjolnir VR*. Installed builds
|
||||
update to the new name by themselves, and the old links lead here.
|
||||
|
||||
## Contents
|
||||
|
||||
- [What you get](#what-you-get)
|
||||
@@ -86,14 +89,14 @@ that it updates itself.
|
||||
2. **Install [SideQuest](https://sidequestvr.com/setup-howto)** (the
|
||||
"Advanced Installer") on your computer and connect the Quest with a
|
||||
USB cable. In the headset, allow USB debugging for this computer.
|
||||
3. **Download `RingfallMjolnirVR.apk`** from the
|
||||
3. **Download `MjolnirVR.apk`** from the
|
||||
[latest release](../../releases/latest) and drag it onto the SideQuest
|
||||
window. It installs the game.
|
||||
4. **Copy your disc image** to the Quest's `Download` folder: in
|
||||
SideQuest, open the file manager (the folder icon), go to `Download`
|
||||
and drag the `.iso` file in.
|
||||
5. **In the headset**, open your *Library*, choose *Unknown Sources* and
|
||||
start **Ringfall: Mjolnir VR**. Select **Choose disc image** and pick
|
||||
start **Mjolnir VR**. Select **Choose disc image** and pick
|
||||
your file in `Download`. The game copies what it needs (about 1.8 GB,
|
||||
a minute or two) and starts.
|
||||
|
||||
@@ -108,14 +111,14 @@ No computer and no keyboard needed.
|
||||
*Switch to Desktop*.
|
||||
2. **Put your disc image** in the `Downloads` folder (for example from a
|
||||
USB stick or memory card with the file manager, Dolphin).
|
||||
3. **Download `Install-Ringfall-Mjolnir-VR.desktop`** from the
|
||||
3. **Download `Install-Mjolnir-VR.desktop`** from the
|
||||
[latest release](../../releases/latest) with the web browser.
|
||||
4. **Open it**: in Dolphin, open `Downloads` and double-click the file.
|
||||
If you are asked whether to run it, choose to continue.
|
||||
5. **Answer the dialogs.** The installer finds your disc image, copies
|
||||
what the game needs, adds **Ringfall: Mjolnir VR** to your Steam
|
||||
what the game needs, adds **Mjolnir VR** to your Steam
|
||||
library and offers to switch back to Gaming Mode.
|
||||
6. Start **Ringfall: Mjolnir VR** from your library (under *Non-Steam*).
|
||||
6. Start **Mjolnir VR** from your library (under *Non-Steam*).
|
||||
|
||||
The game updates itself: when a new version is out, it is downloaded
|
||||
while you play and used from the next start on. Your settings, saves and
|
||||
@@ -155,7 +158,7 @@ telemetry.
|
||||
|
||||
## Credits
|
||||
|
||||
Ringfall: Mjolnir VR stands on the work of others:
|
||||
Mjolnir VR stands on the work of others:
|
||||
|
||||
- **[OpenCE](https://github.com/OpenCommunityEdition/OpenCE)** (Open
|
||||
Community Edition): the port of the decompiled game to Linux, Windows
|
||||
@@ -186,7 +189,7 @@ port it is built on.
|
||||
|
||||
## Legal
|
||||
|
||||
Ringfall: Mjolnir VR is an unofficial, free, non-commercial fan project.
|
||||
Mjolnir VR is an unofficial, free, non-commercial fan project.
|
||||
It is not affiliated with, endorsed, sponsored or approved by Microsoft
|
||||
Corporation, Xbox Game Studios, Halo Studios or Bungie. Halo, Halo: Combat
|
||||
Evolved and Xbox are trademarks of Microsoft Corporation; they are named
|
||||
@@ -201,7 +204,7 @@ their games.
|
||||
|
||||
### Licence
|
||||
|
||||
Ringfall: Mjolnir VR is free software: you can give it to others and change
|
||||
Mjolnir VR is free software: you can give it to others and change
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, version 3 of the License or (at your option)
|
||||
any later version (`AGPL-3.0-or-later`), as OpenCE, which it builds on, is.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Third-party notices
|
||||
|
||||
Ringfall: Mjolnir VR is released under the GNU Affero General Public
|
||||
Mjolnir VR is released under the GNU Affero General Public
|
||||
License, version 3 or later ([LICENSE](LICENSE)); releases before build 312
|
||||
were released under [CC0 1.0](LICENSES/CC0-1.0.txt). It includes or builds
|
||||
on the following, under their own licenses; each license's full text is in
|
||||
|
||||
@@ -16,6 +16,11 @@ from tools.linux_build import check_profile_options, generate_linux_build, linux
|
||||
from tools.web_build import generate_web_build, web_configure_inputs
|
||||
from tools.windows_build import generate_windows_build, windows_configure_inputs
|
||||
|
||||
|
||||
def is_windows() -> bool:
|
||||
return os.name == "nt"
|
||||
|
||||
|
||||
# arguments
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
@@ -89,6 +94,38 @@ parser.add_argument(
|
||||
type=str,
|
||||
help="Emscripten's emcc for `ninja web` (default: emcc on the PATH, then EMSDK's or ~/emsdk's)",
|
||||
)
|
||||
|
||||
# no need to spam those extra flags when running on Windows
|
||||
if not is_windows():
|
||||
parser.add_argument(
|
||||
"--windows-cross",
|
||||
action="store_true",
|
||||
help="generate the Windows build (`ninja windows`) on Linux, cross-compiling "
|
||||
"with clang against an MSVC toolchain (--windows-vctools-dir and --windows-sdk-dir), "
|
||||
"and make it the default target",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--windows-cc",
|
||||
metavar="BINARY",
|
||||
help="compiler for the Windows cross build, `ninja windows` (default: clang). "
|
||||
"Only clang is supported for now.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--windows-vctools-dir",
|
||||
metavar="DIR",
|
||||
type=Path,
|
||||
help="the Visual C++ tools of the MSVC toolchain a --windows-cross build compiles "
|
||||
"and links against: the versioned folder under VC/Tools/MSVC, the one with `include` "
|
||||
"and `lib` (default: VCToolsInstallDir)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--windows-sdk-dir",
|
||||
metavar="DIR",
|
||||
type=Path,
|
||||
help="the Windows SDK a --windows-cross build compiles and links against: the "
|
||||
"folder with `Include` and `Lib`, each with a versioned folder (default: WindowsSdkDir)",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
check_profile_options(args.profile, args.pgo)
|
||||
@@ -110,10 +147,11 @@ sln = SimpleNamespace(
|
||||
android_guest_cc=args.android_guest_cc,
|
||||
web_emcc=args.web_emcc,
|
||||
)
|
||||
|
||||
|
||||
def is_windows() -> bool:
|
||||
return os.name == "nt"
|
||||
if not is_windows():
|
||||
sln.windows_cc = args.windows_cc
|
||||
sln.windows_cross = args.windows_cross
|
||||
sln.windows_vctools_dir = args.windows_vctools_dir
|
||||
sln.windows_sdk_dir = args.windows_sdk_dir
|
||||
|
||||
|
||||
# build.ninja
|
||||
@@ -159,7 +197,7 @@ n.newline()
|
||||
|
||||
# the build for this computer, where it could be generated (the Windows
|
||||
# build is left out when SDL cannot be fetched, for instance)
|
||||
default = "windows" if is_windows() else "linux"
|
||||
default = "windows" if is_windows() or sln.windows_cross else "linux"
|
||||
if f"\nbuild {default}: " in out.getvalue():
|
||||
n.comment("Default rule: the build for this computer")
|
||||
n.default(default)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
> This is the README of [OpenCE](https://github.com/OpenCommunityEdition/OpenCE),
|
||||
> the port Ringfall: Mjolnir VR is built on, kept for its build and
|
||||
> the port Mjolnir VR is built on, kept for its build and
|
||||
> development notes. Its download links are OpenCE's. For the VR mod, see
|
||||
> the [main README](../README.md).
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Android
|
||||
|
||||
The app of Ringfall: Mjolnir VR (application id `io.github.cesarus85.ringfall`;
|
||||
The app of Mjolnir VR (application id `io.github.cesarus85.ringfall`, from
|
||||
the name before, "Ringfall: Mjolnir VR", kept so that installed apps update;
|
||||
its Java classes keep the decompilation's package, `com.halo.decomp`).
|
||||
`ninja android` builds the game for 64-bit ARM Android (arm64-v8a).
|
||||
`ninja android_apk` makes an app from it:
|
||||
@@ -232,7 +233,7 @@ These settings are only for Android:
|
||||
| `display.shader_cache` | `true` (the default): the linked shader programs are kept in `shader_cache` in the data folder (their binaries, the driver that made them and their sources), and each map's list of the programs it drew with; as a map loads, the programs on its list are made ready, so that its first frames do not wait for the driver to compile them. A driver update compiles them again from the kept sources. `false`: each program is compiled the first time it is drawn. The folder may be deleted at any time. |
|
||||
| `display.shader_worker` | `true` (the default): the shader programs are made on a thread of their own, whose GL context shares the game's (loaded from the shader cache, or compiled), and drawn with once there (`debug.shader_warm_up`: `"worker"`, `"load"` on the game's thread as a map loads, or `"off"`); a draw whose program is not made yet is left out for the frames it takes, and the frame does not wait. As a map loads, its own programs and then every map's (`shader_cache/all.txt`) are asked for. `false`: each is made on the game's thread when first drawn with. |
|
||||
| `debug.sample_seconds` | Refer to "Find problems". |
|
||||
| `debug.memory_watch` | `true` (the default): the app notices the game's writes to textures and vertices by page protection. `false`: it compares page contents once a frame instead, which is slower. Refer to "Limits". |
|
||||
| `debug.memory_watch` | `true` (the default): the app notices the game's writes to cached textures by page protection. `false`: it compares page contents once a frame instead, which is slower. Geometry uses the streaming path in either mode. Refer to "Limits". |
|
||||
|
||||
## Internet play
|
||||
|
||||
@@ -542,6 +543,23 @@ assembly of the port is necessary:
|
||||
- The symbol aliases in `guest/libc/src_include/features.h`. The Darwin
|
||||
target does not accept alias attributes.
|
||||
|
||||
## Geometry uploads
|
||||
|
||||
Android streams vertex and index data from the current CPU bytes instead
|
||||
of reusing the persistent geometry mirror or its cached index extents.
|
||||
This is automatic; no console command or configuration change is needed.
|
||||
Affected players reported that bypassing the cache resolved stretched or
|
||||
missing geometry, with some also reporting better performance. The exact
|
||||
cache failure mechanism remains unconfirmed.
|
||||
|
||||
The Android-only guard in `mirror_range` uses the existing streaming
|
||||
fallback. Streamed upload methods, frame fences, shaders, texture caching
|
||||
and CPU write tracking are unchanged. Desktop and web retain their cache.
|
||||
Xbox and Custom Edition maps keep their existing loaders and resource
|
||||
paths. `tools/test_android_mirror_uploads.py` checks the bypass with large
|
||||
and reused ranges, frame-counter rollover and desktop/web cache controls;
|
||||
it does not substitute for device gameplay validation.
|
||||
|
||||
## Find problems
|
||||
|
||||
- Enter `adb logcat -s halo` to see the log of the port and the errors of
|
||||
@@ -571,8 +589,11 @@ assembly of the port is necessary:
|
||||
operate. The Xbox memory uses 4 KB pages.
|
||||
- The x86 Android emulator runs the app through its ARM translation. The
|
||||
translation cannot deliver the page faults that the renderer uses to
|
||||
notice changed textures and vertices. On the emulator the app compares
|
||||
notice changed textures. On the emulator the app compares
|
||||
page contents once a frame instead ("write tracking: page hashes" in the
|
||||
log). This is slower, and a write shows one frame later, so moving
|
||||
geometry can glitch briefly. `debug.memory_watch = false` does the same
|
||||
on a device.
|
||||
log). This is slower, and texture changes may appear one frame later.
|
||||
`debug.memory_watch = false` does the same on a device. The translation
|
||||
also has no scalar conversion from floating
|
||||
point to an integer in a SIMD register (`fcvtzs s0, s1`, an illegal
|
||||
instruction there), so `tools/android_asm_convert.py` writes each as the
|
||||
vector form, which leaves the register and the exception flags the same.
|
||||
@@ -10,10 +10,10 @@ On the Frame, in Desktop Mode (Steam menu > Power > Switch to Desktop):
|
||||
1. Put your own disc image of Halo: Combat Evolved for the original Xbox (`.iso` or
|
||||
`.xiso`, any version) in Downloads (or Documents, the Desktop, a memory
|
||||
card).
|
||||
2. Download `Install-Ringfall-Mjolnir-VR.desktop` from the latest release and open it
|
||||
2. Download `Install-Mjolnir-VR.desktop` from the latest release and open it
|
||||
(double-click; confirm running it).
|
||||
3. Answer the dialogs: the installer finds the disc image (or asks for it),
|
||||
copies the game data out of it, adds "Ringfall: Mjolnir VR" to the Steam library
|
||||
copies the game data out of it, adds "Mjolnir VR" to the Steam library
|
||||
and switches back to Gaming Mode. Start it from the library there.
|
||||
|
||||
The game updates itself: while it runs, its launcher looks for a newer
|
||||
@@ -23,18 +23,20 @@ release, fetches it and puts it in place as the next start begins
|
||||
too (settings, saves and game data stay).
|
||||
|
||||
The desktop file (`steam_frame_installer.desktop`) downloads the latest
|
||||
release's `ringfall-mjolnir-vr-steam-frame.zip` (`tools/steam_frame_bundle.py`, made by
|
||||
release's `mjolnir-vr-steam-frame.zip` (`tools/steam_frame_bundle.py`, made by
|
||||
the release job of `.github/workflows/build.yml`) and runs its
|
||||
`install.sh` (`steam_frame_install.sh`), with zenity dialogs:
|
||||
- `~/Documents/RingfallMjolnirVR`: the launcher (`ringfall-mjolnir-vr.sh`)
|
||||
and the release APK (`RingfallMjolnirVR.apk`); the folder of the builds
|
||||
before the name, `~/Documents/HaloCE`, renamed to it, and their "Halo VR"
|
||||
shortcut replaced;
|
||||
shortcut replaced. (These keep the name of builds 302 to 313, "Ringfall:
|
||||
Mjolnir VR": the Steam shortcut of an installed game starts the launcher
|
||||
there, and the launcher's update looks for them in the bundle.);
|
||||
- the maps folder out of the disc image (`steam_frame_xiso.py`, the app's
|
||||
`XisoExtractor.java` in Python), unless `maps/ui.map` is there;
|
||||
- the Steam shortcut, unless it is there: added by Steam itself
|
||||
(`steam://addnonsteamgame`, as SteamOS's "Add to Steam" does) from
|
||||
`Ringfall Mjolnir VR.desktop` beside the game, then the library pictures
|
||||
`Mjolnir VR.desktop` beside the game, then the library pictures
|
||||
under the id Steam gave it. Steam is not closed: on the Frame, Desktop
|
||||
Mode runs inside Gaming Mode's session, and closing Steam ends it (and the
|
||||
installer with it). An old "Halo VR" shortcut is left for the player to
|
||||
@@ -83,7 +85,7 @@ dialogs, for testing over adb; it leaves Steam and its shortcuts alone.
|
||||
|
||||
## Starting it on the Frame
|
||||
|
||||
A button in the Steam library ("Ringfall: Mjolnir VR", a non-Steam game)
|
||||
A button in the Steam library ("Mjolnir VR", a non-Steam game)
|
||||
runs `~/Documents/RingfallMjolnirVR/ringfall-mjolnir-vr.sh` (`port/android/steam_frame_launch.sh`),
|
||||
which starts the game as Steam starts an Android title of its own:
|
||||
`lepton waitforexitandrun -- ~/Documents/RingfallMjolnirVR/RingfallMjolnirVR.apk`, in a container
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# VR roadmap
|
||||
|
||||
What Ringfall: Mjolnir VR (Quest 3, Steam Frame) has, and what comes next, in the
|
||||
What Mjolnir VR (Quest 3, Steam Frame) has, and what comes next, in the
|
||||
agreed order. Updated with every step: a step is **done** once the user has
|
||||
tried it in the headset and it is merged into `main`; **built** means in a
|
||||
branch, not yet tried in the headset.
|
||||
@@ -24,8 +24,8 @@ named where code is taken over.
|
||||
| Scores | The menu button held shows the scores on the Quest (a press pauses, as it is let go); the Steam Frame's View button as before; the text chat's lines where the desktop has them (2026-10-18) |
|
||||
| Comfort | Snap or smooth turning, a comfort vignette in vehicles, VR options in the main and pause menus (Y), a page of every controller button |
|
||||
| Menus | The PC version's menus in VR (`vr.menus`), clicked with a laser; text typed on the on-screen keyboard |
|
||||
| Multiplayer | Up to date with OpenCE (network version 29, 2026-10-14): cross-play, its server browser, co-op campaign, password lobbies; join codes and the VR online list |
|
||||
| Bots | Bots in multiplayer: on foot (paths, items, objectives), in vehicles and at turrets; they make room for a joining person, on the LAN too (a lobby they fill is advertised open, 2026-10-18) |
|
||||
| Multiplayer | Up to date with OpenCE (network version 32, 2026-10-20; HDR kept off in VR): cross-play, its server browser, co-op campaign, password lobbies; join codes and the VR online list |
|
||||
| Bots | Bots in multiplayer (`host_bots.c`; OpenCE's own, `bots.c`, are local split screen games' and off in VR): on foot (paths, items, objectives), in vehicles and at turrets; they make room for a joining person, on the LAN too (2026-10-18); they climb ladders (Damnation's) and take paths as near their goal as a search reaches, as OpenCE's do: on Damnation 0 searches of 1747 failed, 1078 of 1605 before (2026-10-20). Later: OpenCE's bots' aiming (lead, bursts, taps for the pistol and sniper rifle, field of view), learnt obstacles and map fixes into ours |
|
||||
| Voice chat | Push to talk on any button (`vr.button_talk`, BUTTONS page; the free hand's grip by default, sending nothing while it reaches for the foregrip or the wheel), open mic, off (2026-10-13) |
|
||||
| Builds | The Android build's assembly conversion (`tools/android_asm_convert.py`) keeps string data as it is: strings and tables starting with "_" or holding \" lost a "_" (Opus's pulse cache among them: the Steam Frame's crashes in online games while talking), 2026-10-13 |
|
||||
| Languages | The European disc in Spanish and Italian (a maps folder for each, `maps_es` and `maps_it`, none called `maps`) imported on the Quest and the Steam Frame: the headset's language's, its language the game's and the menus' (`maps/language.txt`, unless `game.language` is set), 2026-10-17; not yet tried with that disc |
|
||||
@@ -46,6 +46,7 @@ named where code is taken over.
|
||||
| 4 | Later: disc image import in the launcher; moving by swinging the arms (in place of the stick, never faster than it: online too), and a sprint by swinging them harder (faster than the game allows: offline only) | import **done** (in `main` 2026-10-06): the app's import (tried on the Quest 3: all 24 maps; on the Frame kept in `~/Documents/RingfallMjolnirVR`), a Steam Frame installer from Desktop Mode (`STEAM_FRAME.md`; tried on the Frame: the old folder renamed, the shortcut added by Steam), a release signing key (CI and local builds the same). Arm swinging and its offline sprint still open |
|
||||
| 5 | Later: multiview again (both eyes in one pass, half the drawing's CPU cost): find why its eyes do not fuse in big online games on the Quest 3 (and now and then on the Steam Frame), then turn it back on | open: off by default since 2026-10-16 (`debug.multiview`); findings in the open points |
|
||||
| R | Release as **Ringfall: Mjolnir VR** (no "Halo" in the product's name): app name, id `io.github.cesarus85.ringfall`, icon and library pictures (`tools/ringfall_art.py`), Frame folder and installer, release assets, README; the repository renamed | **done** (in `main` 2026-10-06; Quest 3 and Steam Frame good) |
|
||||
| R2 | Renamed **Mjolnir VR** ("Ringfall" is another game's name): app and Steam names, logo (`tools/mjolnir_art.py`), release assets (also under the old names for the updaters of builds 302 to 313), updaters, README; the repository renamed `Cesarus85/mjolnir-vr` (GitHub forwards the old links). Kept: the app id, the signing key's alias, the Frame's `~/Documents/RingfallMjolnirVR` and the names inside its bundle (installed games and their shortcuts) | in `feature/rename-mjolnir-vr` (2026-10-21) |
|
||||
|
||||
## Step 2, first part (done)
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public class LauncherActivity extends Activity {
|
||||
layout.setBackgroundColor(Color.rgb(12, 16, 20));
|
||||
|
||||
TextView title = new TextView(this);
|
||||
title.setText("Ringfall: Mjolnir VR needs game data");
|
||||
title.setText("Mjolnir VR needs game data");
|
||||
title.setTextColor(Color.WHITE);
|
||||
title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24);
|
||||
title.setGravity(Gravity.CENTER);
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.zip.ZipInputStream;
|
||||
* the latest release when it starts, on a thread of its own, and if it is
|
||||
* newer asks the player whether to update:
|
||||
*
|
||||
* - Yes: the release's app (ringfall-mjolnir-vr-android-release.zip or
|
||||
* - Yes: the release's app (mjolnir-vr-android-release.zip or
|
||||
* -debug.zip) is
|
||||
* downloaded and handed to Android's package installer, which replaces the
|
||||
* game (closing it) and offers to open the new version.
|
||||
@@ -53,8 +53,8 @@ import java.util.zip.ZipInputStream;
|
||||
final class Updater {
|
||||
/* the VR port's own releases: the original's, made without VR, must
|
||||
never replace it (they share the package name) */
|
||||
private static final String APP_NAME = "Ringfall: Mjolnir VR";
|
||||
private static final String REPOSITORY = "Cesarus85/ringfall-mjolnir-vr";
|
||||
private static final String APP_NAME = "Mjolnir VR";
|
||||
private static final String REPOSITORY = "Cesarus85/mjolnir-vr";
|
||||
private static final String USER_AGENT = "halo-ce-universal-updater";
|
||||
private static final int TIMEOUT_MILLISECONDS = 20000;
|
||||
/** the most a download (a release's zip, about 35 MB) or the app in it may be */
|
||||
@@ -240,7 +240,7 @@ final class Updater {
|
||||
/* ---------- updating */
|
||||
|
||||
private static void update(Activity activity, int latest) {
|
||||
String asset = "ringfall-mjolnir-vr-android-" + (BuildConfig.DEBUG ? "debug" : "release") + ".zip";
|
||||
String asset = "mjolnir-vr-android-" + (BuildConfig.DEBUG ? "debug" : "release") + ".zip";
|
||||
File directory = new File(activity.getCacheDir(), UpdateProvider.DIRECTORY);
|
||||
LinearLayout layout = new LinearLayout(activity);
|
||||
TextView status = new TextView(activity);
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -45,6 +46,12 @@ import java.util.Locale;
|
||||
* deep and looks at most 4096 entries; and a file is written only under a
|
||||
* plain name that no file before it had (ignoring case).
|
||||
*
|
||||
* The loading screen's picture, which the retail disc has no file of, is
|
||||
* taken out of the root's default.xbe (read whole, at most 64 MB) and
|
||||
* written beside the maps as the loading.tga the game reads, when the maps
|
||||
* folder has none (loadingPicture, as xiso.c's xiso_write_loading_picture);
|
||||
* without it the light sweeps over black, as the game's own does.
|
||||
*
|
||||
* The app starts the game once maps/ui.map exists, and makes the maps folder
|
||||
* itself, so the copy is written to maps.partial (emptied first of what an
|
||||
* earlier attempt left) and its files moved into maps once all are
|
||||
@@ -72,6 +79,12 @@ final class XisoExtractor {
|
||||
private static final int MAXIMUM_ENTRIES = 256;
|
||||
private static final int COPY_CHUNK = 1024 * 1024;
|
||||
private static final String PARTIAL_DIRECTORY = "maps.partial";
|
||||
/** the loading screen's picture (source/interface/progress_bar.c), out of default.xbe; the executable is a few MB */
|
||||
private static final int LOADING_WIDTH = 320;
|
||||
private static final int LOADING_HEIGHT = 240;
|
||||
private static final int TGA_HEADER_SIZE = 18;
|
||||
private static final long MAXIMUM_XBE_SIZE = 64 * 1024 * 1024;
|
||||
private static final String LOADING_PICTURE = "loading.tga";
|
||||
|
||||
/** Told as the copy goes: the file being copied, and the bytes copied of all the files'. */
|
||||
interface Progress {
|
||||
@@ -128,13 +141,19 @@ final class XisoExtractor {
|
||||
// the root's maps folder
|
||||
byte[] root = readTable(image, partition, rootSector, rootSize, "The disc image's file system is damaged.");
|
||||
Entry maps = null;
|
||||
for (Entry entry : walkTable(root, true)) {
|
||||
Entry xbe = null;
|
||||
for (Entry entry : walkTable(root, false)) {
|
||||
if (entry.name.equalsIgnoreCase("default.xbe"))
|
||||
xbe = entry;
|
||||
}
|
||||
List<Entry> directories = walkTable(root, true);
|
||||
for (Entry entry : directories) {
|
||||
if (entry.name.equalsIgnoreCase("maps")) {
|
||||
maps = entry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// (Ringfall: a European disc in two languages, Spanish and Italian,
|
||||
// (Mjolnir VR: a European disc in two languages, Spanish and Italian,
|
||||
// has no maps folder but one for each, maps_es and maps_it: the
|
||||
// device's language's is taken, else English's, else the first, and
|
||||
// its language written to maps/language.txt, which the game asks the
|
||||
@@ -168,9 +187,11 @@ final class XisoExtractor {
|
||||
byte[] table = readTable(image, partition, maps.sector, maps.size, "The disc image's maps folder is damaged.");
|
||||
List<Entry> files = walkTable(table, false);
|
||||
Entry userInterface = null;
|
||||
boolean hasLoading = false;
|
||||
for (Entry file : files) {
|
||||
if (file.name.equalsIgnoreCase("ui.map"))
|
||||
userInterface = file;
|
||||
hasLoading |= file.name.equalsIgnoreCase(LOADING_PICTURE);
|
||||
}
|
||||
if (userInterface == null)
|
||||
throw new ExtractException("The disc image's maps folder has no ui.map: it is not a Halo disc.");
|
||||
@@ -201,6 +222,8 @@ final class XisoExtractor {
|
||||
long done = 0;
|
||||
for (Entry file : files)
|
||||
done = copyFile(image, partition, file, new File(partial, file.name), buffer, done, total, progress);
|
||||
if (!hasLoading && writeLoadingPicture(image, imageSize, partition, xbe, new File(partial, LOADING_PICTURE)))
|
||||
files.add(new Entry(LOADING_PICTURE, 0, 0));
|
||||
|
||||
// then into maps, ui.map (the app's sign that the data is there) last
|
||||
File mapsFolder = new File(destination, "maps");
|
||||
@@ -362,6 +385,83 @@ final class XisoExtractor {
|
||||
walk.entries.add(new Entry(name, u32(table, offset + 4), u32(table, offset + 8)));
|
||||
}
|
||||
|
||||
/* ---------- the loading screen's picture */
|
||||
|
||||
/**
|
||||
* The loading screen's picture out of a default.xbe, as the TGA the game
|
||||
* reads (uncompressed, 24 bits, rows from the bottom), or null. The
|
||||
* executable holds it, 320 by 240, as runs of 4-bit greys (a byte each:
|
||||
* the grey's high four bits in its low nibble, the run's length in its
|
||||
* high one) after the width and height as u32s: found by those two
|
||||
* numbers followed by runs that fill the picture exactly (a run of none,
|
||||
* or one past the picture's end, is not it).
|
||||
*/
|
||||
static byte[] loadingPicture(byte[] xbe) {
|
||||
int pixels = LOADING_WIDTH * LOADING_HEIGHT;
|
||||
byte[] greys = new byte[pixels];
|
||||
boolean found = false;
|
||||
|
||||
for (int at = 0; at + 8 <= xbe.length && !found; at++) {
|
||||
if (u32(xbe, at) != LOADING_WIDTH || u32(xbe, at + 4) != LOADING_HEIGHT)
|
||||
continue;
|
||||
int pixel = 0;
|
||||
for (int next = at + 8; next < xbe.length && pixel < pixels; next++) {
|
||||
int run = (xbe[next] & 0xFF) >> 4;
|
||||
|
||||
if (run == 0 || run > pixels - pixel)
|
||||
break;
|
||||
Arrays.fill(greys, pixel, pixel + run, (byte) ((xbe[next] & 0x0F) << 4));
|
||||
pixel += run;
|
||||
}
|
||||
found = pixel == pixels;
|
||||
}
|
||||
if (!found)
|
||||
return null;
|
||||
byte[] tga = new byte[TGA_HEADER_SIZE + pixels * 3];
|
||||
tga[2] = 2;
|
||||
tga[12] = (byte) (LOADING_WIDTH & 0xFF);
|
||||
tga[13] = (byte) (LOADING_WIDTH >> 8);
|
||||
tga[14] = (byte) (LOADING_HEIGHT & 0xFF);
|
||||
tga[15] = (byte) (LOADING_HEIGHT >> 8);
|
||||
tga[16] = 24;
|
||||
for (int y = 0; y < LOADING_HEIGHT; y++) {
|
||||
int row = (LOADING_HEIGHT - 1 - y) * LOADING_WIDTH;
|
||||
for (int x = 0; x < LOADING_WIDTH; x++) {
|
||||
int out = TGA_HEADER_SIZE + (y * LOADING_WIDTH + x) * 3;
|
||||
|
||||
tga[out] = tga[out + 1] = tga[out + 2] = greys[row + x];
|
||||
}
|
||||
}
|
||||
return tga;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes default.xbe's picture to output, if it has one; whether it did.
|
||||
* One that cannot be written whole is removed (the loading screen would
|
||||
* read past one cut short).
|
||||
*/
|
||||
private static boolean writeLoadingPicture(FileChannel image, long imageSize, long partition, Entry xbe,
|
||||
File output) {
|
||||
if (xbe == null || xbe.size <= 0 || xbe.size > MAXIMUM_XBE_SIZE
|
||||
|| partition + xbe.sector * SECTOR_SIZE + xbe.size > imageSize)
|
||||
return false;
|
||||
try {
|
||||
ByteBuffer bytes = ByteBuffer.allocate((int) xbe.size);
|
||||
if (!readFully(image, bytes, partition + xbe.sector * SECTOR_SIZE))
|
||||
return false;
|
||||
byte[] tga = loadingPicture(bytes.array());
|
||||
if (tga == null)
|
||||
return false;
|
||||
try (FileOutputStream stream = new FileOutputStream(output)) {
|
||||
stream.write(tga);
|
||||
}
|
||||
return true;
|
||||
} catch (IOException | OutOfMemoryError exception) {
|
||||
output.delete();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- the copy */
|
||||
|
||||
private static String readFailure(Entry file) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Ringfall: Mjolnir VR</string>
|
||||
<string name="app_name">Mjolnir VR</string>
|
||||
</resources>
|
||||
@@ -65,7 +65,7 @@ void host_fatal(const char *format, ...)
|
||||
vsnprintf(message, sizeof(message), format, arguments);
|
||||
va_end(arguments);
|
||||
__android_log_write(ANDROID_LOG_FATAL, "halo", message);
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Ringfall: Mjolnir VR", message, NULL);
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Mjolnir VR", message, NULL);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
host_logf(HOST_LOG_INFO, "Ringfall: Mjolnir VR starting");
|
||||
host_logf(HOST_LOG_INFO, "Mjolnir VR starting");
|
||||
host_install_signal_handlers();
|
||||
if (host_native_thread_create(game_main, NULL, MAIN_STACK_SIZE) != 0)
|
||||
host_fatal("cannot start the game thread");
|
||||
|
||||
@@ -834,6 +834,10 @@ long host_guest_mprotect(uint64_t address, uint64_t size, int protection)
|
||||
|
||||
#define WATCH_PAGE_COUNT (HALO_GUEST_WINDOW_SIZE / PAGE)
|
||||
|
||||
/* (each page: 0 not watched, 1 watched and read-only, 2 made writable by a
|
||||
watched write. A fault on a page at 2 is a write another thread made as
|
||||
this one was making the page writable, and is made again; one on a page at
|
||||
0, freed memory or none of the watch's, is a crash) */
|
||||
static uint8_t page_protected[WATCH_PAGE_COUNT];
|
||||
static uint32_t page_generation[WATCH_PAGE_COUNT];
|
||||
static volatile uint32_t current_generation = 1;
|
||||
@@ -867,7 +871,7 @@ static uint64_t watch_page(uint64_t address)
|
||||
static void mark_written(uint64_t page)
|
||||
{
|
||||
page_generation[page] = __sync_add_and_fetch(¤t_generation, 1);
|
||||
page_protected[page] = 0;
|
||||
page_protected[page] = 2;
|
||||
mprotect((void *)(HALO_GUEST_WINDOW_BASE + page * PAGE), PAGE, PROT_READ | PROT_WRITE);
|
||||
}
|
||||
|
||||
@@ -934,11 +938,13 @@ static void segv_handler(int signal_number, siginfo_t *information, void *contex
|
||||
{
|
||||
uint64_t page = watch_page(address);
|
||||
|
||||
if (page_protected[page])
|
||||
if (page_protected[page] == 1)
|
||||
{
|
||||
mark_written(page);
|
||||
return;
|
||||
}
|
||||
if (page_protected[page] == 2)
|
||||
return;
|
||||
}
|
||||
report_crash(signal_number, information, context);
|
||||
chain(&previous_segv, signal_number, information, context);
|
||||
@@ -1001,7 +1007,7 @@ void host_memory_watch_protect(uint32_t address, uint32_t size)
|
||||
}
|
||||
for (page = first; page <= last; page++)
|
||||
{
|
||||
if (!page_protected[page])
|
||||
if (page_protected[page] != 1)
|
||||
{
|
||||
page_protected[page] = 1;
|
||||
mprotect((void *)(HALO_GUEST_WINDOW_BASE + page * PAGE), PAGE, PROT_READ);
|
||||
@@ -1056,7 +1062,7 @@ void host_memory_watch_prepare_write(uint32_t address, uint32_t size)
|
||||
last = WATCH_PAGE_COUNT - 1;
|
||||
for (page = first; page <= last; page++)
|
||||
{
|
||||
if (page_protected[page])
|
||||
if (page_protected[page] == 1)
|
||||
mark_written(page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1256,7 +1256,7 @@ with vr.log_performance: host_main.c) */
|
||||
android.applicationVM = machine;
|
||||
android.applicationActivity = activity;
|
||||
instance.next = &android;
|
||||
strcpy(instance.applicationInfo.applicationName, "Ringfall Mjolnir VR");
|
||||
strcpy(instance.applicationInfo.applicationName, "Mjolnir VR");
|
||||
instance.applicationInfo.applicationVersion = 1;
|
||||
strcpy(instance.applicationInfo.engineName, "halo-ce-universal");
|
||||
instance.applicationInfo.engineVersion = 1;
|
||||
@@ -2275,7 +2275,7 @@ void host_xr_test(void)
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
||||
window = SDL_CreateWindow("Ringfall: Mjolnir VR", 640, 480, SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN);
|
||||
window = SDL_CreateWindow("Mjolnir VR", 640, 480, SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN);
|
||||
context = window ? SDL_GL_CreateContext(window) : NULL;
|
||||
if (!context || !SDL_GL_MakeCurrent(window, context))
|
||||
host_fatal("VR test: no OpenGL ES context: %s", SDL_GetError());
|
||||
|
||||
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 70 KiB |
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Ringfall: Mjolnir VR's installer for the Steam Frame, run in its Desktop
|
||||
# Mode from the bundle the release's "Install Ringfall: Mjolnir VR" desktop
|
||||
# Mjolnir VR's installer for the Steam Frame, run in its Desktop
|
||||
# Mode from the bundle the release's "Install Mjolnir VR" desktop
|
||||
# file downloads (steam_frame_installer.desktop; the bundle: this script,
|
||||
# RingfallMjolnirVR.apk, ringfall-mjolnir-vr.sh = steam_frame_launch.sh,
|
||||
# steam_frame_xiso.py and the library pictures in grid/). Everything is
|
||||
@@ -19,28 +19,31 @@
|
||||
# Steam Frame Desktop Mode runs inside Gaming Mode's session, which ends
|
||||
# with Steam. The shortcut of the builds before the name ("Halo VR") is
|
||||
# left for the player to remove (Steam would write it back).
|
||||
# RINGFALL_UNATTENDED=1 answers every question with its default and prints
|
||||
# instead of showing dialogs (RINGFALL_IMAGE: the disc image to use), for
|
||||
# MJOLNIR_UNATTENDED=1 answers every question with its default and prints
|
||||
# instead of showing dialogs (MJOLNIR_IMAGE: the disc image to use), for
|
||||
# testing over adb; it never closes Steam.
|
||||
|
||||
BUNDLE="$(cd "$(dirname "$0")" && pwd)"
|
||||
GAME_DIR="$HOME/Documents/RingfallMjolnirVR"
|
||||
STEAM_DIR="$HOME/.local/share/Steam"
|
||||
LEPTON="$STEAM_DIR/steamapps/common/Lepton/lepton"
|
||||
TITLE="Ringfall: Mjolnir VR"
|
||||
NAME="Ringfall: Mjolnir VR"
|
||||
TITLE="Mjolnir VR"
|
||||
NAME="Mjolnir VR"
|
||||
APK_NAME="RingfallMjolnirVR.apk"
|
||||
LAUNCHER="ringfall-mjolnir-vr.sh"
|
||||
EXE="\"$GAME_DIR/$LAUNCHER\""
|
||||
# (the desktop file Steam adds the game from)
|
||||
NAME_FILE="Ringfall Mjolnir VR"
|
||||
NAME_FILE="Mjolnir VR"
|
||||
# the builds before the name: their folder and Steam shortcut
|
||||
OLD_DIR="$HOME/Documents/HaloCE"
|
||||
OLD_NAME="Halo VR"
|
||||
# the name of builds 302 to 313, which their shortcut keeps (Steam writes
|
||||
# its shortcuts back from memory: the player renames it)
|
||||
FORMER_NAME="Ringfall: Mjolnir VR"
|
||||
|
||||
# what the installer did, for looking into problems: written to /tmp while
|
||||
# it runs, then kept beside the game as install.log
|
||||
LOG="/tmp/ringfall-mjolnir-vr-install.log"
|
||||
LOG="/tmp/mjolnir-vr-install.log"
|
||||
: > "$LOG"
|
||||
log() { echo "$(date '+%F %T') $*" >> "$LOG"; }
|
||||
keep_log() { [ -d "$GAME_DIR" ] && cp -f "$LOG" "$GAME_DIR/install.log" 2>/dev/null; }
|
||||
@@ -59,7 +62,7 @@ steam_running()
|
||||
pgrep -f 'ubuntu12_32/steam( |$)' >/dev/null || pgrep -x steam >/dev/null
|
||||
}
|
||||
|
||||
unattended() { [ "${RINGFALL_UNATTENDED:-0}" = 1 ] || ! command -v zenity >/dev/null; }
|
||||
unattended() { [ "${MJOLNIR_UNATTENDED:-0}" = 1 ] || ! command -v zenity >/dev/null; }
|
||||
|
||||
info()
|
||||
{
|
||||
@@ -185,7 +188,7 @@ PYTHON
|
||||
# must run), from a desktop file beside the game; then its pictures
|
||||
add_shortcut()
|
||||
{
|
||||
local desktop="$GAME_DIR/$NAME_FILE.desktop" url file id
|
||||
local desktop="$GAME_DIR/$NAME_FILE.desktop" url
|
||||
printf '[Desktop Entry]\nType=Application\nName=%s\nExec=%s\nPath=%s\nIcon=steam\nTerminal=false\n' \
|
||||
"$NAME" "$GAME_DIR/$LAUNCHER" "$GAME_DIR" > "$desktop" && chmod 755 "$desktop" || return 1
|
||||
url="steam://addnonsteamgame/$(python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1], safe=""))' "$desktop")"
|
||||
@@ -195,6 +198,16 @@ add_shortcut()
|
||||
steam "$url" >/dev/null 2>&1 &
|
||||
for _ in $(seq 30); do have_shortcut && break; sleep 1; done
|
||||
have_shortcut || return 1
|
||||
add_pictures
|
||||
return 0
|
||||
}
|
||||
|
||||
# the library pictures of the game's shortcut, for every Steam user who has
|
||||
# it (again on an update: the builds before the name "Mjolnir VR" had
|
||||
# Ringfall's)
|
||||
add_pictures()
|
||||
{
|
||||
local file id
|
||||
while read -r file; do
|
||||
id="$(shortcut_id "$file" "$EXE")" || continue
|
||||
log "shortcut $id in $file"
|
||||
@@ -204,7 +217,6 @@ add_shortcut()
|
||||
cp "$BUNDLE/grid/library_hero.png" "$(dirname "$file")/grid/${id}_hero.png"
|
||||
cp "$BUNDLE/grid/library_logo.png" "$(dirname "$file")/grid/${id}_logo.png"
|
||||
done < <(shortcut_files)
|
||||
return 0
|
||||
}
|
||||
|
||||
# --- the game
|
||||
@@ -245,7 +257,7 @@ rm -rf "$GAME_DIR/update"
|
||||
# --- the game data
|
||||
|
||||
if [ ! -f "$GAME_DIR/maps/ui.map" ]; then
|
||||
image="${RINGFALL_IMAGE:-}"
|
||||
image="${MJOLNIR_IMAGE:-}"
|
||||
if [ -z "$image" ]; then
|
||||
mapfile -t images < <(find_images)
|
||||
for candidate in "${images[@]}"; do
|
||||
@@ -271,6 +283,7 @@ fi
|
||||
|
||||
if have_shortcut; then
|
||||
log "the Steam shortcut is there"
|
||||
add_pictures
|
||||
elif unattended; then
|
||||
echo "info: the Steam shortcut is missing (not added unattended)"
|
||||
elif ! steam_running; then
|
||||
@@ -286,6 +299,9 @@ fi
|
||||
if have_shortcut_to "$OLD_DIR/halo-vr.sh"; then
|
||||
info "The library still shows the old \"$OLD_NAME\" from before the game's new name. It no longer starts: remove it in Steam (its gear or Manage > Remove non-Steam game)."
|
||||
fi
|
||||
if have_shortcut_to "$FORMER_NAME"; then
|
||||
info "The library shows the game by its former name, \"$FORMER_NAME\". To call it $NAME there: its gear > Properties, then its name at the top."
|
||||
fi
|
||||
if ask "$NAME is installed.${image_note:-}\n\nSwitch to Gaming Mode now? Start $NAME from your library there (its pictures may show once Steam starts again)." yes; then
|
||||
steamos-session-select gamescope >/dev/null 2>&1 ||
|
||||
info "Switch to Gaming Mode yourself (the \"Return to Gaming Mode\" icon or the power menu)."
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[Desktop Entry]
|
||||
# Ringfall: Mjolnir VR's installer for the Steam Frame
|
||||
# Mjolnir VR's installer for the Steam Frame
|
||||
# (port/android/STEAM_FRAME.md): a release asset,
|
||||
# "Install-Ringfall-Mjolnir-VR.desktop", opened in Desktop Mode. It downloads
|
||||
# "Install-Mjolnir-VR.desktop", opened in Desktop Mode. It downloads
|
||||
# the latest release's bundle (tools/steam_frame_bundle.py, which fills in
|
||||
# the repository) and runs its installer, steam_frame_install.sh.
|
||||
# (no "$", "\" or "%" in Exec: the desktop entry format would need them
|
||||
# escaped)
|
||||
Type=Application
|
||||
Name=Install Ringfall: Mjolnir VR
|
||||
Comment=Installs Ringfall: Mjolnir VR for the Steam Frame, or updates it
|
||||
Name=Install Mjolnir VR
|
||||
Comment=Installs Mjolnir VR for the Steam Frame, or updates it
|
||||
Icon=steam
|
||||
Terminal=false
|
||||
Exec=bash -c "if curl -fL --retry 3 -o /tmp/ringfall-mjolnir-vr-steam-frame.zip https://github.com/@REPOSITORY@/releases/latest/download/ringfall-mjolnir-vr-steam-frame.zip && rm -rf /tmp/ringfall-mjolnir-vr-install && python3 -m zipfile -e /tmp/ringfall-mjolnir-vr-steam-frame.zip /tmp/ringfall-mjolnir-vr-install; then exec bash /tmp/ringfall-mjolnir-vr-install/install.sh; else zenity --error --width=460 --title='Ringfall: Mjolnir VR' --text='Ringfall: Mjolnir VR could not be downloaded. Is the Steam Frame online?'; fi"
|
||||
Exec=bash -c "if curl -fL --retry 3 -o /tmp/mjolnir-vr-steam-frame.zip https://github.com/@REPOSITORY@/releases/latest/download/mjolnir-vr-steam-frame.zip && rm -rf /tmp/mjolnir-vr-install && python3 -m zipfile -e /tmp/mjolnir-vr-steam-frame.zip /tmp/mjolnir-vr-install; then exec bash /tmp/mjolnir-vr-install/install.sh; else zenity --error --width=460 --title='Mjolnir VR' --text='Mjolnir VR could not be downloaded. Is the Steam Frame online?'; fi"
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Ringfall: Mjolnir VR on the Steam Frame: Lepton runs the APK in a container of its own,
|
||||
# Mjolnir VR on the Steam Frame: Lepton runs the APK in a container of its own,
|
||||
# and installs it anew whenever the APK is newer than the installed one
|
||||
# (port/android/STEAM_FRAME.md). The game's data: ~/Documents/RingfallMjolnirVR.
|
||||
# (a container of its own, not the shortcut's id: with that, SteamVR's
|
||||
@@ -121,7 +121,7 @@ update_check()
|
||||
log "update: build $latest found (this is $installed), fetching it"
|
||||
rm -rf "$UPDATE" && mkdir -p "$UPDATE" || return 0
|
||||
if curl -fsSL --retry 2 --max-time 900 -o "$UPDATE/bundle.zip" \
|
||||
"https://github.com/$REPOSITORY/releases/download/build-$latest/ringfall-mjolnir-vr-steam-frame.zip" &&
|
||||
"https://github.com/$REPOSITORY/releases/download/build-$latest/mjolnir-vr-steam-frame.zip" &&
|
||||
python3 -I -m zipfile -e "$UPDATE/bundle.zip" "$UPDATE/bundle" &&
|
||||
[ "$(cat "$UPDATE/bundle/build.txt" 2>/dev/null)" = "$latest" ] &&
|
||||
[ -s "$UPDATE/bundle/RingfallMjolnirVR.apk" ] && [ -s "$UPDATE/bundle/ringfall-mjolnir-vr.sh" ]
|
||||
|
||||
@@ -42,7 +42,7 @@ name that no file before it had (ignoring case).
|
||||
|
||||
A European disc in two languages (Spanish and Italian) has no maps folder
|
||||
but one for each, maps_es and maps_it: the one for the language asked for
|
||||
(RINGFALL_LANGUAGE, else the system's) is taken, else English's, else the
|
||||
(MJOLNIR_LANGUAGE, else the system's) is taken, else English's, else the
|
||||
first, and its language written to maps/language.txt, which the game takes
|
||||
as the Xbox's language while game.language is unset.
|
||||
"""
|
||||
@@ -161,7 +161,7 @@ def choose_maps(folders):
|
||||
if folder[0].lower() == "maps":
|
||||
return folder, None
|
||||
languages = [(maps_language(folder[0]), folder) for folder in folders if maps_language(folder[0])]
|
||||
wanted = (os.environ.get("RINGFALL_LANGUAGE") or os.environ.get("LC_ALL") or
|
||||
wanted = (os.environ.get("MJOLNIR_LANGUAGE") or os.environ.get("LC_ALL") or
|
||||
os.environ.get("LC_MESSAGES") or os.environ.get("LANG") or "")[:2].lower()
|
||||
for preferred in (wanted, "en"):
|
||||
for language, folder in languages:
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
/* Real mirror decisions with a delayed, renaming GPU. No API failures. */
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef int BOOL;
|
||||
typedef unsigned GLuint, GLenum;
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#ifndef TEST_DESKTOP
|
||||
#define HALO_GLES 1
|
||||
#endif
|
||||
#define STREAM_BUFFER_RING 3
|
||||
#define GL_COPY_WRITE_BUFFER 1
|
||||
#define GL_DYNAMIC_DRAW 2
|
||||
#define SEGMENT_SIZE 0x400000u
|
||||
#define PLATFORM_CONTIGUOUS_SIZE (2 * SEGMENT_SIZE)
|
||||
static unsigned char cpu[PLATFORM_CONTIGUOUS_SIZE];
|
||||
#define PLATFORM_CONTIGUOUS_BASE ((unsigned long)cpu)
|
||||
#define CHECK(x) do { if (!(x)) { fprintf(stderr, "line %d: %s\n", __LINE__, #x); exit(1); } } while (0)
|
||||
static struct { unsigned long frame, buffer_ring; } device;
|
||||
static struct { unsigned long mirrored_bytes; } stats;
|
||||
static unsigned long generations[PLATFORM_CONTIGUOUS_SIZE / 4096], serial;
|
||||
static unsigned mapped, subdata, overlaps, draws, mismatches, uploads;
|
||||
static unsigned watch_reads, protections;
|
||||
|
||||
/* A subdata update may rename storage immediately and queue preservation
|
||||
of the old store plus its changed bytes. A later unsynchronized write to
|
||||
the new store can then be overwritten, even at a disjoint offset. */
|
||||
static unsigned char *stores[2];
|
||||
static GLuint bound, next_buffer;
|
||||
struct command
|
||||
{
|
||||
struct command *next;
|
||||
unsigned char *source, *destination, *expected;
|
||||
unsigned long offset, size, sequence;
|
||||
};
|
||||
static struct command *head, *tail;
|
||||
static unsigned long submitted, fences[STREAM_BUFFER_RING];
|
||||
|
||||
static void enqueue(unsigned char *source, unsigned char *destination,
|
||||
unsigned char *expected, unsigned long offset, unsigned long size)
|
||||
{
|
||||
struct command *command = calloc(1, sizeof(*command));
|
||||
CHECK(command);
|
||||
command->source = source;
|
||||
command->destination = destination;
|
||||
command->expected = expected;
|
||||
command->offset = offset;
|
||||
command->size = size;
|
||||
command->sequence = ++submitted;
|
||||
if (tail) tail->next = command;
|
||||
else head = command;
|
||||
tail = command;
|
||||
}
|
||||
|
||||
static void complete(unsigned long sequence)
|
||||
{
|
||||
while (head && head->sequence <= sequence)
|
||||
{
|
||||
struct command *command = head;
|
||||
if (command->expected)
|
||||
{
|
||||
draws++;
|
||||
if (memcmp(command->source + command->offset, command->expected, command->size)) mismatches++;
|
||||
free(command->expected);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(command->destination + command->offset, command->source, command->size);
|
||||
free(command->source);
|
||||
}
|
||||
head = command->next;
|
||||
free(command);
|
||||
}
|
||||
if (!head) tail = NULL;
|
||||
}
|
||||
|
||||
static void host_gl_fence_frame(unsigned slot) { fences[slot] = submitted; }
|
||||
static void host_gl_wait_frame(unsigned slot) { complete(fences[slot]); }
|
||||
|
||||
static void next_frame(void)
|
||||
{
|
||||
/* The actual fence/rotation/wait statements from Present. */
|
||||
#include "rotation.inc"
|
||||
device.frame++;
|
||||
}
|
||||
|
||||
static unsigned long memory_watch_generation(unsigned long address, unsigned long size)
|
||||
{
|
||||
unsigned long page = (address - PLATFORM_CONTIGUOUS_BASE) / 4096;
|
||||
unsigned long last = (address - PLATFORM_CONTIGUOUS_BASE + size - 1) / 4096, newest = 0;
|
||||
watch_reads++;
|
||||
for (; page <= last; page++) if (generations[page] > newest) newest = generations[page];
|
||||
return newest;
|
||||
}
|
||||
static void memory_watch_protect(unsigned long address, unsigned long size) { (void)address; (void)size; protections++; }
|
||||
static void write_pages(unsigned first, unsigned count, unsigned char value)
|
||||
{
|
||||
unsigned page;
|
||||
for (page = first; page < first + count; page++) generations[page] = ++serial;
|
||||
memset(cpu + first * 4096, value, count * 4096);
|
||||
}
|
||||
static void glGenBuffers(int count, GLuint *buffer) { CHECK(count == 1 && next_buffer < 2); *buffer = ++next_buffer; }
|
||||
static void glBindBuffer(GLenum target, GLuint buffer) { CHECK(target == GL_COPY_WRITE_BUFFER && buffer && buffer <= 2); bound = buffer - 1; }
|
||||
static void glBufferData(GLenum target, unsigned long size, const void *data, GLenum usage)
|
||||
{
|
||||
CHECK(target == GL_COPY_WRITE_BUFFER && size == SEGMENT_SIZE && !data && usage == GL_DYNAMIC_DRAW);
|
||||
stores[bound] = calloc(1, size);
|
||||
CHECK(stores[bound]);
|
||||
}
|
||||
static void buffer_upload(GLenum target, unsigned long offset, unsigned long size, const void *data)
|
||||
{
|
||||
unsigned char *old = stores[bound], *copy = malloc(size);
|
||||
CHECK(target == GL_COPY_WRITE_BUFFER && offset + size <= SEGMENT_SIZE && copy);
|
||||
stores[bound] = calloc(1, SEGMENT_SIZE);
|
||||
CHECK(stores[bound]);
|
||||
memcpy(copy, data, size);
|
||||
enqueue(old, stores[bound], NULL, 0, SEGMENT_SIZE);
|
||||
enqueue(copy, stores[bound], NULL, offset, size);
|
||||
subdata++;
|
||||
uploads++;
|
||||
}
|
||||
static void host_gl_buffer_write(GLenum target, unsigned offset, unsigned size, const void *data)
|
||||
{
|
||||
struct command *command;
|
||||
CHECK(target == GL_COPY_WRITE_BUFFER && offset + size <= SEGMENT_SIZE);
|
||||
for (command = head; command; command = command->next)
|
||||
{
|
||||
if (command->destination == stores[bound] && offset < command->offset + command->size &&
|
||||
command->offset < offset + size) overlaps++;
|
||||
if (command->expected && command->source == stores[bound] && offset < command->offset + command->size &&
|
||||
command->offset < offset + size) overlaps++;
|
||||
}
|
||||
memcpy(stores[bound] + offset, data, size);
|
||||
mapped++;
|
||||
uploads++;
|
||||
}
|
||||
|
||||
#include "mirror.inc"
|
||||
|
||||
static int draw_pages(unsigned first, unsigned count)
|
||||
{
|
||||
GLuint buffer;
|
||||
unsigned long offset;
|
||||
unsigned char *expected;
|
||||
if (!mirror_range(PLATFORM_CONTIGUOUS_BASE + first * 4096, count * 4096, &buffer, &offset, NULL)) return 0;
|
||||
expected = malloc(count * 4096);
|
||||
CHECK(expected);
|
||||
memcpy(expected, cpu + first * 4096, count * 4096);
|
||||
enqueue(stores[buffer - 1], NULL, expected, offset, count * 4096);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
unsigned index, old_uploads;
|
||||
int rollover = argc > 1 && !strcmp(argv[1], "rollover");
|
||||
device.frame = rollover ? ~0UL - 1 : 100;
|
||||
#ifdef HALO_ANDROID
|
||||
/* First-use and reused ranges must always go to the caller's existing
|
||||
streaming path, without creating GPU storage or consulting tracking. */
|
||||
for (index = 0; index < 1200; index++)
|
||||
{
|
||||
GLuint buffer = 99;
|
||||
unsigned long offset = 77, generation = 55;
|
||||
write_pages(0, 300, (unsigned char)index);
|
||||
CHECK(!mirror_range(PLATFORM_CONTIGUOUS_BASE, 300 * 4096, &buffer, &offset, &generation));
|
||||
CHECK(buffer == 99 && offset == 77 && generation == 55);
|
||||
CHECK(!draw_pages(0, 1));
|
||||
CHECK(!draw_pages(1023, 2));
|
||||
CHECK(!draw_pages(1024, 1));
|
||||
next_frame();
|
||||
}
|
||||
CHECK(!next_buffer && !uploads && !watch_reads && !protections && !stats.mirrored_bytes);
|
||||
fprintf(stderr, "bypassed=4800 allocations=0 uploads=0 watch_reads=0 protections=0\n");
|
||||
return 0;
|
||||
#endif
|
||||
write_pages(0, 1, 1);
|
||||
CHECK(draw_pages(0, 1));
|
||||
CHECK(watch_reads && protections);
|
||||
next_frame();
|
||||
/* An ordinary reused allocation: some previously mirrored pages and
|
||||
some first-time pages. 300 pages also crosses the 256-page refresh chunk. */
|
||||
write_pages(0, 300, 2);
|
||||
CHECK(draw_pages(0, 300));
|
||||
CHECK(draw_pages(0, 1));
|
||||
next_frame();
|
||||
write_pages(300, 1, 3);
|
||||
CHECK(draw_pages(300, 1));
|
||||
next_frame();
|
||||
write_pages(301, 1, 4);
|
||||
CHECK(draw_pages(301, 1));
|
||||
/* A different segment has no pending preservation copy. */
|
||||
write_pages(1024, 1, 5);
|
||||
CHECK(draw_pages(1024, 1));
|
||||
CHECK(!draw_pages(1023, 2)); /* segment boundary streams instead */
|
||||
for (index = 0; index < STREAM_BUFFER_RING; index++) next_frame();
|
||||
index = mapped;
|
||||
write_pages(302, 1, 6);
|
||||
CHECK(draw_pages(302, 1));
|
||||
#if defined(HALO_ANDROID) || defined(TEST_DESKTOP)
|
||||
CHECK(mapped == 0); /* every persistent-cache upload is ordered */
|
||||
#else
|
||||
CHECK(mapped == index + 1); /* fast path returns after the fence */
|
||||
#endif
|
||||
complete(submitted);
|
||||
old_uploads = uploads;
|
||||
/* CPU generations are unchanged: any GPU damage is retained. */
|
||||
for (index = 0; index < 1200; index++)
|
||||
{
|
||||
CHECK(draw_pages(256, 1));
|
||||
next_frame();
|
||||
}
|
||||
complete(submitted);
|
||||
CHECK(uploads == old_uploads);
|
||||
fprintf(stderr, "mapped=%u subdata=%u overlaps=%u bad_draws=%u draws=%u repair_uploads=%u\n",
|
||||
mapped, subdata, overlaps, mismatches, draws, uploads - old_uploads);
|
||||
for (index = 0; index < 2; index++) free(stores[index]);
|
||||
CHECK(overlaps == 0 && mismatches == 0);
|
||||
return 0;
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 272 KiB |
|
After Width: | Height: | Size: 131 KiB |
@@ -0,0 +1,317 @@
|
||||
{
|
||||
"assets": [
|
||||
{
|
||||
"name": "ce_hud_unit_meters",
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_meters",
|
||||
"bitmap": 0,
|
||||
"scale": 4,
|
||||
"format": "a8r8g8b8",
|
||||
"ce_only": true,
|
||||
"cells": [
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
20,
|
||||
288,
|
||||
958,
|
||||
505
|
||||
],
|
||||
"to": [
|
||||
23.0,
|
||||
136.0,
|
||||
257.5,
|
||||
190.25
|
||||
],
|
||||
"alignment": {
|
||||
"anchor": "top_right",
|
||||
"xbox_sprite": [
|
||||
122,
|
||||
34
|
||||
],
|
||||
"ce_sprite": [
|
||||
262,
|
||||
132
|
||||
],
|
||||
"pixels_per_xbox_texel": 8,
|
||||
"ce_resolution": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
1141,
|
||||
16,
|
||||
1904,
|
||||
129
|
||||
],
|
||||
"to": [
|
||||
271.0,
|
||||
2.0,
|
||||
366.0,
|
||||
16.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
714,
|
||||
527,
|
||||
1403,
|
||||
625
|
||||
],
|
||||
"to": [
|
||||
84.5,
|
||||
199.75,
|
||||
256.75,
|
||||
224.25
|
||||
],
|
||||
"alignment": {
|
||||
"anchor": "top_right",
|
||||
"xbox_sprite": [
|
||||
176,
|
||||
65
|
||||
],
|
||||
"ce_sprite": [
|
||||
258,
|
||||
198
|
||||
],
|
||||
"pixels_per_xbox_texel": 8,
|
||||
"ce_resolution": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
68,
|
||||
527,
|
||||
684,
|
||||
577
|
||||
],
|
||||
"to": [
|
||||
389.0,
|
||||
1.0,
|
||||
466.0,
|
||||
7.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
132,
|
||||
648,
|
||||
923,
|
||||
688
|
||||
],
|
||||
"to": [
|
||||
33.0,
|
||||
251.0,
|
||||
237.0,
|
||||
262.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
1085,
|
||||
400,
|
||||
1803,
|
||||
416
|
||||
],
|
||||
"to": [
|
||||
271.0,
|
||||
67.0,
|
||||
364.0,
|
||||
71.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
5,
|
||||
95,
|
||||
799,
|
||||
193
|
||||
],
|
||||
"to": [
|
||||
15.0,
|
||||
84.0,
|
||||
169.0,
|
||||
103.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_unit_meters__0",
|
||||
"from": [
|
||||
981,
|
||||
279,
|
||||
1670,
|
||||
377
|
||||
],
|
||||
"to": [
|
||||
14.0,
|
||||
3.0,
|
||||
153.0,
|
||||
22.0
|
||||
]
|
||||
}
|
||||
],
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"size": 262144,
|
||||
"crc": 3491893663,
|
||||
"coverage": true,
|
||||
"point_threshold": true
|
||||
},
|
||||
{
|
||||
"name": "ce_hud_ammo_meters",
|
||||
"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_meters",
|
||||
"bitmap": 0,
|
||||
"scale": 4,
|
||||
"format": "a8r8g8b8",
|
||||
"ce_only": true,
|
||||
"cells": [
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
0,
|
||||
504,
|
||||
830,
|
||||
616
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
122.0,
|
||||
208.0,
|
||||
151.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
7,
|
||||
11,
|
||||
898,
|
||||
208
|
||||
],
|
||||
"to": [
|
||||
1.0,
|
||||
2.0,
|
||||
225.0,
|
||||
51.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
1048,
|
||||
224,
|
||||
1903,
|
||||
352
|
||||
],
|
||||
"to": [
|
||||
268.0,
|
||||
54.0,
|
||||
469.0,
|
||||
86.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
848,
|
||||
504,
|
||||
1672,
|
||||
592
|
||||
],
|
||||
"to": [
|
||||
211.0,
|
||||
122.0,
|
||||
417.0,
|
||||
145.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
872,
|
||||
368,
|
||||
1740,
|
||||
488
|
||||
],
|
||||
"to": [
|
||||
216.0,
|
||||
89.0,
|
||||
434.0,
|
||||
120.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
4,
|
||||
368,
|
||||
855,
|
||||
484
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
89.0,
|
||||
214.0,
|
||||
119.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
920,
|
||||
8,
|
||||
1756,
|
||||
168
|
||||
],
|
||||
"to": [
|
||||
245.0,
|
||||
2.0,
|
||||
431.0,
|
||||
41.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
14,
|
||||
224,
|
||||
887,
|
||||
352
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
54.0,
|
||||
219.0,
|
||||
87.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"source": "hud_ammo_meters__0",
|
||||
"from": [
|
||||
18,
|
||||
632,
|
||||
835,
|
||||
664
|
||||
],
|
||||
"to": [
|
||||
2.0,
|
||||
153.0,
|
||||
187.0,
|
||||
162.0
|
||||
]
|
||||
}
|
||||
],
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"size": 1048576,
|
||||
"crc": 1316117604,
|
||||
"coverage": true,
|
||||
"point_threshold": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"resource_sha256": "317658e0ebd4aa189bac68e994fe0b515928f44d17b62ba676d8850aa329dd3d",
|
||||
"bitmaps": [
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 0, "width": 128, "height": 32, "size": 16384, "crc": 2336761448},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 1382921092},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 2, "width": 128, "height": 32, "size": 16384, "crc": 2368424546},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 3, "width": 128, "height": 128, "size": 65536, "crc": 2101251412},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 1083921210},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 0, "width": 128, "height": 32, "size": 4096, "crc": 2685300349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 1, "width": 128, "height": 8, "size": 1024, "crc": 2768572645},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 2, "width": 128, "height": 32, "size": 4096, "crc": 4194268279},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 3, "width": 128, "height": 32, "size": 4096, "crc": 1151077783},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 0, "width": 32, "height": 16, "size": 2048, "crc": 3757329756},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 1, "width": 64, "height": 16, "size": 4096, "crc": 1699380589},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 2, "width": 32, "height": 16, "size": 2048, "crc": 1250297732},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 3, "width": 32, "height": 16, "size": 2048, "crc": 1096370127},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 4, "width": 32, "height": 16, "size": 2048, "crc": 1461299380},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 634647465},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 1, "width": 128, "height": 128, "size": 65536, "crc": 2663295025},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 2, "width": 128, "height": 128, "size": 65536, "crc": 4013307535},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 3, "width": 128, "height": 128, "size": 65536, "crc": 1215291247},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_msg_icons", "bitmap": 4, "width": 128, "height": 128, "size": 65536, "crc": 4173016642},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_waypoints", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 1547299393},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 2514937598},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 1, "width": 64, "height": 64, "size": 16384, "crc": 1934334840},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 2, "width": 64, "height": 64, "size": 16384, "crc": 2036152485},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 3, "width": 64, "height": 64, "size": 16384, "crc": 1222075981},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 3524091297},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 5, "width": 64, "height": 64, "size": 16384, "crc": 1478490245},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 6, "width": 64, "height": 64, "size": 16384, "crc": 2425719365},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 2841977525},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 8, "width": 64, "height": 64, "size": 16384, "crc": 1789610607},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 9, "width": 64, "height": 64, "size": 16384, "crc": 10769595},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 10, "width": 64, "height": 64, "size": 16384, "crc": 112721360},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 11, "width": 64, "height": 64, "size": 16384, "crc": 1500905970},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 12, "width": 64, "height": 64, "size": 16384, "crc": 2831607766},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 13, "width": 64, "height": 64, "size": 16384, "crc": 3213345147},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticle_warnings", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 598528602},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_damage_arrows", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 4014689458},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 1530348706},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper_mask", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 3264958306},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_multiplayer", "bitmap": 0, "width": 64, "height": 32, "size": 2048, "crc": 279669690},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_counter_numbers", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 22576901},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip", "bitmap": 0, "width": 32, "height": 32, "size": 1024, "crc": 2905414509},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip_custom", "bitmap": 0, "width": 32, "height": 32, "size": 512, "crc": 2318551224},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_msg_icons_sm", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 2829841605},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_msg_icons_sm", "bitmap": 1, "width": 128, "height": 128, "size": 65536, "crc": 2261388858},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_health_base", "bitmap": 0, "width": 128, "height": 32, "size": 8192, "crc": 2334111445},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_alphas", "bitmap": 0, "width": 512, "height": 512, "size": 1048576, "crc": 2672369332},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_meters", "bitmap": 0, "width": 512, "height": 512, "size": 1048576, "crc": 1316117604},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\hud_reticles_scope", "bitmap": 0, "width": 64, "height": 64, "size": 16384, "crc": 3359213591},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 0, "width": 64, "height": 256, "size": 65536, "crc": 2440566533},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 1, "width": 64, "height": 256, "size": 65536, "crc": 1451459225},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 2, "width": 128, "height": 8, "size": 4096, "crc": 2199832653},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 3, "width": 128, "height": 8, "size": 4096, "crc": 1036536086},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 4, "width": 8, "height": 128, "size": 4096, "crc": 3263269116},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 0, "width": 32, "height": 128, "size": 16384, "crc": 703763697},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 1, "width": 32, "height": 128, "size": 16384, "crc": 183991369},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 2, "width": 128, "height": 4, "size": 2048, "crc": 2030486740},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 3, "width": 128, "height": 4, "size": 2048, "crc": 1345205876},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 4, "width": 4, "height": 64, "size": 1024, "crc": 1676080439},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\caption", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 120126724},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask2", "bitmap": 0, "width": 512, "height": 256, "size": 524288, "crc": 2575239539},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask_sm", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 2593381205},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 1764629049},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask split", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 343664195},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 0, "width": 256, "height": 64, "size": 65536, "crc": 3748199011},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 550837563},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 2, "width": 256, "height": 32, "size": 32768, "crc": 2456043857},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 3, "width": 256, "height": 32, "size": 32768, "crc": 1948057961},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 4, "width": 256, "height": 16, "size": 16384, "crc": 2860676839},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 5, "width": 128, "height": 8, "size": 4096, "crc": 3272812517},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 6, "width": 128, "height": 128, "size": 65536, "crc": 1984211349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 1269964274},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 8, "width": 256, "height": 64, "size": 65536, "crc": 526077822},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 9, "width": 256, "height": 64, "size": 65536, "crc": 2003746041},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 10, "width": 256, "height": 64, "size": 65536, "crc": 3746007716},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 11, "width": 128, "height": 32, "size": 16384, "crc": 3375336138},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 12, "width": 256, "height": 64, "size": 65536, "crc": 4225542721},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_meters", "bitmap": 0, "width": 512, "height": 512, "size": 262144, "crc": 3491893663}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"note": "High-res HUD textures whose bitmap has the same layout in Halo Custom Edition (the same sprites, the same size or twice it), compared against the stock bitmaps.map and bloodgulch.map; hud_hires.c draws them for a Custom Edition map's stock bitmap of that name as well.",
|
||||
"assets": [
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 0, "width": 128, "height": 32, "size": 4096, "crc": 2685300349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 1, "width": 128, "height": 8, "size": 1024, "crc": 2768572645},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 2, "width": 128, "height": 32, "size": 4096, "crc": 4194268279},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_outlines", "bitmap": 3, "width": 128, "height": 32, "size": 4096, "crc": 1151077783},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 0, "width": 32, "height": 16, "size": 2048, "crc": 3757329756},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 1, "width": 64, "height": 16, "size": 4096, "crc": 1699380589},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 2, "width": 32, "height": 16, "size": 2048, "crc": 1250297732},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 3, "width": 32, "height": 16, "size": 2048, "crc": 1096370127},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_type_icons", "bitmap": 4, "width": 32, "height": 16, "size": 2048, "crc": 1461299380},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_counter_numbers", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 22576901},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_damage_arrows", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 4014689458},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 0, "width": 256, "height": 64, "size": 65536, "crc": 3748199011},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 550837563},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 2, "width": 256, "height": 32, "size": 32768, "crc": 2456043857},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 3, "width": 256, "height": 32, "size": 32768, "crc": 1948057961},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 4, "width": 256, "height": 16, "size": 16384, "crc": 2860676839},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 5, "width": 128, "height": 8, "size": 4096, "crc": 3272812517},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 6, "width": 128, "height": 128, "size": 65536, "crc": 1984211349},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 1269964274},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_waypoints", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 1547299393},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 0, "width": 128, "height": 32, "size": 16384, "crc": 2336761448},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 1, "width": 128, "height": 32, "size": 16384, "crc": 1382921092},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 2, "width": 128, "height": 32, "size": 16384, "crc": 2368424546},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 3, "width": 128, "height": 128, "size": 65536, "crc": 2101251412},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_weapon_backgrounds", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 1083921210},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_health_base", "bitmap": 0, "width": 128, "height": 32, "size": 8192, "crc": 2334111445},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_multiplayer", "bitmap": 0, "width": 64, "height": 32, "size": 2048, "crc": 279669690},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip", "bitmap": 0, "width": 32, "height": 32, "size": 1024, "crc": 2905414509},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sensor_blip_custom", "bitmap": 0, "width": 32, "height": 32, "size": 512, "crc": 2318551224},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 1530348706},
|
||||
{"tag": "ui\\hud\\bitmaps\\hud_sweeper_mask", "bitmap": 0, "width": 64, "height": 64, "size": 4096, "crc": 3264958306},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 1764629049},
|
||||
{"tag": "ui\\hud\\bitmaps\\pistol\\pistol_scope_mask split", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 343664195},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 0, "width": 64, "height": 256, "size": 65536, "crc": 2440566533},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 1, "width": 64, "height": 256, "size": 65536, "crc": 1451459225},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 2, "width": 128, "height": 8, "size": 4096, "crc": 2199832653},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 3, "width": 128, "height": 8, "size": 4096, "crc": 1036536086},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs2", "bitmap": 4, "width": 8, "height": 128, "size": 4096, "crc": 3263269116},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 0, "width": 32, "height": 128, "size": 16384, "crc": 703763697},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 1, "width": 32, "height": 128, "size": 16384, "crc": 183991369},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 2, "width": 128, "height": 4, "size": 2048, "crc": 2030486740},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 3, "width": 128, "height": 4, "size": 2048, "crc": 1345205876},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_crosshairs_sm", "bitmap": 4, "width": 4, "height": 64, "size": 1024, "crc": 1676080439},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask2", "bitmap": 0, "width": 512, "height": 256, "size": 524288, "crc": 2575239539},
|
||||
{"tag": "ui\\hud\\bitmaps\\sniper\\sniper_scope_mask_sm", "bitmap": 0, "width": 256, "height": 256, "size": 262144, "crc": 2593381205},
|
||||
{"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks", "bitmap": 0, "width": 8, "height": 512, "size": 4096, "crc": 2262136367},
|
||||
{"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks2", "bitmap": 0, "width": 8, "height": 512, "size": 4096, "crc": 2208884634},
|
||||
{"tag": "weapons\\sniper rifle\\bitmaps\\angle_ticks_mask", "bitmap": 0, "width": 8, "height": 256, "size": 2048, "crc": 283547923},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_unit_meters", "bitmap": 0, "width": 512, "height": 512, "size": 262144, "crc": 3491893663, "replacement": "ce_hud_unit_meters"},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_ammo_meters", "bitmap": 0, "width": 512, "height": 512, "size": 1048576, "crc": 1316117604, "replacement": "ce_hud_ammo_meters"},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 0, "width": 128, "height": 128, "size": 65536, "crc": 2514937598},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 1, "width": 64, "height": 64, "size": 16384, "crc": 1934334840},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 2, "width": 64, "height": 64, "size": 16384, "crc": 2036152485},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 3, "width": 64, "height": 64, "size": 16384, "crc": 1222075981},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 4, "width": 64, "height": 64, "size": 16384, "crc": 3524091297},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 5, "width": 64, "height": 64, "size": 16384, "crc": 1478490245},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 6, "width": 64, "height": 64, "size": 16384, "crc": 2425719365},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 7, "width": 64, "height": 64, "size": 16384, "crc": 2841977525},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 8, "width": 64, "height": 64, "size": 16384, "crc": 1789610607},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 9, "width": 64, "height": 64, "size": 16384, "crc": 10769595},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 10, "width": 64, "height": 64, "size": 16384, "crc": 112721360},
|
||||
{"tag": "ui\\hud\\bitmaps\\combined\\hud_reticles", "bitmap": 11, "width": 64, "height": 64, "size": 16384, "crc": 1500905970}
|
||||
],
|
||||
"resource_sha256": "317658e0ebd4aa189bac68e994fe0b515928f44d17b62ba676d8850aa329dd3d"
|
||||
}
|
||||
@@ -62,7 +62,7 @@ until it is redrawn.
|
||||
| `ce/shell/main_menu/settings_select/player_setup/player_profile_edit/profile_options__6.png` | 512x256 | `shell/main_menu/settings_select/player_setup/player_profile_edit/profile_options__6.png` |
|
||||
| `ce/shell/main_menu/settings_select/player_setup/player_profile_edit/profile_options__8.png` | 512x256 | `shell/main_menu/settings_select/player_setup/player_profile_edit/profile_options__8.png` |
|
||||
|
||||
13 of 177 frames are placeholders.
|
||||
13 of 183 frames are placeholders.
|
||||
|
||||
The PC version's `ui\gamespy` and `ui\ticker` fonts are drawn with `ui\small_ui`, which
|
||||
the Xbox's map has.
|
||||
@@ -100,6 +100,14 @@ the bitmap has exactly two frames; the game's functions choose others.
|
||||
|
||||
A list of texts, which widgets show by number. `\n` starts a new line.
|
||||
|
||||
A list may name the PC version's list of the same texts with `map=` (its tag,
|
||||
`ui\shell\main_menu\main_menu_options`), and each of its texts that is one
|
||||
of that list's its number there (`<string text="NEW CAMPAIGN" map="0"/>`).
|
||||
Each Custom Edition has that list in its language in its `loc.map`: with
|
||||
`display.menu_language = "maps"`, a text with a number is the list's from
|
||||
the `loc.map` in `custom_maps`, when it has the list and the number. A text
|
||||
without one (the port's own) is always the file's.
|
||||
|
||||
### `<widget>`
|
||||
|
||||
A screen, or a part of one. Its children are `<widget>` elements in it, or
|
||||
|
||||
@@ -348,25 +348,31 @@
|
||||
<frame png="ce/port/pause/pausebox_left__0.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_left__1.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_left__2.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_left__3.png" width="16" height="256"/>
|
||||
</bitmap>
|
||||
<bitmap name="pause/pausebox_center">
|
||||
<frame png="ce/port/pause/pausebox_center__0.png" width="4" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_center__1.png" width="4" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_center__2.png" width="4" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_center__3.png" width="4" height="256"/>
|
||||
</bitmap>
|
||||
<bitmap name="pause/pausebox_right">
|
||||
<frame png="ce/port/pause/pausebox_right__0.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_right__1.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_right__2.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/pausebox_right__3.png" width="16" height="256"/>
|
||||
</bitmap>
|
||||
<bitmap name="pause/objectives_left">
|
||||
<frame png="ce/port/pause/objectives_left__0.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/objectives_left__1.png" width="16" height="256"/>
|
||||
</bitmap>
|
||||
<bitmap name="pause/objectives_center">
|
||||
<frame png="ce/port/pause/objectives_center__0.png" width="4" height="256"/>
|
||||
<frame png="ce/port/pause/objectives_center__1.png" width="4" height="256"/>
|
||||
</bitmap>
|
||||
<bitmap name="pause/objectives_right">
|
||||
<frame png="ce/port/pause/objectives_right__0.png" width="16" height="256"/>
|
||||
<frame png="ce/port/pause/objectives_right__1.png" width="16" height="256"/>
|
||||
</bitmap>
|
||||
<bitmap name="voice/speaker">
|
||||
<frame png="ce/port/voice/speaker__0.png" width="24" height="24"/>
|
||||
|
||||
@@ -236,9 +236,12 @@
|
||||
<on event="created" run="port setup options init"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_friendly_fire" x="54" y="73"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_extra_enemies" x="54" y="103"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_per_player" x="54" y="133"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_multiplier" x="54" y="133"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_player_collisions" x="54" y="163"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_extra_pickups" x="54" y="133"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_extra_vehicles" x="54" y="163"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_multiplier" x="54" y="193"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_per_player" x="54" y="223"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_player_collisions" x="54" y="253"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_ally_friendly_fire" x="54" y="283"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -276,31 +279,43 @@
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_extra_enemies">
|
||||
<string text="NONE"/>
|
||||
<string text="PER PLAYER"/>
|
||||
<string text="STATIC MULTIPLIER"/>
|
||||
<string text="NONE"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_per_player" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_spinner" x="286" y="1"/>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_extra_pickups" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_pickups_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_pickups_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_pickups_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_enemies_per_player" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_pickups_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_extra_pickups" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_enemies_per_player">
|
||||
<string text="25%"/>
|
||||
<string text="50%"/>
|
||||
<string text="100%"/>
|
||||
<string text="150%"/>
|
||||
<string text="200%"/>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_extra_pickups">
|
||||
<string text="PER PLAYER"/>
|
||||
<string text="STATIC MULTIPLIER"/>
|
||||
<string text="NONE"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_extra_vehicles" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_vehicles_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_vehicles_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_vehicles_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_extra_vehicles_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_extra_vehicles" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_extra_vehicles">
|
||||
<string text="PER PLAYER"/>
|
||||
<string text="STATIC MULTIPLIER"/>
|
||||
<string text="NONE"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_multiplier" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_multiplier_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_multiplier_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_multiplier_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_multiplier_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_multiplier_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_enemies_multiplier" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
@@ -312,11 +327,27 @@
|
||||
<string text="16X"/>
|
||||
<string text="32X"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_enemies_per_player" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_enemies_per_player_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_enemies_per_player" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_enemies_per_player">
|
||||
<string text="25%"/>
|
||||
<string text="50%"/>
|
||||
<string text="100%"/>
|
||||
<string text="150%"/>
|
||||
<string text="200%"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_player_collisions" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_player_collisions_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_player_collisions_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_player_collisions_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_player_collisions_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_player_collisions_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_player_collisions" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
@@ -325,33 +356,57 @@
|
||||
<string text="ON"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/op_coop_ally_friendly_fire" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_label"/>
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_label" type="text" controller="1" width="300" height="22" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_ally_friendly_fire_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_ally_friendly_fire" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/var_coop_ally_friendly_fire">
|
||||
<string text="ON"/>
|
||||
<string text="OFF"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/coop_options_labels">
|
||||
<string text="FRIENDLY FIRE:"/>
|
||||
<string text="EXTRA ENEMIES:"/>
|
||||
<string text="PER PLAYER:"/>
|
||||
<string text="EXTRA PICKUPS:"/>
|
||||
<string text="EXTRA VEHICLES:"/>
|
||||
<string text="MULTIPLIER:"/>
|
||||
<string text="PER PLAYER:"/>
|
||||
<string text="PLAYER COLLISIONS:"/>
|
||||
<string text="ALLY FRIENDLY FIRE:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/multiplayer_type_select/server_settings/coop_options/cap_coop_options">
|
||||
<string text="Players can not be hurt by weapons and explosives\nfired by the other players."/>
|
||||
<string text="Players can be hurt by weapons or explosives\nfired by the other players."/>
|
||||
<string text="Damage from the other players will only reduce\nshields. Health will be unaffected."/>
|
||||
<string text="Players can be hurt by damage from explosives\nfired by the other players."/>
|
||||
<string text="Enemy squads grow with the players: by the value of\n'Per Player' for each player past the first."/>
|
||||
<string text="Enemy squads use 'Multiplier', however many players\nthere are."/>
|
||||
<string text="Enemy squads are as the campaign has them."/>
|
||||
<string text="Enemy squads grow with the players: by the amount\nbelow for each player past the first."/>
|
||||
<string text="Enemy squads are the amount below times as large,\nhowever many players there are."/>
|
||||
<string text="For each player past the first, enemy squads get\nthis much more of themselves (100%: as many again)."/>
|
||||
<string text="For each player past the first, enemy squads get\nthis much more of themselves (100%: as many again)."/>
|
||||
<string text="For each player past the first, enemy squads get\nthis much more of themselves (100%: as many again)."/>
|
||||
<string text="For each player past the first, enemy squads get\nthis much more of themselves (100%: as many again)."/>
|
||||
<string text="For each player past the first, enemy squads get\nthis much more of themselves (100%: as many again)."/>
|
||||
<string text="Each enemy squad is this many times as large."/>
|
||||
<string text="Each enemy squad is this many times as large."/>
|
||||
<string text="Each enemy squad is this many times as large."/>
|
||||
<string text="Each enemy squad is this many times as large."/>
|
||||
<string text="Each enemy squad is this many times as large."/>
|
||||
<string text="Pickups grow with the players: by the value of\n'Per Player' for each player past the first."/>
|
||||
<string text="Pickups use 'Multiplier', up to eight times as many,\nhowever many players there are."/>
|
||||
<string text="Pickups are as the campaign has them."/>
|
||||
<string text="Vehicles respawn after being driven a short distance\nbased on the number of players: by two thirds the value of\n'Per Player' for each player past the first."/>
|
||||
<string text="Vehicles respawn after being driven a short distance,\nwith extra copies equal to ('Multiplier' - 1) * 2/3,\nrounded down, however many players there are."/>
|
||||
<string text="Vehicles are as the campaign has them."/>
|
||||
<string text="Static amounts for the options set to this mode.\nPickups are capped at eight times as many."/>
|
||||
<string text="Static amounts for the options set to this mode.\nPickups are capped at eight times as many."/>
|
||||
<string text="Static amounts for the options set to this mode.\nPickups are capped at eight times as many."/>
|
||||
<string text="Static amounts for the options set to this mode.\nPickups are capped at eight times as many."/>
|
||||
<string text="Static amounts for the options set to this mode.\nPickups are capped at eight times as many."/>
|
||||
<string text="For each player past the first, options set to Per\nPlayer get this much more (100%: as many again)."/>
|
||||
<string text="For each player past the first, options set to Per\nPlayer get this much more (100%: as many again)."/>
|
||||
<string text="For each player past the first, options set to Per\nPlayer get this much more (100%: as many again)."/>
|
||||
<string text="For each player past the first, options set to Per\nPlayer get this much more (100%: as many again)."/>
|
||||
<string text="For each player past the first, options set to Per\nPlayer get this much more (100%: as many again)."/>
|
||||
<string text="Players bump into each other, as in the campaign."/>
|
||||
<string text="Players walk through each other, so that no one\nblocks a doorway. The AI's characters still block."/>
|
||||
<string text="Players can hurt and kill their AI allies, as in\nthe campaign."/>
|
||||
<string text="Players can not hurt their AI allies, so that no\none can kill Keyes or the Marines a level needs."/>
|
||||
</strings>
|
||||
<widget name="main_menu/multiplayer_type_select/server_settings/voice_options/voice_options_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
<child widget="main_menu/multiplayer_type_select/server_settings/voice_options/header_voice_options"/>
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's multiplayer screens, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/header_opence"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_menu"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/header_opence" controller="1" left="35" top="11" width="363" height="59" type="text" text="OPENCE OPTIONS" font="ui\large_ui" color="#FFFFFFFF" text_x="13" text_y="16">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_help" type="text" controller="1" left="68" top="341" width="482" height="79" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/cap_opence" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_help">
|
||||
<data input="game settings lists text update"/>
|
||||
<on event="created" run="mp profile init opence options"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_mode" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_hardcore" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_zombies" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_speed" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_damage" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_respawn" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_countdown" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_shields" x="54" y="283"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_order" x="54" y="313"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_melee" x="54" y="343"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<data input="common button bar update"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_ok" x="380" y="1"/>
|
||||
<child widget="common_button_cancel" x="510" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_button_ok" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="1" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="mp profile set opence options" back="true"/>
|
||||
<on event="start" run="mp profile set opence options" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_mode" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="0" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_mode_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_mode" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_mode">
|
||||
<string text="NONE"/>
|
||||
<string text="SWAT"/>
|
||||
<string text="INFECTION"/>
|
||||
<string text="GUN GAME"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_oce_hardcore" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/oce_hardcore_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_hardcore" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_oce_hardcore">
|
||||
<string text="OFF"/>
|
||||
<string text="ON"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_zombies" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_zombies_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_zombies" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_zombies">
|
||||
<string text="1"/>
|
||||
<string text="2"/>
|
||||
<string text="3"/>
|
||||
<string text="4"/>
|
||||
<string text="8"/>
|
||||
<string text="16"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_speed" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_speed_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_speed" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_speed">
|
||||
<string text="100%"/>
|
||||
<string text="110%"/>
|
||||
<string text="125%"/>
|
||||
<string text="150%"/>
|
||||
<string text="175%"/>
|
||||
<string text="200%"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_damage" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_damage_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_damage" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_damage">
|
||||
<string text="100%"/>
|
||||
<string text="150%"/>
|
||||
<string text="200%"/>
|
||||
<string text="250%"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_respawn" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_respawn_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_respawn" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_respawn">
|
||||
<string text="1 SECOND"/>
|
||||
<string text="3 SECONDS"/>
|
||||
<string text="5 SECONDS"/>
|
||||
<string text="10 SECONDS"/>
|
||||
<string text="15 SECONDS"/>
|
||||
<string text="30 SECONDS"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_countdown" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_countdown_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_countdown" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_countdown">
|
||||
<string text="NONE"/>
|
||||
<string text="5 SECONDS"/>
|
||||
<string text="10 SECONDS"/>
|
||||
<string text="15 SECONDS"/>
|
||||
<string text="30 SECONDS"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_inf_shields" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/inf_shields_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_shields" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_inf_shields">
|
||||
<string text="OFF"/>
|
||||
<string text="ON"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_order" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="8" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_order_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_order" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_order">
|
||||
<string text="STRONGEST FIRST"/>
|
||||
<string text="WEAKEST FIRST"/>
|
||||
<string text="RANDOM"/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/op_gg_melee" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels" string_index="9" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/opence_options_edit/gg_melee_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_melee" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/var_gg_melee">
|
||||
<string text="OFF"/>
|
||||
<string text="ON"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_labels">
|
||||
<string text="MODE:"/>
|
||||
<string text="HARDCORE:"/>
|
||||
<string text="FIRST ZOMBIES:"/>
|
||||
<string text="ZOMBIE SPEED:"/>
|
||||
<string text="SKULL DAMAGE:"/>
|
||||
<string text="ZOMBIE RESPAWN:"/>
|
||||
<string text="COUNTDOWN:"/>
|
||||
<string text="ZOMBIE SHIELDS:"/>
|
||||
<string text="WEAPON ORDER:"/>
|
||||
<string text="MELEE DEMOTES:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/opence_options_edit/cap_opence">
|
||||
<string text="The game type's own rules."/>
|
||||
<string text="No shields, and a shot to the head kills. Slayer only."/>
|
||||
<string text="Humans killed join the zombies, who win when\nno human is left. Team Slayer only."/>
|
||||
<string text="Each kill gives the next weapon; a kill with the\nlast wins. Free for all Slayer only."/>
|
||||
<string text="The motion sensor and aim assist as the game\ntype has them."/>
|
||||
<string text="No motion sensor, no aim assist, and a kill\nrestores the killer's health and shields."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="The zombies chosen when the round starts\n(a human is always left)."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="How fast zombies move, of a human's speed."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="The damage of a zombie's skull's melee."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long a dead zombie waits to respawn."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="How long the round waits, once two players are\nalive, before the first zombies are chosen."/>
|
||||
<string text="Zombies have no shields."/>
|
||||
<string text="Zombies have shields, as humans do."/>
|
||||
<string text="From the rocket launcher to the pistol."/>
|
||||
<string text="From the pistol to the rocket launcher."/>
|
||||
<string text="In an order the host draws for each game."/>
|
||||
<string text="A melee kill takes nothing from the victim."/>
|
||||
<string text="A melee kill takes the victim back a weapon."/>
|
||||
</strings>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_opence_item" type="text" left="51" top="309" width="232" height="32" bitmap="bitmaps/list_item_bkd" text="OPENCE OPTIONS" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="5">
|
||||
<on event="a" open="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/multiplayer_setup/opence_options_edit/opence_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
</menus>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's multiplayer screens, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/op_aim_assist" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/aim_assist_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/aim_assist_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/aim_assist_label" type="text" controller="1" width="280" height="22" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_labels" string_index="8" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/aim_assist_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/var_aim_assist" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shield_effects" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_label"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_spinner" x="286" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_label" type="text" controller="1" width="280" height="22" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_labels" string_index="9" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/shield_effects_spinner" type="spinner" top="2" width="206" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/var_shield_effects" font="ui\large_ui" color="#FF2896FF" align="center" text_y="4" list_flags="items_from_strings" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -13 19 -7" footer_bounds="7 208 19 214">
|
||||
<on event="left_mouse" run="mouse spinner 1wide click"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/player_options_edit/var_aim_assist">
|
||||
<string text="ALLOWED"/>
|
||||
<string text="BLOCK M+KB"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/multiplayer_setup/player_options_edit/var_shield_effects">
|
||||
<string text="STOCK"/>
|
||||
<string text="GLOW"/>
|
||||
<string text="LIGHT SHOW"/>
|
||||
<string text="OVERSHIELD"/>
|
||||
<string text="GLOW+OVERSHIELD"/>
|
||||
<string text="SHOW+OVERSHIELD"/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -65,19 +65,21 @@
|
||||
<on event="start" run="mp profile set player options" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_help" type="text" controller="1" left="68" top="321" width="482" height="79" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/cap_player_options" font="ui\large_ui" color="#FFFFFFFF">
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_help" type="text" controller="1" left="68" top="345" width="482" height="60" string_list="main_menu/settings_select/multiplayer_setup/player_options_edit/cap_player_options" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_help">
|
||||
<data input="game settings lists text update"/>
|
||||
<on event="created" run="mp profile init player opts"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_number_of_lives" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_maximum_health" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shields" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time_growth" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_odd_man_out" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_invisible_players" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_suicide_penalty" x="54" y="283"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_maximum_health" x="54" y="100"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shields" x="54" y="127"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time" x="54" y="154"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_respawn_time_growth" x="54" y="181"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_odd_man_out" x="54" y="208"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_invisible_players" x="54" y="235"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_suicide_penalty" x="54" y="262"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_aim_assist" x="54" y="289"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/op_shield_effects" x="54" y="316"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/player_options_edit/player_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/player_options_edit/player_options_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/playlist_edit/edit_playlist_select_list" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_list_extended_desc">
|
||||
<data input="playlist settings menu update desc"/>
|
||||
<data input="port playlist edit desc"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_name_list_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_game_type_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_player_opts_item"/>
|
||||
@@ -10,6 +11,7 @@
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_vehicles_list_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_indicators_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_team_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_opence_item"/>
|
||||
<child widget="main_menu/settings_select/multiplayer_setup/playlist_edit/playlist_edit_button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/multiplayer_setup/playlist_edit/gametype_edit_screen" width="640" height="480" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/gradient">
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_preset_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_preset_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEFAULT|SWAP TRIGGERS|SWAP A, L TRIGGER|SWAP B, L TRIGGER|SWAP B, R STICK" setting="profile.button_preset" values="0|1|2|3|4" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_preset_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEFAULT|SWAP TRIGGERS|SWAP A, L TRIGGER|SWAP B, L TRIGGER|SWAP B, R STICK|BUMPER JUMPER" setting="profile.button_preset" values="0|1|2|3|4|5" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/op_joystick_preset" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The port's settings screen, in the PC version's style (tools/port_settings.py) -->
|
||||
<menus>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/extra_effects_settings_screen" width="640" height="480" flags="pass_unhandled_to_focused_child pause_game" bitmap="bitmaps/gradient">
|
||||
<on event="b" back="true"/>
|
||||
<on event="back" back="true"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/header_profile_video_settings"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/options_menu"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/header_profile_video_settings" controller="1" left="35" top="11" width="605" height="59" bitmap="main_menu/settings_select/player_setup/player_profile_edit/video_settings/header_profile_video_settings">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/help" type="text" controller="1" left="68" top="350" width="482" height="60" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/help_strings" font="ui\large_ui" color="#FFFFFFFF">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/options_menu" type="column_list" width="640" height="480" flags="pass_unhandled_to_focused_child up_down_tabs_children" description="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/help">
|
||||
<data input="port settings help"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_overshield_effect" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_shield_glow" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_shield_glow_intensity" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_hdr" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_hdr_output" x="54" y="193" platform="desktop"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/button_defaults" y="1"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/button_ok" x="380" y="1"/>
|
||||
<child widget="common_button_cancel" x="510" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_overshield_effect" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/overshield_effect_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/overshield_effect_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/overshield_effect_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/labels" string_index="0" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/overshield_effect_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.overshield_effect" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_shield_glow" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/labels" string_index="1" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.shield_glow" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_shield_glow_intensity" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_intensity_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_intensity_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_intensity_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/labels" string_index="2" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/shield_glow_intensity_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEFAULT|LIGHT SHOW" setting="display.shield_glow_intensity" values="default|light_show" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_hdr" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.hdr" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/op_hdr_output" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF" platform="desktop">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_output_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_output_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_output_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/hdr_output_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.hdr_output" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
<on event="start" run="port settings defaults"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/button_ok" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="1" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings save" back="true"/>
|
||||
<on event="start" run="port settings save" back="true"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
</widget>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/labels">
|
||||
<string text="OVERSHIELD:"/>
|
||||
<string text="SHIELD GLOW:"/>
|
||||
<string text="GLOW INTENSITY:"/>
|
||||
<string text="HDR:"/>
|
||||
<string text="HDR DISPLAY:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/help_strings">
|
||||
<string text=""/>
|
||||
<string text="The overshield rises up the body and stays lit,\nin its own color. Online: the host's choice."/>
|
||||
<string text="Shields light their surroundings as they flare.\nOnline: the host's choice."/>
|
||||
<string text="Light Show: three times as far, at full from a\nthird of the flare. Online: the host's choice."/>
|
||||
<string text="Keep the light of explosions, plasma and the sun\npast white, and roll it off instead of clipping."/>
|
||||
<string text="With HDR, on an HDR display, show that light\nbrighter than white. From the next start."/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -16,9 +16,10 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_fov" x="54" y="73"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_viewmodel_fov" x="54" y="103"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_viewmodel_visible" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_viewmodel_shield" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_first_person_legs" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_shield_color" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_passenger_third_person" x="54" y="163"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_viewmodel_shield" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_first_person_legs" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_shield_color" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -53,11 +54,20 @@
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/viewmodel_visible_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.viewmodel_visible" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_passenger_third_person" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/passenger_third_person_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/passenger_third_person_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/passenger_third_person_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/passenger_third_person_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.passenger_third_person" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/op_viewmodel_shield" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/viewmodel_shield_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/viewmodel_shield_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/viewmodel_shield_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/labels" string_index="3" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/viewmodel_shield_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/viewmodel_shield_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.viewmodel_shield" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
@@ -66,7 +76,7 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/first_person_legs_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/first_person_legs_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/first_person_legs_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/labels" string_index="4" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/first_person_legs_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/first_person_legs_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.first_person_legs" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
@@ -75,7 +85,7 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/shield_color_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/shield_color_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/shield_color_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/shield_color_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels/shield_color_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEFAULT|WHITE|BLACK|RED|BLUE|GRAY|YELLOW|GREEN|PINK|PURPLE|CYAN|COBALT|ORANGE|TEAL|SAGE|BROWN|TAN|MAROON|SALMON" setting="display.shield_color" values="default|white|black|red|blue|gray|yellow|green|pink|purple|cyan|cobalt|orange|teal|sage|brown|tan|maroon|salmon" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
@@ -94,6 +104,7 @@
|
||||
<string text="FOV:"/>
|
||||
<string text="VIEWMODEL FOV:"/>
|
||||
<string text="VIEWMODELS:"/>
|
||||
<string text="PASSENGER THIRD PERSON:"/>
|
||||
<string text="ARM SHIELDS:"/>
|
||||
<string text="LEGS:"/>
|
||||
<string text="SHIELD COLOR:"/>
|
||||
@@ -103,6 +114,7 @@
|
||||
<string text="On foot, horizontal at 16:9, in degrees.\nDefault keeps the stock view."/>
|
||||
<string text="The weapon and hands, horizontal at 16:9.\nDefault keeps the weapon's stock view."/>
|
||||
<string text="Draw first-person weapons, hands and attached\nvisuals. Gameplay and sound continue when off."/>
|
||||
<string text="Third-person Warthog and Scorpion passengers in\nthe campaign and co-op. Weapon zoom is disabled."/>
|
||||
<string text="The energy shield's flare on your first-person\narms too, as on your body."/>
|
||||
<string text="Your legs in first person, seen looking down,\nmoving as you run. Your body as others see it."/>
|
||||
<string text="Your shield's flare in an armor color, whatever\nyour armor. Only you see it. Default: its own."/>
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_high_res_text" x="54" y="133"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_anti_aliasing" x="54" y="163" platform="desktop"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_anti_aliasing_android" x="54" y="163" platform="android web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_shadow_resolution" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_per_pixel_lighting" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_shield_glow" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_shield_glow_intensity" x="54" y="283"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_anisotropic_filtering" x="54" y="193"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_shadow_resolution" x="54" y="223"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_per_pixel_lighting" x="54" y="253"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_model_detail" x="54" y="283"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_match_timer" x="54" y="313"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -74,11 +75,20 @@
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/anti_aliasing_android_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="OFF|FXAA|MSAA 2X|MSAA 4X" setting="display.anti_aliasing" values="off|fxaa|msaa2x|msaa4x" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_anisotropic_filtering" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/anisotropic_filtering_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/anisotropic_filtering_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/anisotropic_filtering_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/anisotropic_filtering_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="OFF|2X|4X|8X|16X" setting="display.anisotropic_filtering" values="0|2|4|8|16" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_shadow_resolution" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shadow_resolution_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shadow_resolution_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shadow_resolution_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="5" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shadow_resolution_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shadow_resolution_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="128|256|512|1024" setting="display.shadow_resolution" values="128|256|512|1024" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
@@ -87,27 +97,27 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/per_pixel_lighting_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/per_pixel_lighting_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/per_pixel_lighting_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="6" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/per_pixel_lighting_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/per_pixel_lighting_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.per_pixel_lighting" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_shield_glow" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_spinner" x="320" y="1"/>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_model_detail" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/model_detail_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/model_detail_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="7" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/model_detail_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="8" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.shield_glow" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/model_detail_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="STOCK|NATIVE|HIGHEST" setting="display.model_detail" values="stock|native|highest" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_shield_glow_intensity" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_intensity_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_intensity_spinner" x="320" y="1"/>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/op_match_timer" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/match_timer_label"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/match_timer_spinner" x="320" y="1"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_intensity_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="8" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/match_timer_label" type="text" controller="1" width="300" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/labels" string_index="9" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/shield_glow_intensity_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="DEFAULT|LIGHT SHOW" setting="display.shield_glow_intensity" values="default|light_show" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/match_timer_spinner" type="spinner" left="3" top="2" width="147" height="20" flags="pass_unhandled_to_focused_child left_right_tabs_items" strings="ON|OFF" setting="display.match_timer" values="true|false" font="ui\large_ui" color="#FF2896FF" align="center" text_y="1" header_bitmap="bitmaps/arrow_sm_left" footer_bitmap="bitmaps/arrow_sm_right" header_bounds="7 -6 19 0" footer_bounds="7 150 19 156">
|
||||
<on event="created" run="port setting load"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
@@ -126,10 +136,11 @@
|
||||
<string text="HIGH-RES TEXT:"/>
|
||||
<string text="ANTI-ALIASING:"/>
|
||||
<string text="ANTI-ALIASING:"/>
|
||||
<string text="TEXTURE FILTERING:"/>
|
||||
<string text="SHADOW RESOLUTION:"/>
|
||||
<string text="PER-PIXEL LIGHTING:"/>
|
||||
<string text="SHIELD GLOW:"/>
|
||||
<string text="GLOW INTENSITY:"/>
|
||||
<string text="MODEL DETAIL:"/>
|
||||
<string text="MATCH TIMER:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/graphics/help_strings">
|
||||
<string text=""/>
|
||||
@@ -138,9 +149,10 @@
|
||||
<string text="Draw text and titles with high-res fonts; off\ndraws the game's own."/>
|
||||
<string text="Smooth jagged edges, which the Xbox did not. FXAA\nand SMAA are cheap; SSAA and MSAA are sharper."/>
|
||||
<string text="Smooth jagged edges, which the Xbox did not. FXAA\nis cheap; MSAA is sharper."/>
|
||||
<string text="Keep floors and walls sharp at a grazing angle,\nwhich the Xbox did not. Off: as the Xbox."/>
|
||||
<string text="The size objects' shadows are drawn at: 128 as on\nthe Xbox; larger for smoother, as soft, edges."/>
|
||||
<string text="Light models for each pixel, without the facets\nof the Xbox's lighting for each vertex."/>
|
||||
<string text="Shields light their surroundings as they flare,\nin the shield's own color."/>
|
||||
<string text="Light Show: the shield glow three times as far,\nat full from a third of the flare."/>
|
||||
<string text="Stock picks models' detail by the Xbox's 480 lines;\nnative by this display's; highest, always the best."/>
|
||||
<string text="Draw a clock at the bottom right in multiplayer,\ncounting up from the start of the game."/>
|
||||
</strings>
|
||||
</menus>
|
||||
@@ -34,6 +34,9 @@
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/op_fov_viewmodels" x="54" y="313" platform="desktop"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/op_fov_viewmodels" x="54" y="163" platform="android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/op_fov_viewmodels" x="54" y="253" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/op_extra_effects" x="54" y="343" platform="desktop"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/op_extra_effects" x="54" y="193" platform="android"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/op_extra_effects" x="54" y="283" platform="web"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/button_bar" y="414"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/button_bar" type="column_list" width="640" height="28" flags="pass_unhandled_to_focused_child left_right_tabs_items">
|
||||
@@ -129,6 +132,14 @@
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/fov_viewmodels_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/labels" string_index="9" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/op_extra_effects" width="512" height="28" flags="pass_unhandled_to_focused_child" bitmap="bitmaps/option_bkds" color="#FF2896FF">
|
||||
<on event="a" open="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/extra_effects_settings_screen"/>
|
||||
<on event="start" open="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects/extra_effects_settings_screen"/>
|
||||
<on event="left_mouse" run="mouse emit accept event"/>
|
||||
<child widget="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects_label"/>
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/extra_effects_label" type="text" controller="1" width="512" height="22" string_list="main_menu/settings_select/player_setup/player_profile_edit/video_settings/labels" string_index="10" font="ui\large_ui" color="#FF2896FF" text_x="13" text_y="4">
|
||||
</widget>
|
||||
<widget name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/button_defaults" type="text" width="128" height="24" bitmap="bitmaps/text_button_background" string_list="strings/common_button_captions" string_index="3" font="ui\small_ui" color="#FFFFFFFF" align="center" text_y="2">
|
||||
<on event="a" run="port settings defaults"/>
|
||||
<on event="start" run="port settings defaults"/>
|
||||
@@ -150,6 +161,7 @@
|
||||
<string text="INSTANT AIM:"/>
|
||||
<string text="GRAPHICS:"/>
|
||||
<string text="FOV AND VIEWMODELS:"/>
|
||||
<string text="EXTRA EFFECTS:"/>
|
||||
</strings>
|
||||
<strings name="main_menu/settings_select/player_setup/player_profile_edit/video_settings/help_strings">
|
||||
<string text=""/>
|
||||
@@ -161,7 +173,8 @@
|
||||
<string text="With V-Sync off, the most frames a second. Auto:\ntwice the display's refresh rate."/>
|
||||
<string text="Draw a frame for every display refresh, blending\nbetween the game's 30 ticks a second."/>
|
||||
<string text="In first person, turn the view the moment the\nmouse moves, not up to two ticks later."/>
|
||||
<string text="The HUD, text, anti-aliasing, shadows and\nlighting."/>
|
||||
<string text="The HUD, text, anti-aliasing, shadows,\nlighting and HDR."/>
|
||||
<string text="The field of view and the first-person\nweapon. Their defaults keep the stock view."/>
|
||||
<string text="Visual modifiers the stock game does not\nhave, such as the shield glow."/>
|
||||
</strings>
|
||||
</menus>
|
||||
|
After Width: | Height: | Size: 469 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 467 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -27,6 +27,8 @@
|
||||
"ce/main_menu.settings_select.multiplayer_setup.item_options_edit.port.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.item_options_edit.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.name_edit.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.opence_options_edit.port.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.player_options_edit.port.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.player_options_edit.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.playlist_edit.ctf_edit.xml",
|
||||
"ce/main_menu.settings_select.multiplayer_setup.playlist_edit.game_type_select.xml",
|
||||
@@ -52,6 +54,7 @@
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.multiplayer_hud.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.streamer_mode.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.network_setup.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.video_settings.extra_effects.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.video_settings.fov_viewmodels.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.video_settings.graphics.xml",
|
||||
"ce/main_menu.settings_select.player_setup.player_profile_edit.video_settings.xml",
|
||||
@@ -80,17 +83,23 @@
|
||||
"ce/port/mods/status_small__1.png",
|
||||
"ce/port/mods/status_small__2.png",
|
||||
"ce/port/pause/objectives_center__0.png",
|
||||
"ce/port/pause/objectives_center__1.png",
|
||||
"ce/port/pause/objectives_left__0.png",
|
||||
"ce/port/pause/objectives_left__1.png",
|
||||
"ce/port/pause/objectives_right__0.png",
|
||||
"ce/port/pause/objectives_right__1.png",
|
||||
"ce/port/pause/pausebox_center__0.png",
|
||||
"ce/port/pause/pausebox_center__1.png",
|
||||
"ce/port/pause/pausebox_center__2.png",
|
||||
"ce/port/pause/pausebox_center__3.png",
|
||||
"ce/port/pause/pausebox_left__0.png",
|
||||
"ce/port/pause/pausebox_left__1.png",
|
||||
"ce/port/pause/pausebox_left__2.png",
|
||||
"ce/port/pause/pausebox_left__3.png",
|
||||
"ce/port/pause/pausebox_right__0.png",
|
||||
"ce/port/pause/pausebox_right__1.png",
|
||||
"ce/port/pause/pausebox_right__2.png",
|
||||
"ce/port/pause/pausebox_right__3.png",
|
||||
"ce/port/voice/speaker__0.png",
|
||||
"ce/port/voice/speaker__1.png",
|
||||
"ce/shell/bitmaps/alert_bkd__0.png",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="4" height="256" viewBox="0 0 4 256">
|
||||
<defs><linearGradient id="body" gradientUnits="userSpaceOnUse" x1="0" y1="29" x2="0" y2="223">
|
||||
<stop offset="0" stop-color="#0a2649"/>
|
||||
<stop offset="1" stop-color="#050d1c"/>
|
||||
</linearGradient></defs>
|
||||
<rect x="0" y="2" width="4" height="221" fill="url(#body)" fill-opacity="0.75"/>
|
||||
<rect x="0" y="0" width="4" height="2" fill="#2896ff"/>
|
||||
<rect x="0" y="223" width="4" height="2" fill="#2896ff"/>
|
||||
<g>
|
||||
<rect x="0" y="2" width="4" height="26" fill="black"/>
|
||||
<rect x="0" y="28" width="4" height="0.75" fill="#2896ff"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 640 B |
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="256" viewBox="0 0 16 256">
|
||||
<defs><linearGradient id="body" gradientUnits="userSpaceOnUse" x1="0" y1="29" x2="0" y2="223">
|
||||
<stop offset="0" stop-color="#0a2649"/>
|
||||
<stop offset="1" stop-color="#050d1c"/>
|
||||
</linearGradient></defs>
|
||||
<path d="M9.5,1 H17 V224 H9.5 A8.5,8.5 0 0 1 1,215.5 V9.5 A8.5,8.5 0 0 1 9.5,1 Z" fill="url(#body)" fill-opacity="0.75" fill-rule="evenodd"/>
|
||||
<path d="M17,1 H9.5 A8.5,8.5 0 0 0 1,9.5 V215.5 A8.5,8.5 0 0 0 9.5,224 H17" fill="none" stroke="#2896ff" stroke-width="2"/>
|
||||
<defs><clipPath id="strip"><rect x="2" y="2" width="32" height="221" rx="7.5"/></clipPath></defs>
|
||||
<g clip-path="url(#strip)">
|
||||
<rect x="0" y="2" width="16" height="26" fill="black"/>
|
||||
<rect x="0" y="28" width="16" height="0.75" fill="#2896ff"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 837 B |
@@ -0,0 +1,15 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="256" viewBox="0 0 16 256">
|
||||
<defs><linearGradient id="body" gradientUnits="userSpaceOnUse" x1="0" y1="29" x2="0" y2="223">
|
||||
<stop offset="0" stop-color="#0a2649"/>
|
||||
<stop offset="1" stop-color="#050d1c"/>
|
||||
</linearGradient></defs>
|
||||
<g transform="matrix(-1 0 0 1 16 0)">
|
||||
<path d="M9.5,1 H17 V224 H9.5 A8.5,8.5 0 0 1 1,215.5 V9.5 A8.5,8.5 0 0 1 9.5,1 Z" fill="url(#body)" fill-opacity="0.75" fill-rule="evenodd"/>
|
||||
<path d="M17,1 H9.5 A8.5,8.5 0 0 0 1,9.5 V215.5 A8.5,8.5 0 0 0 9.5,224 H17" fill="none" stroke="#2896ff" stroke-width="2"/>
|
||||
</g>
|
||||
<defs><clipPath id="strip"><rect x="-16" y="2" width="30" height="221" rx="7.5"/></clipPath></defs>
|
||||
<g clip-path="url(#strip)">
|
||||
<rect x="0" y="2" width="16" height="26" fill="black"/>
|
||||
<rect x="0" y="28" width="16" height="0.75" fill="#2896ff"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 890 B |
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="4" height="256" viewBox="0 0 4 256">
|
||||
<defs><clipPath id="body-area"><rect x="-16" y="0" width="48" height="197"/></clipPath></defs>
|
||||
<defs><linearGradient id="body" gradientUnits="userSpaceOnUse" x1="0" y1="2" x2="0" y2="197">
|
||||
<stop offset="0" stop-color="#0a2649"/>
|
||||
<stop offset="1" stop-color="#050d1c"/>
|
||||
</linearGradient></defs>
|
||||
<rect x="0" y="2" width="4" height="221" fill="url(#body)" fill-opacity="0.75" clip-path="url(#body-area)"/>
|
||||
<rect x="0" y="0" width="4" height="2" fill="#2896ff"/>
|
||||
<rect x="0" y="223" width="4" height="2" fill="#2896ff"/>
|
||||
<g>
|
||||
<rect x="0" y="197" width="4" height="26" fill="black" fill-opacity="0.75"/>
|
||||
<rect x="0" y="197" width="4" height="0.75" fill="#2896ff"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 787 B |
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="256" viewBox="0 0 16 256">
|
||||
<defs><clipPath id="body-area"><rect x="-16" y="0" width="48" height="197"/></clipPath></defs>
|
||||
<defs><linearGradient id="body" gradientUnits="userSpaceOnUse" x1="0" y1="2" x2="0" y2="197">
|
||||
<stop offset="0" stop-color="#0a2649"/>
|
||||
<stop offset="1" stop-color="#050d1c"/>
|
||||
</linearGradient></defs>
|
||||
<path d="M9.5,1 H17 V224 H9.5 A8.5,8.5 0 0 1 1,215.5 V9.5 A8.5,8.5 0 0 1 9.5,1 Z" fill="url(#body)" fill-opacity="0.75" fill-rule="evenodd" clip-path="url(#body-area)"/>
|
||||
<path d="M17,1 H9.5 A8.5,8.5 0 0 0 1,9.5 V215.5 A8.5,8.5 0 0 0 9.5,224 H17" fill="none" stroke="#2896ff" stroke-width="2"/>
|
||||
<defs><clipPath id="strip"><rect x="2" y="2" width="32" height="221" rx="7.5"/></clipPath></defs>
|
||||
<g clip-path="url(#strip)">
|
||||
<rect x="0" y="197" width="16" height="26" fill="black" fill-opacity="0.75"/>
|
||||
<rect x="0" y="197" width="16" height="0.75" fill="#2896ff"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 984 B |
@@ -0,0 +1,16 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="256" viewBox="0 0 16 256">
|
||||
<defs><clipPath id="body-area"><rect x="-16" y="0" width="48" height="197"/></clipPath></defs>
|
||||
<defs><linearGradient id="body" gradientUnits="userSpaceOnUse" x1="0" y1="2" x2="0" y2="197">
|
||||
<stop offset="0" stop-color="#0a2649"/>
|
||||
<stop offset="1" stop-color="#050d1c"/>
|
||||
</linearGradient></defs>
|
||||
<g transform="matrix(-1 0 0 1 16 0)">
|
||||
<path d="M9.5,1 H17 V224 H9.5 A8.5,8.5 0 0 1 1,215.5 V9.5 A8.5,8.5 0 0 1 9.5,1 Z" fill="url(#body)" fill-opacity="0.75" fill-rule="evenodd" clip-path="url(#body-area)"/>
|
||||
<path d="M17,1 H9.5 A8.5,8.5 0 0 0 1,9.5 V215.5 A8.5,8.5 0 0 0 9.5,224 H17" fill="none" stroke="#2896ff" stroke-width="2"/>
|
||||
</g>
|
||||
<defs><clipPath id="strip"><rect x="-16" y="2" width="30" height="221" rx="7.5"/></clipPath></defs>
|
||||
<g clip-path="url(#strip)">
|
||||
<rect x="0" y="197" width="16" height="26" fill="black" fill-opacity="0.75"/>
|
||||
<rect x="0" y="197" width="16" height="0.75" fill="#2896ff"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -47,6 +47,11 @@ with ideas from VALORANT's netcode articles, keeping the 30 Hz tick:
|
||||
host's is once that stops, or if they drift apart while it moves;
|
||||
- which named objects exist, so scripted creates and deletes match.
|
||||
|
||||
Script actions naming player0 also reach the players beyond player1.
|
||||
They use the same reverse datum order as the script's `(players)` list,
|
||||
skipping players without units, so a scripted BSP transition does not
|
||||
leave the extra players in the unloaded part of the level.
|
||||
|
||||
Every machine follows the host's structure BSP: a switch is sent at once
|
||||
and reliably, and each client's input says which BSP it has loaded.
|
||||
Until a client has the host's, the host takes none of its players'
|
||||
@@ -84,6 +89,13 @@ with ideas from VALORANT's netcode articles, keeping the 30 Hz tick:
|
||||
actor pool, `halo_port_capacity.h`, holds 1024). Riders a dropship has no
|
||||
seats for are kept, and placed beside its riders once they get out. Only
|
||||
the host runs the AI, so the clients see them as the host's other actors.
|
||||
|
||||
Each player chooses whether to play with friendly fire between players
|
||||
(`network.coop_own_friendly_fire`, FRIENDLY FIRE in the pause menu): two
|
||||
players hurt each other only if both do. A client's input tells the host
|
||||
its choice. A player with no input for over 70 seconds (no button pressed
|
||||
or let go, no stick or trigger held) is hurt by every player, whatever
|
||||
either chose, until their next input.
|
||||
- **Host authoritative.** The host alone decides damage, deaths, spawns,
|
||||
pickups, scores and the game's objects; clients do not decide them but
|
||||
apply what the host sends.
|
||||
@@ -122,13 +134,23 @@ with ideas from VALORANT's netcode articles, keeping the 30 Hz tick:
|
||||
than the player goes of their own (and up, what its tick added but a
|
||||
jump's), so a client that says it goes faster (a copy said to hover and
|
||||
fall, gaining the host's gravity each tick) gains nothing by it. A
|
||||
teleporter, which moves the host's own copy too, starts afresh. On a
|
||||
moving elevator the host takes only where a client's player is across,
|
||||
teleporter, which moves the host's own copy too, starts afresh. Riding an
|
||||
elevator (moving, or at rest with the player on its floor) the host takes
|
||||
only where a client's player is across,
|
||||
not how high: the client's elevator follows the host's (co-op's device
|
||||
sync), so its player's height reaches the host a round trip behind the
|
||||
host's elevator, under its floor going up, where the host's copy would
|
||||
fall through it. Each machine's elevator carries its own copy up and
|
||||
down, and they meet where it stops.
|
||||
down, and they meet where it stops. Floor contact keeps that protection
|
||||
through a stop or reversal; the remembered attachment alone after leaving
|
||||
a stopped platform does not. A client echoing a prediction while still on
|
||||
the same elevator keeps its local floor height, rather than applying the
|
||||
difference between the platforms' phases to its current height, when that
|
||||
difference is within 4 world units (the platform's travel over a round
|
||||
trip); a greater one, jumps, leaving the platform and authoritative
|
||||
teleports correct normally. Rider carry uses the platform's current
|
||||
collision displacement, including phase corrections, rather than its
|
||||
previous tick's displacement (network version 30).
|
||||
- **Shooter's hits.** A client reports what its own players hit; the host
|
||||
checks the report (the player's, a weapon they carry, fired from within
|
||||
its reach, the target where the host had it when the shooter saw it, no
|
||||
@@ -201,7 +223,46 @@ limits, and readies a second weapon picked up while firing; version 29 names
|
||||
a Custom Edition map by its own name (`custom_maps\hugeass`, which every
|
||||
screen shows) and says which version it is by the map version of the game
|
||||
record, its hash's first 32 bits (the header checksum before), which a
|
||||
client finds its file by (below, "Map sharing").
|
||||
client finds its file by (below, "Map sharing"); version 30 carries an
|
||||
elevator's riders by its movement of the same tick, which the Xbox game did
|
||||
a tick late, so that every machine moves them alike; version 31 puts the
|
||||
Xbox game's begin game, graceful exit and pregame keep-alive field lists
|
||||
under their own messages (its table had each on its neighbour's) and makes
|
||||
the keep-alive a long, as it was sent: not a byte on the wire moves but the
|
||||
keep-alive's last two, the sender's stack before and zero now, and the
|
||||
table's record changed with it; and with it, every machine drops a datagram
|
||||
of the netcode stamped more than 15 seconds from its sender's latest, the
|
||||
host takes a client's hits, Discord user and readiness only over its
|
||||
connection, and the host answers each machine's datagrams where they come
|
||||
from, so that a second copy of the game on one computer, on a port of its
|
||||
own, plays too; version 32 sends the host's mouse aim assist policy
|
||||
(distributed message 90, `network_aim_assist.c`), which a client must not
|
||||
ignore, and has a client's input say whether its player plays co-op with
|
||||
friendly fire; version 33 sends with the game's settings whether co-op's
|
||||
players hurt their AI allies (Server Setup's ALLY FRIENDLY FIRE: the host
|
||||
then deals the players' hits of them no damage); version 34 takes clients'
|
||||
hits on, and sends the host's damage to, the map's scenery and devices
|
||||
whose shield is all damage can break (Rat Race's energy shields, a Custom
|
||||
Edition map's tripmines), which version 17 left out as having no body to
|
||||
destroy, and has every machine run those shields' stun and recharge itself;
|
||||
and the host deals what such an object deals itself (its shield or body
|
||||
breaking: a tripmine a client's player threw going off under the host's
|
||||
vehicle), which a client no longer reports and the host took from no one.
|
||||
One made in the game, a tripmine, is at an index of its own on each machine:
|
||||
the host takes a client's hit on its copy as one on the host's nearest where
|
||||
the client had it, and a client the host's damage to one as damage to its own
|
||||
copy nearest the damage. Then version 35 sends with the game's settings the
|
||||
options of OpenCE's gametypes (SWAT, Infection, Gun Game and Hardcore:
|
||||
`port/linux/game/game_modes.c`), which make the gametype's PC options 0x2C
|
||||
bytes where they were 0x1C, and the game settings record 16 bytes longer; and
|
||||
in an Infection game the host sends its round in the game type's state
|
||||
(`struct distributed_infection_state`: each player's role and score, the
|
||||
round's phase and winner) in place of Slayer's, which each client checks whole
|
||||
before taking it. Then version 36 sends the host's shield effects (distributed
|
||||
message 91, `network_shield_effects.c`: the shield glow, its Light Show reach
|
||||
and the overshield effect, Server Setup's SHIELD EFFECTS), which every client
|
||||
draws in place of its player's own, so that a build that would draw its own
|
||||
cannot join.
|
||||
|
||||
`port/linux/network_format.txt` records the wire format of the current
|
||||
version (`tools/network_format.py`): `test_linux_port.py` fails when the
|
||||
@@ -360,6 +421,15 @@ A speed hack of less than a tenth is let be: the host's bounds on how far
|
||||
and how fast a client's player moves and fires hold it to the host's time
|
||||
anyway.
|
||||
|
||||
The host's AIM ASSIST option in Player Options defaults to ALLOWED.
|
||||
BLOCK M+KB overrides optional mouse magnetism on every machine, including
|
||||
the host. Aiming with the controller or touch retains its existing behavior;
|
||||
the player's saved preference and the bullets' autoaim are unchanged.
|
||||
`network_aim_assist.c` sends the policy reliably on client ready and on
|
||||
change. Clients take it only from the host and default to blocked until it
|
||||
arrives. This adds distributed message 90; network version 32 requires
|
||||
matching builds so an older client cannot silently ignore the rule.
|
||||
|
||||
## Joining a game in progress
|
||||
|
||||
A game stays open when it starts (on the Xbox it closed, since every
|
||||
@@ -419,8 +489,14 @@ its name alone beside it, has its name given back as the map lists find it.
|
||||
map, bitmaps.map, sounds.map and loc.map it lacks) instead of leaving, if
|
||||
`network.map_download` lets it. Its players wait to join until the host's settings
|
||||
have named the map, and for a game in progress until it is downloaded; in
|
||||
the lobby they join at once, and the host's start waits for the machine to
|
||||
precache the map, as it waits for any machine.
|
||||
the lobby they join at once. A host that starts while a machine is still
|
||||
downloading starts the others without it: the machine's players are held
|
||||
out of the game, and so is any player it asks for meanwhile (a machine
|
||||
whose download began in the lobby does not know the game has started),
|
||||
and the machine joins the game in progress once the map is there. A
|
||||
client told to start before its download is done (by a host of an earlier
|
||||
build) puts the start off until the map is there, rather than loading a
|
||||
map it does not have yet (the damaged disc error, which stops the game).
|
||||
- **The offer.** A host that shares maps (`network.map_share`) hashes the
|
||||
map, and the resource maps the map needs (its tag index says which: a tag
|
||||
whose entry's word at 0x18 is set is held whole by bitmaps.map for a
|
||||
@@ -538,7 +614,16 @@ its name alone beside it, has its name given back as the map lists find it.
|
||||
and delete theirs to match. A client that has loaded asks for all the
|
||||
host's objects and is told when it has them; from then on it deletes
|
||||
any such object the host has not told it of, and nothing but the
|
||||
host's word deletes the host's.
|
||||
host's word deletes the host's. That word has deleted a CTF flag or
|
||||
an oddball, which the game itself never deletes (two assertions,
|
||||
in `objects.c` and `weapons.c`, stop a build that is not `--release`
|
||||
there). Why the host deleted it is not known; the client follows
|
||||
the host's word whatever the reason: it takes the flag or ball out
|
||||
of its carrier's hands, and the goal its game type shows at it goes
|
||||
with it. The two assertions are not made for anything a client
|
||||
deletes in `distributed_client_delete`: the host's objects on its
|
||||
word, one in the place of an object the host creates, and its own
|
||||
the host has not told it of.
|
||||
- The objects placed when the map loads are placed alike everywhere:
|
||||
the host's word finds a client's already there. Past loading, a
|
||||
client's own objects (projectiles, effects: what only it sees) take
|
||||
@@ -701,7 +786,12 @@ Unity's Netcode for Entities, lightyear, netfox and the Ares source):
|
||||
messages (checked as the host's below); the game's own messages (a player
|
||||
added or removed, the game begun or over, its settings), which the host
|
||||
sends over its connection, are ignored in a datagram
|
||||
(`network_client_message_handler.c`).
|
||||
(`network_client_message_handler.c`). The host takes a client's hits,
|
||||
Discord user and readiness only over its connection too, and every
|
||||
machine drops a datagram of the netcode stamped with a tick more than 15
|
||||
seconds from the latest it had from that machine (one stamped far ahead
|
||||
would have the machine's newer ones taken for stale); a message over the
|
||||
connection is taken whatever its tick (`network_distributed.c`).
|
||||
- **Nothing held back.** The game's connections (the reliable messages:
|
||||
objects made and deleted, the game type's state, hits, pickups) send each
|
||||
write at once (`TCP_NODELAY`, in `xnet.c` for the game's sockets and in
|
||||
@@ -779,12 +869,25 @@ Unity's Netcode for Entities, lightyear, netfox and the Ares source):
|
||||
took to come (the reliable channel's resending holds it up), that is
|
||||
when the shooter saw the target (as far back as the host keeps). A
|
||||
report made more than three seconds ago is refused.
|
||||
- **The latency meter** (`latency_meter.c`, `display.latency_meter`) shows
|
||||
the same round trips, timed in milliseconds by when each machine sent the
|
||||
tick they come back naming (the last 64 ticks' send times kept), with
|
||||
nothing more sent: the host each client's, by the host tick its input
|
||||
names; a client its own, by its tick the host's state of its player (or,
|
||||
driving, its vehicle) says the host has it at. Each is the network both
|
||||
ways plus each machine's wait for its next tick, so a LAN reads 15 to 35
|
||||
ms. A client that has heard nothing from the host for two seconds shows
|
||||
"Connection problem"; the host logs a client silent as long. With the
|
||||
meter on, the scoreboard shows these where the machine has them (the
|
||||
host every client's, a client its own players'), and the host's measure
|
||||
in ticks, which every machine is sent, for the others.
|
||||
|
||||
## Testing
|
||||
|
||||
`debug.network_test` (`port/linux/game/network_test.c`) hosts or joins a
|
||||
game without the menus (in a team game the joining player takes the other
|
||||
team), and `debug.test_input` plays controller 1 with a scripted bot (or,
|
||||
team; `local:<map>` plays a local split screen game instead, which the
|
||||
bots of `bots.count` join), and `debug.test_input` plays controller 1 with a scripted bot (or,
|
||||
`look:<seed>`, one that stands still, only turning and looking up and
|
||||
down); each machine logs every player's position, health and shields,
|
||||
where they aim and face, their animation state and how hard they move,
|
||||
@@ -825,7 +928,130 @@ started first), to test that nothing another machine sends can crash the
|
||||
game: a host and a client with a third of their datagrams damaged must play
|
||||
on, their logs noting what they refused.
|
||||
|
||||
With `log`, `debug.network_test` hosts and joins nothing: it logs the game
|
||||
one machine plays (a `map_name` in `init.txt` plays one without the menus),
|
||||
as above. `debug.network_test_cues` has the host, or that machine, run
|
||||
console lines at their ticks, from the first tick every player is in.
|
||||
|
||||
The host logs to `debug.txt` when a player on another machine presses the
|
||||
action button where the host has nothing for them to pick up, with where it
|
||||
has them and the nearest item: a client that sees a pickup the host does
|
||||
not.
|
||||
|
||||
### Comparing two builds
|
||||
|
||||
`tools/net_compare.py` checks that two builds play a network game in step:
|
||||
a build with a change to the simulation, the compiler or the maths against
|
||||
one without. It plays them together on the loopback, build A
|
||||
hosting and B joining (and, with `--swap`, the other way round), on each
|
||||
map given, each copy's player a seeded bot (`debug.test_input`
|
||||
`bot:<seed>`, `--events` adds `debug.network_test_shoot` and
|
||||
`debug.network_test_kill`), headless (`debug.null_renderer`, with no
|
||||
display; or with `--window` a hidden window, on the display the tool was
|
||||
started with, `DISPLAY` or `WAYLAND_DISPLAY`, or `--display`'s: a virtual
|
||||
one, Xvfb, rather than a desktop), and compares the two machines' logs:
|
||||
|
||||
```sh
|
||||
python tools/net_compare.py --a build/linux/halo --b <other checkout>/build/linux/halo \
|
||||
--data <folder holding maps/> --maps bloodgulch,beavercreek,hangemhigh --swap
|
||||
```
|
||||
|
||||
It needs the retail maps, so it runs on a developer's machine or a
|
||||
self-hosted runner, not in the public CI; run it before merging a change to
|
||||
a build's compiler, maths or the simulation itself. A build
|
||||
is its executable: a build's (`build/linux/halo`) or a release's. Each copy
|
||||
gets its own folder (an executable, `config.toml` written in the copy's
|
||||
folder, a data root linking the maps, and saves) in `build/net_compare/`,
|
||||
removed when every game passes. It prints PASS, FAIL (with the first
|
||||
divergent player, tick and field) or ERROR (a copy that did not start, join or log) for each game and
|
||||
a line of figures; a copy's log and the end of its `debug.txt` are kept for
|
||||
each game. It exits 0 when every game passes, 1 when any fails, even if
|
||||
another was an error (a divergence is the finding; an error only a gap in
|
||||
it), else 2 when any was an error. Each copy runs in a process group of its
|
||||
own, which the tool ends however it ends: stopped with Ctrl-C, SIGTERM or
|
||||
SIGHUP, it stops the copies and exits 128 plus the signal's number, and
|
||||
killed outright, the kernel ends the copies (`PR_SET_PDEATHSIG`). `--compare <host log>
|
||||
<client log>` judges two logs already written, and
|
||||
`--a-wrapper`/`--b-wrapper` run a build under another program (a tracer, a
|
||||
debugger). Both builds
|
||||
must log the drift (below): one built before it is an error.
|
||||
|
||||
The host decides and a client predicts its own player, so the comparison
|
||||
is not lockstep's bit for bit, but of what the netcode allows:
|
||||
|
||||
- **Each second's state.** For every player, what the host logged and what
|
||||
the client logged at the same tick (the machines' clocks agree: the
|
||||
ticks match). Positions within 1 world unit: a remote player's word
|
||||
comes a tick or so late, a client's prediction reaches the host as late,
|
||||
and a player runs about 0.08 world units a tick, so identical builds are
|
||||
0.04 apart on average and 0.24 at most, and a client puts its copy of a
|
||||
remote player where the host has it past `REMOTE_BLEND_DISTANCE` (1
|
||||
world unit); out for 2 seconds in a row fails. Aim within 15 degrees,
|
||||
body and shield within 0.15, and alive or dead, riding, grenades,
|
||||
weapons, score, kills, deaths and team the same: out for 3 seconds in a
|
||||
row fails, as the host's word on damage, a death, a pickup or a score is
|
||||
a round trip, or a death blow's wait, late, and a player thrown by a
|
||||
blast aims as no input says for a second or two. Rounds within 3: out
|
||||
for 6 seconds fails, as a client keeps its own player's ammunition
|
||||
while it fires and takes the host's (a pickup's) only once it stops
|
||||
(`network_objects.c`).
|
||||
- **Drift.** Those agree between builds that simulate differently too,
|
||||
as the netcode corrects every copy toward the host's. What does not is
|
||||
how the host moves a client's player: each tick the host moves it on
|
||||
from where it took the client's last prediction, with the client's
|
||||
input, and then hears the client's prediction of the same tick. Where
|
||||
the host took the last a tick ago, it was of the client's tick before,
|
||||
and the host has the input of the client's tick, both machines moved
|
||||
the player one tick with the same input from much the same place, and
|
||||
`distributed_take_prediction` (network_distributed.c) notes how far
|
||||
apart the two moves were, and whether further than
|
||||
`DIVERGENCE_APART_DISTANCE` (0.0001 world units, far above the last
|
||||
bits' rounding). (The moves, not where they end: the host puts its copy
|
||||
only halfway to a prediction a little off, so where it ends would be as
|
||||
far off for ticks after anything that set them apart.) Identical builds
|
||||
move it alike to the last bit but where the player touched something
|
||||
the two machines have in slightly different places (the other player,
|
||||
a grenade's blast, an item knocked about). A build that moves a player
|
||||
otherwise is apart in most of the ticks the player moves. More than 60%
|
||||
of the ticks apart fails.
|
||||
|
||||
The per-second line each machine logs (`network_test_log_players`) is:
|
||||
|
||||
```
|
||||
network test: tick <tick> player <index>: (<x> <y> <z>) h<body>/<shield>[ riding][ camo] g<grenades>/<grenades> w
|
||||
a<aim yaw>/<aim pitch> f<facing yaw> l<look yaw>/<look pitch> as<aiming screen>/<looking screen> st<animation state>
|
||||
thr<throttle>[ <weapon tag>:<rounds>...] s<score> k<kills> d<deaths> f<team kills> t<team> m<machine>
|
||||
[player <index>: dead s<score> k<kills> d<deaths> f<team kills> t<team> m<machine>] ...
|
||||
| items <on the ground> (+<created> -<deleted> !<failed> x<removed>) | <playing|game over> to <score to win>
|
||||
| sent <n> received <n> corrected <n> | hits <n> dealt <n> rejected <n> replayed <n>
|
||||
| local <player> camera (<x> <y> <z>) respawn <ticks> | drift <ticks> <apart> <mean> <largest>
|
||||
```
|
||||
|
||||
(on one line; a riding player's position is the vehicle's, angles are in
|
||||
degrees, a weapon's tag is its tag index's low 16 bits in hexadecimal, and
|
||||
its rounds are those loaded and in reserve). `drift` is the host's: how
|
||||
many ticks of the second it compared a client's move of its player with
|
||||
its own (above), how many of them were apart, and the mean and largest
|
||||
distance apart (world units); a client's is 0. net_compare.py reads every
|
||||
field but the items, the hits and the camera, and compares the last game a
|
||||
log has.
|
||||
|
||||
Calibration (on one 24-thread computer, with up to four games played at
|
||||
once, 60 seconds each, both ways round, on bloodgulch, beavercreek,
|
||||
hangemhigh, chillout, prisoner, ratrace, longest and carousel):
|
||||
|
||||
| Builds | Games | Result | Ticks apart |
|
||||
| --- | --- | --- | --- |
|
||||
| The Linux build against itself | 64 | 63 pass (one copy crashed, an error) | 0-13%, up to 42% with the frames uneven |
|
||||
| The Linux build against itself, `--events` | 12 | 12 pass | 7-36% |
|
||||
| B's players 0.5% faster | 10 | 10 fail, at the first second compared | 77-88% |
|
||||
| B's players 2% faster | 6 | 6 fail, at the first second compared | 88-93% |
|
||||
| B's gravity 0.5% or 2% stronger | 14 | 14 pass | 25-38% |
|
||||
|
||||
(B a build of the same sources with `movement_desired` or `global_gravity`
|
||||
scaled in `biped_update_physics`, a change made for the test.) A change to
|
||||
how players move on the ground is caught in the first second; one that
|
||||
changes only the ticks in the air, as gravity does, is within what
|
||||
identical builds show, and not caught. Positions agree to 0.04 world units
|
||||
on average, 0.24 at most, in every game, perturbed or not: the netcode
|
||||
corrects them.
|
||||
@@ -35,9 +35,11 @@ To start the game:
|
||||
- The 32-bit OpenGL libraries (`lib32-mesa`).
|
||||
- The 32-bit PipeWire or PulseAudio client libraries (`lib32-pipewire` or
|
||||
`lib32-libpulse`).
|
||||
- The 32-bit X11 libraries (`lib32-libx11`, `lib32-libxext`). In a Wayland
|
||||
session, the game uses them through XWayland. SDL uses Wayland itself
|
||||
only if the 32-bit Wayland libraries are version 1.20 or later
|
||||
- The 32-bit X11 libraries (`lib32-libx11`, `lib32-libxext`, and
|
||||
`lib32-libxi`, with which SDL holds the mouse; without it the game hides
|
||||
the pointer and moves it back to the middle of the window instead). In a
|
||||
Wayland session, the game uses them through XWayland. SDL uses Wayland
|
||||
itself only if the 32-bit Wayland libraries are version 1.20 or later
|
||||
(`lib32-wayland`, `lib32-libxkbcommon`; Debian 11, Ubuntu 20.04 and
|
||||
Fedora 32 have older ones) and the compositor has the fifo-v1 protocol.
|
||||
On GNOME, the window then has borders only with the 32-bit libdecor
|
||||
@@ -76,7 +78,10 @@ against it.
|
||||
To make the portable build you need, in addition to the tools above,
|
||||
CMake, `pkg-config` (`pkgconf`) and `wayland-scanner` (`wayland` on Arch
|
||||
Linux, `libwayland-bin` on Debian and Ubuntu). You do not need the 32-bit
|
||||
SDL3. You need the 32-bit glibc only for the tests.
|
||||
SDL3. You need the 32-bit glibc only for the tests. Keep the checkout in a
|
||||
folder whose path has no spaces: SDL's build takes the system root's
|
||||
include folders from `pkg-config`, which splits a path at its spaces, so the
|
||||
portable build stops with a message there.
|
||||
|
||||
To see the glibc version that a build needs, enter
|
||||
`readelf -V build/linux/halo | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1`.
|
||||
@@ -107,11 +112,23 @@ sequence:
|
||||
contains the executable.
|
||||
|
||||
If the game finds no data, it asks for an Xbox disc image (`.xiso` or
|
||||
`.iso`). This occurs at the first start:
|
||||
`.iso`). This occurs at the first start. First the game looks for a disc
|
||||
image in the folder of the executable (a name that ends in `.iso` or
|
||||
`.xiso`, in capitals or not). If it finds one, it names that image in its
|
||||
question:
|
||||
|
||||
- Select "No" to stop the game.
|
||||
- Select "Yes" to open a file picker. Select the disc image. The game copies
|
||||
`maps/` next to the executable and shows the progress.
|
||||
- Select "Yes" to copy `maps/` from the disc image. If the game found an
|
||||
image next to the executable, it uses that image and shows no file picker.
|
||||
Otherwise it opens a file picker: select the disc image, or cancel to see
|
||||
the question again. The game copies `maps/` next to the executable and
|
||||
shows the progress. If the copy from the image found next to the
|
||||
executable fails, the next "Yes" opens the file picker.
|
||||
|
||||
On Linux, the file picker needs the desktop portal or `zenity`. If neither
|
||||
is present, the game says to put the disc image next to the executable (or
|
||||
to install `zenity`) and stops. Put the image there and start the game
|
||||
again.
|
||||
|
||||
The game writes the copy to `maps.partial`. When the copy is complete, the
|
||||
game changes the name to `maps`. If the copy stops before it is complete,
|
||||
@@ -149,6 +166,21 @@ Do the set-up in Desktop Mode: unpack the release, put `maps/` next to
|
||||
wait: the host drops a machine that it has not heard from for 15 seconds,
|
||||
and while a Deck that hosts sleeps, the other players have no host.
|
||||
|
||||
### NVIDIA on Wayland
|
||||
|
||||
The game is a 32-bit program. NVIDIA's driver draws OpenGL into a Wayland
|
||||
window through its `egl-wayland` library, which most distributions only
|
||||
ship 64-bit (Arch and its derivatives have no 32-bit package of it). A
|
||||
32-bit OpenGL window on Wayland then falls back to Mesa's `llvmpipe`, which
|
||||
draws on the processor: the log shows `OpenGL ... on llvmpipe`, and the
|
||||
game is slow or never finishes loading.
|
||||
|
||||
So on a Wayland desktop with NVIDIA's driver loaded, the game opens its
|
||||
window through XWayland (X11), where the 32-bit driver draws, unless a
|
||||
32-bit `egl-wayland` is installed. The log says so ("video: NVIDIA's
|
||||
driver ..."). `SDL_VIDEO_DRIVER=wayland` or `SDL_VIDEO_DRIVER=x11` chooses
|
||||
the video driver yourself.
|
||||
|
||||
## Files and folders
|
||||
|
||||
| Xbox drive | Folder |
|
||||
@@ -191,7 +223,9 @@ computer (co-op, or split screen in a network game) and only one gamepad,
|
||||
that gamepad is controller 2 (player 2) and the keyboard and mouse stay
|
||||
controller 1. The gamepad changes controller only when none of its buttons
|
||||
is held. The profile's button layout (Settings > Gamepads) is the
|
||||
gamepads' only.
|
||||
gamepads' only. Besides the Xbox's five, it has the Master Chief
|
||||
Collection's Bumper Jumper: jump on the left bumper, melee on the right,
|
||||
switching grenades on A, action and reload on B and the flashlight on X.
|
||||
|
||||
| Action | Keys and buttons (default) |
|
||||
| --- | --- |
|
||||
@@ -229,7 +263,9 @@ second get a numeric suffix so previous screenshots are preserved.
|
||||
One movement of the mouse wheel changes the weapon one time. A second
|
||||
movement after a short pause changes it again.
|
||||
|
||||
In the menus, the mouse moves a pointer:
|
||||
In the menus, the mouse moves a pointer, a blue arrow
|
||||
(`port/assets/cursor/menu_cursor.png`) in place of the system's, sized to
|
||||
the window as Halo PC's was (32 of the menus' 480 lines tall):
|
||||
|
||||
- The item below the pointer gets the focus.
|
||||
- A left click selects the item. On a setting with values, a click on the
|
||||
@@ -266,6 +302,13 @@ change. The screens open, close and move between each other as the PC
|
||||
version's. `display.menus = "xbox"` gives the Xbox's menus, which start every
|
||||
kind of game.
|
||||
|
||||
The menus' text is in the language of the Custom Edition whose `loc.map` is
|
||||
in `custom_maps` (French, German, Italian, Spanish and so on), as that
|
||||
edition shows it: each of the PC version's texts is that `loc.map`'s
|
||||
(`display.menu_language`). Without one, and for the lines the port adds,
|
||||
it is English. The pictures with words in them (the screens' titles, the
|
||||
main menu's items) are drawn in English.
|
||||
|
||||
Multiplayer > CO-OP CAMPAIGN is the Xbox's cooperative play, which the PC
|
||||
version does not have: two players on this computer play the campaign in
|
||||
split screen. Player 1 is the player who chose it, on the current profile.
|
||||
@@ -280,7 +323,9 @@ player's profile is chosen on the ADD PLAYER screen that opens (with any
|
||||
controller). With one gamepad, choose the lobby's ADD PLAYER button first:
|
||||
until then that gamepad shares controller 1 with the keyboard. Two players on one profile get different names from the host. A
|
||||
player's B in the lobby leaves the game alone, and the last player of the
|
||||
computer leaves it for all of them. In the game, each player's pause menu
|
||||
computer leaves it for all of them. When all the players are on the host's
|
||||
computer, START NOW starts the game without another computer, and a team
|
||||
game does not need a player on each team. In the game, each player's pause menu
|
||||
opens on their part of the screen, and its LEAVE GAME is theirs: their part
|
||||
of the screen stays until the game ends. A game under way shows its own
|
||||
screen before JOIN GAME: players join there the same way, START or ADD
|
||||
@@ -307,6 +352,11 @@ while the game stays paused, with only Controls, Gamepads, Mouse, Audio and
|
||||
Video Setup; Gamepads' OK saves the profile at once. In co-op the settings
|
||||
have Network Setup too, with its in-game pages as in a multiplayer game.
|
||||
|
||||
In an online co-op game, the pause menu also has FRIENDLY FIRE ON or
|
||||
FRIENDLY FIRE OFF, after SETTINGS, in a box drawn taller for it: whether this
|
||||
computer's players hurt, and are hurt by, the other players
|
||||
(`network.coop_own_friendly_fire`). A or enter changes it, from that moment.
|
||||
|
||||
The menus are XML files in `port/assets/menus` (`tools/ce_menus.py` writes
|
||||
them from the PC version's tags), which the game contains. To change them,
|
||||
put files in a `menus` folder next to `config.toml`: a file with the same
|
||||
@@ -315,6 +365,51 @@ path replaces one of the game's, and another `.xml` file is added.
|
||||
the game uses the Xbox's menus and the log names the file, the line and the
|
||||
problem.
|
||||
|
||||
## Bots
|
||||
|
||||
Computer players (bots) can play a local multiplayer game with you:
|
||||
`bots.count` (1 to 15) of them join the lobby of a Slayer game played on
|
||||
this computer, which is Multiplayer > Split Screen in the Xbox's menus
|
||||
(`display.menus = "xbox"`; the PC version's menus have no game of this
|
||||
computer alone). They are players as you are: in the scores, the respawns
|
||||
and the game's rules, on the teams that `bots.teams` asks for, and they
|
||||
follow the teams' changes in the lobby. They look for enemies, aim, fire,
|
||||
throw grenades and pick up better weapons, as well as `bots.skill` lets
|
||||
them, and walk the paths that the campaign's AI finds on the maps' walkable
|
||||
surfaces (`game/bots.c`). They are never in system link or internet games,
|
||||
nor in other gametypes (but SWAT, Infection and Gun Game, which are
|
||||
Slayer's: below), and nothing that the machines send each other changes.
|
||||
|
||||
## OpenCE gametypes
|
||||
|
||||
Create Game's Select Gametype screen has a bank between STANDARD and
|
||||
CUSTOM: OPENCE, the port's own gametypes (`game/game_modes.c`).
|
||||
|
||||
| Gametype | Rules |
|
||||
| --- | --- |
|
||||
| SWAT | Team Slayer with no shields, in which a shot to the head of any weapon kills (a bullet's, a plasma bolt's, a needle's or a shotgun pellet's, not a melee's or an explosion's). Everyone starts with a pistol and an assault rifle; no weapons are on the map, no one has grenades, and there is no motion sensor. |
|
||||
| Infection | Team Slayer. Humans are red and keep the map's weapons; zombies are blue, carry the Oddball skull and nothing else, move faster, hit harder with the skull, and cannot drive, pick up grenades or powerups. Once two players are alive the round counts down, then the host chooses the first zombies (a human is always left). A human killed by a zombie, by themselves or by a fall becomes a zombie, one killed by a teammate does not; a zombie respawns a zombie, and a player who joins late is one. The zombies win when no human is left, the humans when the round's time runs out (5 minutes). Each player scores a kill of the other side. The rules follow pull request #420's (`game/infection.c`). |
|
||||
| Gun Game | Free for all Slayer. Everyone starts with the first weapon of a list (the rocket launcher, the shotgun, the sniper rifle, the plasma rifle, the assault rifle, the needler, the plasma pistol, the pistol, of those the map has); each kill gives the killer the next, and a kill with the last wins. No one picks up a weapon, a weapon emptied is refilled, and a melee kill takes the victim back a weapon (`game/gun_game.c`). |
|
||||
| Hardcore Slayer, Hardcore CTF, Hardcore Oddball, Hardcore King | The team gametypes with Hardcore's rules: no motion sensor (the flag, the ball and the hill keep their nav points), no aim assist (no autoaim nor magnetism, for controllers and the mouse alike), friendly fire on, and a kill restores the killer's health, and their shields unless an overshield has them past full. |
|
||||
|
||||
Edit Gametypes edits them as any gametype, and its OPENCE OPTIONS screen
|
||||
(after TEAMPLAY OPTIONS) gives any gametype these rules: its MODE (NONE,
|
||||
SWAT, INFECTION or GUN GAME: Slayer only; Infection is played on teams and
|
||||
Gun Game free for all, which the screen's OK sets), HARDCORE (any game
|
||||
type), and the mode's own options: Infection's first zombies, zombie speed,
|
||||
skull damage, zombie respawn time, countdown and zombie shields, and Gun
|
||||
Game's weapon order (strongest first, weakest first, or random, drawn by
|
||||
the host for each game) and whether a melee kill demotes. A saved gametype
|
||||
keeps them with its PC options (`saved games/playlist_profile.c`, version 2
|
||||
of their block; a gametype saved before them has none), and the network
|
||||
game carries them to every machine (network version 35, `NETCODE.md`).
|
||||
Only the host decides each mode's events (Infection's zombies, Gun Game's
|
||||
weapons, Hardcore's restores); the clients take them from it as they take
|
||||
the rest of the game. The lobby and Server Setup name the gametype's mode.
|
||||
`debug.network_test` hosts them by name: `swat`, `infection`, `gun_game`,
|
||||
`hardcore`, `hardcore_ctf`, `hardcore_oddball` and `hardcore_king`
|
||||
(`host:bloodgulch:infection`).
|
||||
|
||||
## Settings
|
||||
|
||||
The settings are in `config.toml` next to the executable
|
||||
@@ -324,7 +419,9 @@ values again, delete the file.
|
||||
|
||||
The game reads the file at start-up. If a key is not correct, or a value
|
||||
has the wrong type, the game writes the line to the log and uses the default
|
||||
value. The Settings menu (Video, Mouse, Audio, Network and Controls Setup)
|
||||
value. A key in the wrong section is named with the section it goes under. A
|
||||
file that cannot be parsed leaves every setting at its default; a word value
|
||||
needs its quotes (`menus = "pc"`, not `menus = pc`). The Settings menu (Video, Mouse, Audio, Network and Controls Setup)
|
||||
changes the useful settings, writes them into the file (only their lines
|
||||
change) and applies them at once, but `audio.enabled`, and `display.menus`
|
||||
from the next main menu.
|
||||
@@ -349,6 +446,7 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `display.fov` | `0.0` | `HALO_FOV` | The first-person view's field of view on foot, in degrees across at 16:9, from 20 to 150. `0`: the stock view. Refer to "Field of view". |
|
||||
| `display.viewmodel_fov` | `0.0` | `HALO_VIEWMODEL_FOV` | The first-person weapon's and hands' field of view, in degrees across at 16:9, from 20 to 150. `0`: the weapon's stock view, also when `display.fov` widens the world. Refer to "Field of view". |
|
||||
| `display.viewmodel_visible` | `true` | `HALO_VIEWMODEL_VISIBLE` | `true`: the first-person weapon, hands and what is attached to them are drawn. `false`: they are not; firing, animation, sound and lights go on, and other players' models are drawn. |
|
||||
| `display.passenger_third_person` | `false` | `HALO_PASSENGER_THIRD_PERSON` | Third-person view for the Warthog's passenger and the Scorpion's four passengers. Uses the gunner's camera on the Warthog and the driver's on the Scorpion, within the passenger's firing arc. Smooth entry and exit; weapon zoom is disabled while riding. The reticle follows the shot's centre ray. Local view only. In the campaign and co-op only: not in multiplayer, where seeing around the vehicle would be an advantage. |
|
||||
| `display.viewmodel_shield` | `false` | `HALO_VIEWMODEL_SHIELD` | `true`: the energy shield's flare (its hits, its charging, its fall) is drawn on the first-person arms too, as on the body, with the unit's own shield shader, kept closer to the arms than to the body. The stock game draws it on the body only. |
|
||||
| `display.first_person_legs` | `false` | `HALO_FIRST_PERSON_LEGS` | `true`: your own body is drawn from the waist down in first person, so you see your legs when you look down, moving as the body's animation moves them. Refer to "Field of view". |
|
||||
| `display.shield_color` | `default` | `HALO_SHIELD_COLOR` | Your energy shield's flare as this machine draws it: `default` (the shield's own) or a multiplayer armor color (`white`, `black`, `red`, `blue`, `gray`, `yellow`, `green`, `pink`, `purple`, `cyan`, `cobalt`, `orange`, `teal`, `sage`, `brown`, `tan`, `maroon`, `salmon`), whatever the armor's, on the body and, with `display.viewmodel_shield`, on the first-person arms. The shield's own shader is drawn with its two colors replaced at their brightness; the flare is added to what is behind it, so `black` is drawn a faint grey. Only this machine sees it. |
|
||||
@@ -356,20 +454,33 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `display.high_res_text` | `true` | `HALO_HIGH_RES_TEXT` | `true`: the menus' and HUD's text is drawn with the fonts in `port/assets/fonts` (Overpass, in place of the maps' Interstate) at the resolution the game draws at, laid out as before; the menus' titles are drawn from the high-res pictures in `port/assets/titles`, and the controller button icons from those in `port/assets/buttons`. `false`: the maps' bitmap fonts, titles and button icons. |
|
||||
| `display.shadow_resolution` | `128` | `HALO_SHADOW_RESOLUTION` | The size of the maps that the shadows of the objects are drawn in, in pixels each way: `128`, `256`, `512` or `1024` (other values go down to one of these). The game draws the shadow of each object into a map of 128x128 pixels, blurs it and projects it onto the ground. On a large screen, the edges of these shadows show steps that move when the object moves. A larger map makes the edges smooth; the blur is made wider to match, so the shadows are as soft as on the Xbox. Each doubling adds two passes of the blur. `128`: as on the Xbox. |
|
||||
| `display.menus` | `"pc"` | `HALO_MENUS` | `"pc"`: the PC version's menus, from the files in `port/assets/menus` and a `menus` folder next to `config.toml`. Refer to "Menus". `"xbox"`: the Xbox's menus. |
|
||||
| `display.menu_language` | `"maps"` | `HALO_MENU_LANGUAGE` | The PC menus' language. `"maps"`: the language of the Custom Edition whose `loc.map` is in `custom_maps` (English without one). `"english"`: English. The port's own lines are English. |
|
||||
| `display.player_names` | `"all"` | `HALO_PLAYER_NAMES` | In multiplayer, whose names are drawn above their heads: `"all"`, `"allies"`, `"enemies"` or `"none"`. An ally's name is drawn above the triangle the game shows over teammates. An enemy's name shows only within the motion sensor's reach, while the enemy is in sight and not camouflaged, so it never shows where an enemy hides. The gametype's motion tracker setting also applies: no names if it shows no players, only allies' if it shows only friends. |
|
||||
| `display.player_name_scale` | `1.0` | `HALO_PLAYER_NAME_SCALE` | How large the players' names are drawn: `1.0` is three quarters of the size of the HUD's text, from `0.25` to `4`. With high-res text, larger names are rasterized at their size, so they stay sharp. |
|
||||
| `display.match_timer` | `false` | `HALO_MATCH_TIMER` | `true`: a multiplayer game draws its clock at the bottom right, counting up from the game's first tick, which the items' respawn periods count from too: a weapon is back on the map at every multiple of its period on the clock. Campaign and co-op have none. MATCH TIMER in Video Setup > Graphics. |
|
||||
| `display.text_chat` | `true` | `HALO_TEXT_CHAT` | Show the text chat of network games (Settings > Network Setup > Multiplayer HUD > TEXT CHAT). `false` hides its lines, and its keys and a controller's D-pad Up open nothing. Refer to "Text chat". |
|
||||
| `display.chat_style` | `"colors"` | `HALO_CHAT_STYLE` | The text chat's colours (Settings > Network Setup > Multiplayer HUD > CHAT TEXT): `"colors"`, the player's name in their team's colour and the text a pale blue; `"white"`, all of it white, as Custom Edition. |
|
||||
| `display.scoreboard_team_layout` | `"teams"` | `HALO_SCOREBOARD_TEAM_LAYOUT` | How the multiplayer scoreboard (hold BACK, or tab) lists a team game's players. `"teams"`: a column for each team, red on the left and blue on the right. `"score"`: all the players in order of score. With more players than fit, the mouse wheel and Page Up / Page Down scroll the scoreboard. |
|
||||
| `display.scoreboard_background` | `true` | `HALO_SCOREBOARD_BACKGROUND` | `true`: the multiplayer scoreboard (hold BACK, or tab) has a panel behind its text, for clearer text. |
|
||||
| `display.scoreboard_background_color` | `"16, 16, 16, 150"` | `HALO_SCOREBOARD_BACKGROUND_COLOR` | The colour of the scoreboard's panel: `"red, green, blue, alpha"`, each from `0` to `255`. Alpha `0` is see-through, `255` is solid. |
|
||||
| `display.anisotropic_filtering` | `0` | `HALO_ANISOTROPIC_FILTERING` | Textures seen at a grazing angle (floors, walls, terrain) are sampled along the angle from finer mip levels, so they stay sharp; the Xbox game asks for none. `0` or `1`: as on the Xbox. `2`, `4`, `8` or `16`: at most that many samples (at most the GPU's); `4` keeps most of `16`'s sharpness at less cost on slower GPUs. TEXTURE FILTERING in Video Setup > Graphics. It applies to the textures of the map that have mip levels and are filtered linearly (base, detail, bump and environment maps; lightmaps have no mip levels), not to what the game renders, such as the water's ripples. On Android and the web, only where the GPU has `GL_EXT_texture_filter_anisotropic`. |
|
||||
| `display.latency_meter` | `false` | `HALO_LATENCY_METER` | `true`: in a network game, your round trip to the host in milliseconds at the top right of the screen, "Ping 45 ms" with four bars: green below 80 ms, yellow below 150, red from 150. The host shows "Max ping", its slowest player's. A player's machine that has heard nothing from the host for two seconds shows "Connection problem". The round trip includes each machine's wait for its next tick, so a LAN reads 15 to 35 ms. Not shown in the menus, after the game, in a co-op cutscene or when the host plays alone. The scoreboard's pings take the same colours, and show the round trips this machine times itself (the host: each player's; a player: their own), so they agree with the meter. Nothing more is sent. Only in config.toml, not in the menus. |
|
||||
| `display.per_pixel_lighting` | `false` | `HALO_PER_PIXEL_LIGHTING` | `false`: the models (characters, weapons, vehicles, scenery) are lit at each vertex and the light is blended between them, as on the Xbox. The light across a curved surface then shows facets, and a point light that passes close lights only the vertices it reaches. `true`: the models are lit at each pixel by the same lights (the ambient light, two distant lights and two point lights), which changes their look. |
|
||||
| `display.shield_glow` | `false` | `HALO_SHIELD_GLOW` | `true`: as a unit's energy shield flares (hit, charging, falling), it lights what is around it and itself, as a plasma bolt does, in the shield shader's own color (a Spartan's gold, an Elite's blue), rising and falling with the flare seen on the body. An ordinary dynamic light of the game's, drawn with a light definition the map has (`shield_glow.c`). Up to 8 units near the camera. |
|
||||
| `display.shield_glow_intensity` | `default` | `HALO_SHIELD_GLOW_INTENSITY` | The shield glow's reach and brightness: `default`, or `light_show` (three times as far, and at full strength from a third of the flare: a light is no brighter than full). The units glowing are those near any local player's camera, so each of a split screen's views has the same. |
|
||||
| `display.structure_culling` | `31` | `HALO_STRUCTURE_CULLING` | Which tests skip the triangles of the level (its walls, floors and terrain) that the camera cannot see before they are drawn, as bits added together: `1`, triangles outside the view; `2`, groups of triangles that all face away from the camera; `4`, single triangles that face away; `8`, smaller groups, so that more of them are skipped whole; `16`, the rooms nearest the camera first. Each test is conservative: the picture is the same, with fewer triangles drawn. `0`: the original walk, which draws every triangle of each visible room. The console's `structure_culling <bits>` changes it until the game quits, and `debug_structure_culling true` shows what was skipped (red: outside the view, blue: facing away). |
|
||||
| `display.shield_glow` | `false` | `HALO_SHIELD_GLOW` | `true`: as a unit's energy shield flares (hit, charging, falling), it lights what is around it and itself, as a plasma bolt does, in the shield shader's own color (a Spartan's gold, an Elite's blue), rising and falling with the flare seen on the body. An ordinary dynamic light of the game's, drawn with a light definition the map has (`shield_glow.c`). Up to 8 units near the camera. Video Setup's Extra Effects screen sets it. Offline only: in a network game, the host's `network.shield_effects` decides. |
|
||||
| `display.shield_glow_intensity` | `default` | `HALO_SHIELD_GLOW_INTENSITY` | The shield glow's reach and brightness: `default`, or `light_show` (three times as far, and at full strength from a third of the flare: a light is no brighter than full). The units glowing are those near any local player's camera, so each of a split screen's views has the same. Video Setup's Extra Effects screen sets it. Offline only: in a network game, the host's `network.shield_effects` decides. |
|
||||
| `display.overshield_effect` | `false` | `HALO_OVERSHIELD_EFFECT` | `true`: the overshield's flare rises up the body from the feet as it charges, with a soft edge (2 seconds, the charge's time from a full shield; 3 from a shield that was down; 2 from any other), then stays lit, whole, for as long as the overshield lasts, its energy moving at 30% of its speed, in its own color (the powerup's, 253, 78, 116), whatever shield color its player chose; the shield's own flares are not drawn over it, and its glow (`display.shield_glow`) rises and stays with it. With `display.viewmodel_shield` it comes up on the first-person arms as the rise reaches them. A hit on it plays what the projectile plays on an Elite's shield (its sound, sparks and light), when the map has that effect and it only shows and sounds. `false`: the overshield as the stock game draws it. Only this machine's drawing and sounds change (`overshield_effect.c`; the rise is a fade in the vertex shader, `d3d8_gl_set_height_fade`). Video Setup's Extra Effects screen sets it. Offline only: in a network game, the host's `network.shield_effects` decides. |
|
||||
| `display.model_detail` | `"stock"` | `HALO_MODEL_DETAIL` | Which level of detail (of up to five) each model is drawn at. The game measures a model by its size in the lines of its 480-line screen, at any resolution, so at 1440 lines a model three times larger than the levels were made for is drawn as the Xbox drew it. `"stock"`: as on the Xbox. `"native"`: measured in the lines of the display (not supersampling's), so more detail is kept at a distance at high resolutions, and small far models that the Xbox left out are drawn. `"highest"`: measured as `"native"` for which models are drawn, and those drawn at their most detailed level. With either, a part that has no geometry at the level chosen draws its most detailed level below that has some, and a level made for a model's inside (one for a size over 1000 pixels, as the top level of a10's cryotubes) is drawn only while the camera is inside the model. Models whose map gives one level (the trees and rocks of b30) do not change. On Android, which draws 480 lines, `"native"` is `"stock"`. |
|
||||
| `display.hdr` | `false` | `HALO_HDR` | `true`: the back buffer that the 3D view is drawn into holds half floats (`GL_RGBA16F`) in place of 8 bits a channel, so that the light the game adds up (blended lights, glows, fog, particles) is kept past white in place of being clipped. Before the HUD and the menus, a tone mapping pass brings it back into the display's range (`display.hdr_tone_mapping`). The HUD and the menus do not change. On Android, only with a GPU that draws into half floats (OpenGL ES 3.2, `GL_EXT_color_buffer_half_float` or `GL_EXT_color_buffer_float`); otherwise off, with a line in the log. A change applies from the next frame. Video Setup's GRAPHICS screen sets it (HDR) and `display.hdr_output` (HDR DISPLAY). Refer to "HDR" in "What operates". |
|
||||
| `display.hdr_exposure` | `1.0` | `HALO_HDR_EXPOSURE` | With `display.hdr`, the light of the 3D view is multiplied by this before the tone mapping, from `0.25` to `4.0`. |
|
||||
| `display.hdr_tone_mapping` | `"neutral"` | `HALO_HDR_TONE_MAPPING` | With `display.hdr`, the curve that brings the light into the display's range. `"neutral"`: the picture is as without HDR up to 80% of white, and the light past it rolls off to white in place of being clipped. `"aces"`: the ACES filmic curve (Narkowicz's fit), with more contrast and darker shadows. `"reinhard"`: the extended Reinhard curve on luminance, softer and darker. |
|
||||
| `display.hdr_output` | `false` | `HALO_HDR_OUTPUT` | Not on Android or in a browser. With `display.hdr`, `true`: the window asks for floating-point pixels (scRGB). On a display that has HDR on (on Windows, "Use HDR"), the tone mapping then goes up to the display's headroom over SDR white, and the light past white is shown brighter than white. Without an HDR display the picture is as with `false`; if the driver has no such window, the game makes an 8-bit one. Read at start. With NVIDIA's driver on Windows, the NVIDIA Control Panel's "Vulkan/OpenGL present method" must be "Prefer layered on DXGI Swapchain": otherwise a fullscreen or borderless window turns black, then oversaturated. Experimental. |
|
||||
| `audio.enabled` | `true` | `HALO_NO_AUDIO=1` sets `false` | `false`: no audio device. The sound continues without output. |
|
||||
| `audio.volume` | `1.0` | `HALO_VOLUME` | The master volume. |
|
||||
| `audio.music_volume` | `1.0` | `HALO_MUSIC_VOLUME` | The music's volume, of the master volume. |
|
||||
| `audio.effects_volume` | `1.0` | `HALO_EFFECTS_VOLUME` | The volume of the other sounds (effects and speech), of the master volume. |
|
||||
| `audio.buffer_frames` | `512` | `HALO_AUDIO_BUFFER_FRAMES` | The audio device's buffer, in sample frames at 48 kHz, from `64` to `8192`. Larger rides out stalls that would cut the sound out; smaller has less delay (512 is 11 ms, 2048 is 43 ms). Not on Android or the web. |
|
||||
| `audio.channels` | `"stereo"` | `HALO_AUDIO_CHANNELS` | `"stereo"`, or `"5.1"` for surround sound as with Dolby Digital on the Xbox. `"auto"`: 5.1 if the sound device has 6 or more channels. Linux and Windows only. |
|
||||
| `audio.reverb` | `true` | `HALO_REVERB` | `true`: the sounds of the world reverberate as the place the player is in does: the sound environments of the maps (a corridor, a cave, a large hall, outdoors) set the reverberation, as the I3DL2 reverb of the Xbox did. A sound behind a wall or a door is muffled in it too. `false`: no reverberation (sounds behind a wall are still muffled). |
|
||||
| `audio.resampler` | `"sinc"` | `HALO_AUDIO_RESAMPLER` | How the sounds are converted to the output's rate (48 kHz): `"sinc"` with a band-limited low pass, which keeps out the images above the sound's own rate; `"linear"` between neighbouring samples, which lets some of them through and sounds brighter for it. Audio Setup's SOUND PROCESSING screen sets it, with `audio.reverb`. |
|
||||
| `audio.voice_chat` | `"push_to_talk"` | `HALO_VOICE_CHAT` | How you talk in voice chat: `"push_to_talk"` (while `controls.push_to_talk` is held; the microphone opens when you first press it), `"open_mic"` (when the microphone hears speech), or `"off"`. You hear the other players in every case. Refer to "Voice chat". |
|
||||
@@ -377,12 +488,18 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `audio.output_device`, `audio.input_device` | `"default"` | `HALO_AUDIO_OUTPUT_DEVICE`, `HALO_AUDIO_INPUT_DEVICE` | The speakers and the microphone, by the name that Settings > Audio shows, or `"default"` for the device of the system. If the device is not found, the game uses the device of the system. Not on Android. |
|
||||
| `input.mouse_sensitivity` | `1.0` | `HALO_MOUSE_SENSITIVITY` | The multiplier for the mouse aim. |
|
||||
| `input.mouse_vertical_sensitivity` | `0.0` | `HALO_MOUSE_VERTICAL_SENSITIVITY` | The multiplier for the vertical mouse aim. `0`: the same as `input.mouse_sensitivity`. |
|
||||
| `input.playstation_kernel_driver` | `false` | `HALO_PLAYSTATION_KERNEL_DRIVER` | Linux: `true` drives a PlayStation controller (DualSense, DualShock 4) through the kernel's driver of it (`hid-playstation` since Linux 5.12, `hid-sony`): its buttons, sticks, triggers and rumble, with no setup, but not its lightbar. `false`: SDL's own driver, which needs access to the controller's `/dev/hidraw` device, as Steam's udev rules give it (`steam-devices`, or Steam installed). Read at start-up. |
|
||||
| `input.invert_mouse` | `false` | `HALO_MOUSE_INVERT=1` sets `true` | `true`: the vertical mouse aim is inverted. |
|
||||
| `input.mouse_aim_assist` | `false` | `HALO_MOUSE_AIM_ASSIST` | `true`: the magnetism of the controller also operates for the mouse. `false`: when the mouse moved after the right stick, the view is not slowed or dragged by a target. The autoaim of the bullets operates in both cases. |
|
||||
| `controls.<action>` | (the table in "Controls") | `HALO_KEY_<ACTION>` | The keys and mouse buttons of an action, up to two, separated by a comma: `move_forward`, `move_backward`, `strafe_left`, `strafe_right`, `jump`, `crouch`, `fire`, `throw_grenade`, `melee`, `reload`, `zoom`, `switch_weapon`, `switch_grenade`, `action`, `flashlight`, `scoreboard`, `pause`, `screenshot`, `push_to_talk`, `chat`, `team_chat`. Keys by their names (`"W"`, `"Space"`, `"Left Ctrl"`, `"F1"`), and `"Mouse Left"`, `"Mouse Right"`, `"Mouse Middle"`, `"Mouse 4"`, `"Mouse 5"`, `"Wheel"` (either way), `"Wheel Up"`, `"Wheel Down"`. |
|
||||
| `controls.<action>` | (the table in "Controls") | `HALO_KEY_<ACTION>` | The keys and mouse buttons of an action, up to two, separated by a comma: `move_forward`, `move_backward`, `strafe_left`, `strafe_right`, `jump`, `crouch`, `fire`, `throw_grenade`, `melee`, `reload`, `zoom`, `switch_weapon`, `switch_grenade`, `action`, `flashlight`, `scoreboard`, `pause`, `screenshot`, `push_to_talk`, `chat`, `team_chat`. Keys by their names on a US keyboard (`"W"`, `"Space"`, `"Left Ctrl"`, `"F1"`): a key is the one in that place on any keyboard, which Controls Setup shows by its own label (the US name on Android). Buttons: `"Mouse Left"`, `"Mouse Right"`, `"Mouse Middle"`, `"Mouse 4"`, `"Mouse 5"`, `"Wheel"` (either way), `"Wheel Up"`, `"Wheel Down"`. |
|
||||
| `game.downloaded_maps` | `""` | `HALO_DOWNLOADED_MAPS` | Maps to play as downloaded maps, besides the maps that map sharing downloaded (it names them in `downloaded_maps.txt` in `custom_maps`): their names (`bloodgulch`, `hugeass`), separated by commas, or `"*"` for all the maps. The scripts of a downloaded map cannot change the settings of the player or the games of other players. `debug.txt` names what the game refused. |
|
||||
| `game.console_log` | `"important"` | `HALO_CONSOLE_LOG` | What the console shows on the screen. `"important"`: bans, players that the host drops for cheating, the reasons that the game refuses a command, and the asserts that stop the game. `"all"`: all the lines. `"none"`: only the asserts that stop the game. The output of a command always shows. `debug.txt` gets all the lines. |
|
||||
| `game.language` | `""` | `HALO_LANGUAGE` | The language of the menus: `ja`, `de`, `fr`, `es` or `it`. Empty: English. |
|
||||
| `game.enhanced_animations` | `true` | `HALO_ENHANCED_ANIMATIONS` | `true`: the player bipeds' grenade throws keep their legs moving, blended by speed and direction (crouched throws stay crouched, throws in the air use the jump's legs), Warthog and Scorpion riders stay seated to throw and let go of the grips to throw and reload, and a player turns with the aim while throwing, as while meleeing. `false`: the original animations, which freeze the legs during a throw and stand a rider up. Only in config.toml, not in the menus. |
|
||||
| `game.unlock_all_levels` | `false` | `HALO_UNLOCK_ALL_LEVELS` | `true`: a profile created afterward starts with all the campaign levels finished on all the difficulties. `false`: a new profile starts at The Pillar of Autumn, and each level opens when you finish the level before it, as on the Xbox. Existing profiles keep their progress. To start a profile over, type `profile_reset_campaign` in the console. |
|
||||
| `bots.count` | `0` | `HALO_BOTS` | Computer players (bots) in a local (split screen) Slayer game: `0` to `15` join its lobby with the players, as far as the game has room. Not in system link or internet games. `0`: none, as in the stock game. Refer to "Bots". |
|
||||
| `bots.skill` | `"normal"` | `HALO_BOT_SKILL` | How well the bots play: `"easy"`, `"normal"`, `"heroic"` or `"legendary"`: how soon they react, how far and how wide they see, how large their aim error is and how fast it settles, how fast they turn. |
|
||||
| `bots.teams` | `"even"` | `HALO_BOT_TEAMS` | In a team game: `"even"` puts the bots on both teams, evening them with the players; `"against"` puts them all on the team the players are not on. |
|
||||
| `paths.data` | `""` | `HALO_DATA_ROOT` | The data root. Refer to "Start the game". |
|
||||
| `paths.saves` | `""` | `HALO_SAVE_ROOT` | The save root. Refer to "Files and folders". |
|
||||
| `network.address` | `""` | `HALO_NET_ADDRESS` | The IPv4 address of this machine for system link. Refer to "Play on one computer". |
|
||||
@@ -393,11 +510,15 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `network.allow_upnp` | `true` | `HALO_NET_ALLOW_UPNP` | `true`: internet play can ask the router to forward its port (UPnP). `false`: the game does not ask. Refer to "Internet play". |
|
||||
| `network.public_lobby` | `true` | `HALO_NET_PUBLIC_LOBBY` | `true`: the server browser. Public games are listed, and Join Game > Server Browser shows them. `false`: no games are listed or shown. Refer to "Server browser". |
|
||||
| `network.host_public` | `true` | `HALO_NET_HOST_PUBLIC` | `true`: a new game of Create Game > Internet starts as PUBLIC. `false`: it starts as PRIVATE. LISTING in Server Setup changes it for each game. Refer to "Server browser". |
|
||||
| `network.coop_friendly_fire` | `"on"` | `HALO_NET_COOP_FRIENDLY_FIRE` | Whether the players of an online co-op game hurt each other: `"off"`, `"on"`, `"shields_only"` or `"explosives_only"`. FRIENDLY FIRE in co-op's Server Setup > Co-op Options writes its choice here. Their AI allies they always can, as in the campaign. |
|
||||
| `network.coop_friendly_fire` | `"on"` | `HALO_NET_COOP_FRIENDLY_FIRE` | Whether the players of an online co-op game hurt each other: `"off"`, `"on"`, `"shields_only"` or `"explosives_only"`. FRIENDLY FIRE in co-op's Server Setup > Co-op Options writes its choice here. Their AI allies they hurt as `network.coop_ally_friendly_fire` says. |
|
||||
| `network.coop_ally_friendly_fire` | `true` | `HALO_NET_COOP_ALLY_FRIENDLY_FIRE` | Whether the players of an online co-op game hurt their AI allies (the Marines, Captain Keyes, the Sentinels while they are allies), as in the campaign. `false`: the players' weapons, grenades, melee and vehicles do them no harm, so that no player can kill the allies a level needs. The allies' and enemies' own damage is unchanged. ALLY FRIENDLY FIRE in co-op's Server Setup > Co-op Options writes its choice here; the host sends it with the game's settings. |
|
||||
| `network.coop_own_friendly_fire` | `true` | `HALO_NET_COOP_OWN_FRIENDLY_FIRE` | Whether this machine's players hurt, and are hurt by, the other players of an online co-op game. Two players hurt each other only if both have it `true`, and then as the host's `network.coop_friendly_fire` says. FRIENDLY FIRE in that game's pause menu writes its choice here. A player away from the controls for over 70 seconds is hurt by every player, whatever either chose. |
|
||||
| `network.coop_player_collisions` | `true` | `HALO_NET_COOP_PLAYER_COLLISIONS` | Whether the players of an online co-op game bump into each other. `false`: they walk through each other, so that one cannot block a doorway or stand on another; they still bump into the AI's characters. PLAYER COLLISIONS in co-op's Server Setup > Co-op Options writes its choice here. |
|
||||
| `network.coop_enemies_mode` | `"per_player"` | `HALO_NET_COOP_ENEMIES_MODE` | Online co-op's extra enemies: `"none"`; `"per_player"`, each squad of enemies that a level places grows by `network.coop_enemies` for each player past the first; or `"multiplier"`, each squad is `network.coop_enemies_multiplier` times as large, for any number of players. The extra enemies stand around the squad's places, and those that a dropship has no seats for drop out of it after its passengers. EXTRA ENEMIES in co-op's Server Setup > Co-op Options writes its choice here. |
|
||||
| `network.coop_enemies` | `50` | `HALO_NET_COOP_ENEMIES` | The extra enemies per player, a percentage from `25` to `200`: for each player past the first, each squad of enemies gets this much of itself more (`100`: as many again, so four players meet four times the squad), up to 8 times the squad however many players there are. PER PLAYER in co-op's Server Setup > Co-op Options writes its choice here. |
|
||||
| `network.coop_enemies_multiplier` | `2` | `HALO_NET_COOP_ENEMIES_MULTIPLIER` | The static multiplier of the enemies, `2` to `32`: each squad of enemies is this many times as large. MULTIPLIER in co-op's Server Setup > Co-op Options writes its choice here. |
|
||||
| `network.coop_pickups` | `"none"` | `HALO_NET_COOP_PICKUPS` | EXTRA PICKUPS in co-op Server Setup > Co-op Options. Modes: `"per_player"`, `"multiplier"`, `"none"`. Static mode uses the shared MULTIPLIER, capped at 8x. In per-player mode, the host scales scenario-placed campaign weapons, grenades, health kits, overshields and active camouflage by the shared PER PLAYER percentage, capped at 8 times their original count. Fractions are distributed over placements of the same item. Copies retain weapon ammunition and use clear nearby floor in the active BSP. No safe space or capacity means no extra pickup. Enemy drops, inventory and vehicles are excluded. Script-created supplies count surviving copies against their placement budget. Checkpoints retain pending counts and copies together, without multiplying again on restore. |
|
||||
| `network.coop_vehicles` | `"none"` | `HALO_NET_COOP_VEHICLES` | EXTRA VEHICLES after EXTRA PICKUPS in Co-op Options. Modes: `"per_player"`, `"multiplier"`, `"none"`. Each authored driveable vehicle supplies floor((players - 1) * Per Player * 2 / 300) extra copies in per-player mode, or floor((Multiplier - 1) * 2 / 3) extras in static mode, one at a time after a player drives the previous one clear of the home by the sum of both bounding-sphere radii plus 15%. Vehicle growth has an exact 2/3 modifier before rounding down; the default 50% requires four players for the first copy. Pelican cargo uses its unloaded resting position. Only the host spawns; obstructed pads and exhausted object capacity wait. Copies have no script name or AI passengers. In-memory checkpoint reverts restore the home table and budgets together; loading a disk/core checkpoint without that table forgets its old homes. None by default. |
|
||||
| `network.coop_enemies_multiplier` | `2` | `HALO_NET_COOP_ENEMIES_MULTIPLIER` | The shared static multiplier, `2` to `32`, for options set to STATIC MULTIPLIER. Enemy squads are this many times as large; pickups are capped at 8x; vehicles supply floor((Multiplier - 1) * 2 / 3) extra copies. MULTIPLIER in co-op's Server Setup > Co-op Options writes its choice here. |
|
||||
| `network.voice_lobby` | `true` | `HALO_NET_VOICE_LOBBY` | When you host: `true`, all players hear all players in the lobby, before and after a game. |
|
||||
| `network.voice_mode` | `"team_global_enemy_proximity"` | `HALO_NET_VOICE_MODE` | When you host: who hears whom during a game. `"off"`; `"team_proximity"` (teammates who are near); `"team_enemy_proximity"` (all players who are near); `"team_global"` (all teammates); `"team_global_enemy_proximity"` (all teammates, and enemies who are near). Refer to "Voice chat". |
|
||||
| `network.voice_kbps` | `24` | `HALO_NET_VOICE_KBPS` | When you host: the voice quality in the lobby and in a game, in kilobits per second, `8` to `64`. |
|
||||
@@ -406,6 +527,8 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `network.votekick` | `true` | `HALO_NET_VOTEKICK` | When you host: `true`, the players can vote to kick a player. Refer to "Security". `false`: no votes. VOTE KICK in Server Setup > Teamplay Options (in co-op, Voice and Voting) writes its choice here. |
|
||||
| `network.votekick_minutes` | `5` | `HALO_NET_VOTEKICK_MINUTES` | When you host: the minutes that a player must play on the server before the player can start a vote to kick (`0` to `60`). To vote, a player must play for 2 minutes, or for this time if it is less. |
|
||||
| `network.votekick_ban_minutes` | `30` | `HALO_NET_VOTEKICK_BAN_MINUTES` | When you host: the minutes that a player who is kicked by a vote cannot join again (`1` to `1440`). |
|
||||
| `network.shield_effects` | `stock` | `HALO_NET_SHIELD_EFFECTS` | Host: the shield effects every player of a network game sees, whatever their own settings, so that none sees what another does not: `stock`, `glow` (`display.shield_glow`), `light_show` (its Light Show intensity), `overshield` (`display.overshield_effect`), `glow_overshield` or `light_show_overshield`. Sent to each client when it is ready and when it changes (`network_shield_effects.c`); a client draws stock until it has it. SHIELD EFFECTS in Server Setup > Player Options writes its choice here. |
|
||||
| `network.block_mouse_aim_assist` | `false` | `HALO_NET_BLOCK_MOUSE_AIM_ASSIST` | Host: Player Options > Aim Assist, Allowed or Block M+KB. Block overrides optional mouse magnetism while mouse/keyboard aims, including on the host, without changing the saved preference. Controllers and touch retain their existing behavior; bullet autoaim is unchanged. |
|
||||
| `network.map_share` | `true` | `HALO_NET_MAP_SHARE` | When you host: send a player who joins without the game's Custom Edition map the map, and the resource maps that it needs and that the player does not have. SHARE MAPS in Server Setup > Map Sharing writes its choice here. Refer to "Map sharing". |
|
||||
| `network.map_share_upload` | `1024` | `HALO_NET_MAP_SHARE_UPLOAD` | When you host: the most kilobytes per second that the game sends of maps (`16` to `20480`, 20 MB/s). UPLOAD LIMIT in Server Setup > Map Sharing writes its choice here. |
|
||||
| `network.map_seed` | `true` | `HALO_NET_MAP_SEED` | When you play in the game of another machine: help send its map to players who join without it. HELP SEND MAPS in Settings > Network Setup > Map Sharing. |
|
||||
@@ -422,14 +545,18 @@ the setting for one start of the game. It has priority over the file.
|
||||
| `streamer.insults` | `"off"` | `HALO_STREAMER_INSULTS` | With `streamer.enabled`, the insults that are not slurs hidden: `"off"`, `"severe"`, `"strong"` or `"mild"`. CENSOR INSULTS in Settings > Network Setup > Streamer Mode. |
|
||||
| `crash_reports.upload` | `"ask"` | `HALO_CRASH_REPORTS` | Windows only. `"yes"`: the game sends a report of each crash to the developers. `"no"`: the game sends no reports. `"ask"`: the game asks at the next crash and writes the answer here. Refer to "Crash reports" in [port/windows/README.md](../windows/README.md#crash-reports). |
|
||||
| `debug.update_answer` | `""` | `HALO_UPDATE_ANSWER` | The answer to the update question, for automatic tests: `yes`, `no` or `never`. Empty: the game asks. |
|
||||
| `debug.exit_after` | `0.0` | `HALO_EXIT_AFTER` | The game stops after this number of seconds. `0`: never. |
|
||||
| `debug.fixed_step` | `false` | `HALO_FIXED_STEP` | `true`: a game of this computer alone runs one tick a frame, whatever time has passed, so that it plays the same every time (tests). |
|
||||
| `debug.exit_after` | `0.0` | `HALO_EXIT_AFTER` | The game stops after this number of seconds (from when its window opens; with `debug.null_renderer`, or no display, from its first frame). `0`: never. |
|
||||
| `debug.screenshot_directory`, `debug.screenshot_every` | `""`, `0` | `HALO_SCREENSHOT_DIR`, `HALO_SCREENSHOT_EVERY` | The game writes each Nth frame to this folder as a BMP file. |
|
||||
| `debug.hidden_window`, `debug.null_renderer` | `false` | `HALO_HIDDEN_WINDOW`, `HALO_NULL_RENDERER` | `true`: no visible window, or no graphics. |
|
||||
| `debug.gpu_stats`, `debug.gpu_trace_frame`, `debug.gpu_trace_constants`, `debug.gpu_dump_shaders`, `debug.texture_dump_directory`, `debug.texture_log`, `debug.gl_debug`, `debug.texture_no_cache` | off | `HALO_GPU_STATS`, `HALO_GPU_TRACE`, `HALO_GPU_TRACE_CONSTANTS`, `HALO_GPU_DUMP_SHADERS`, `HALO_TEXTURE_DUMP`, `HALO_TEXTURE_LOG`, `HALO_GL_DEBUG`, `HALO_TEXTURE_NO_CACHE` | Tools to find problems in the graphics: counts for each frame, all the GL state of one frame, the GLSL code, the textures. |
|
||||
| `debug.menu_open` | `""` | `HALO_MENU_OPEN` | Start on this screen of the menus (`main_menu/settings_select/...`, as `port/assets/menus` names it), a player profile being edited, to look at it. |
|
||||
| `debug.gpu_skip_vertex_shaders`, `debug.gpu_debug_expression`, `debug.gpu_debug_flat`, `debug.gpu_debug_texture0` | off | `HALO_GPU_SKIP_VS`, `HALO_GPU_DEBUG_EXPR`, `HALO_GPU_DEBUG_FLAT`, `HALO_GPU_DEBUG_T0` | Tools to find problems in the graphics: skip the draws of a vertex shader, or replace the output of all pixel shaders with a GLSL expression (for example `t0.rgb`). |
|
||||
| `debug.network_test`, `debug.network_test_start`, `debug.network_test_kill`, `debug.network_test_score`, `debug.network_test_shoot`, `debug.network_test_vehicle`, `debug.network_test_pickup`, `debug.network_test_pickup_weapon`, `debug.network_test_chat`, `debug.network_test_name`, `debug.network_test_public`, `debug.test_input` | off | `HALO_NETWORK_TEST`, `HALO_NETWORK_TEST_START`, `HALO_NETWORK_TEST_KILL`, `HALO_NETWORK_TEST_SCORE`, `HALO_NETWORK_TEST_SHOOT`, `HALO_NETWORK_TEST_VEHICLE`, `HALO_NETWORK_TEST_PICKUP`, `HALO_NETWORK_TEST_PICKUP_WEAPON`, `HALO_NETWORK_TEST_CHAT`, `HALO_NETWORK_TEST_NAME`, `HALO_NETWORK_TEST_PUBLIC`, `HALO_TEST_INPUT` | Automatic tests of system link (`game/network_test.c`). Refer to `NETCODE.md`. |
|
||||
| `debug.network_test`, `debug.network_test_start`, `debug.network_test_kill`, `debug.network_test_score`, `debug.network_test_shoot`, `debug.network_test_vehicle`, `debug.network_test_pickup`, `debug.network_test_pickup_weapon`, `debug.network_test_chat`, `debug.network_test_name`, `debug.network_test_public`, `debug.test_input` | off | `HALO_NETWORK_TEST`, `HALO_NETWORK_TEST_START`, `HALO_NETWORK_TEST_KILL`, `HALO_NETWORK_TEST_SCORE`, `HALO_NETWORK_TEST_SHOOT`, `HALO_NETWORK_TEST_VEHICLE`, `HALO_NETWORK_TEST_PICKUP`, `HALO_NETWORK_TEST_PICKUP_WEAPON`, `HALO_NETWORK_TEST_CHAT`, `HALO_NETWORK_TEST_NAME`, `HALO_NETWORK_TEST_PUBLIC`, `HALO_TEST_INPUT` | Automatic tests of system link, or (`log`) a log of the game one machine plays (`game/network_test.c`). Refer to `NETCODE.md`. `debug.test_input = "menu:a down down a"` presses menu buttons one a second (`a`, `b`, `x`, `y`, `up`, `down`, `left`, `right`, `start`, `back` or `wait`), for testing the menus. |
|
||||
| `debug.network_test_cues`, `debug.network_test_cue_players` | none, `1` | `HALO_NETWORK_TEST_CUES`, `HALO_NETWORK_TEST_CUE_PLAYERS` | Console lines a test runs at their seconds, from the first tick that many players are in (`"<second> <line>\|..."`; not on the web). |
|
||||
| `debug.bot_trace` | `0` | `HALO_BOT_TRACE` | Every this many seconds, each bot's state is written to the log: where it is and where it goes, its path, its target and its weapon. `0`: never. |
|
||||
| `debug.touch_targets` | `false` | `HALO_TOUCH_TARGETS` | Outlines the tap targets of the menus (item green, value blue, list slot yellow, legend button red, the band beside the slots of a list orange, keys of the on-screen keyboard white), marks where the last finger went down and the last tap landed for 3 seconds, and logs each tap with the target that it hit (for a value, also where it splits into previous and next): to judge the accuracy of touch. |
|
||||
| `debug.log_addresses` | `false` | `HALO_LOG_ADDRESSES=1` sets `true` | `true`: other machines' internet addresses are written whole in `debug.txt` and the console, for debugging your own network. `false`: a public address is written as a tag (`addr#3f2a9c`) that matches up only within one run; local network addresses are always whole. Do not post a `debug.txt` written with this on. |
|
||||
| `debug.network_latency`, `debug.network_loss`, `debug.network_corrupt`, `debug.network_corrupt_stream`, `debug.network_corrupt_after` | `0` | `HALO_NETWORK_LATENCY`, `HALO_NETWORK_LOSS`, `HALO_NETWORK_CORRUPT`, `HALO_NETWORK_CORRUPT_STREAM`, `HALO_NETWORK_CORRUPT_AFTER` | The game holds all the data that it receives for this number of milliseconds, ignores this percentage of the datagrams, and damages this percentage of the datagrams it receives, and this percentage of its reads of streams, at random (bytes changed, cut short, stretched or replaced), from this many seconds after the start. Use the first two to test the netcode as on the internet, and the others to test that nothing another machine sends can crash the game (a damaged stream is closed, so a little goes a long way; a host's messages to its own client are damaged too, so start damaging once the game has started). |
|
||||
| `debug.voice_test` | `false` | `HALO_VOICE_TEST` | Automatic tests of voice chat: a tone replaces the microphone, and each voice that the game hears is written to the log once each second. |
|
||||
| `debug.telnet_console`, `debug.telnet_console_port` | `false`, `2323` | `HALO_TELNET_CONSOLE`, `HALO_TELNET_CONSOLE_PORT` | The game listens on 127.0.0.1, on this port, for a script console (connect with telnet). The console has no password, so only this computer can reach it. |
|
||||
@@ -456,6 +583,11 @@ If the latest release is newer, the game asks: "Do you want to update?"
|
||||
writes `auto = false` in the `[update]` section of `config.toml`. To get
|
||||
the questions again, set `auto = true`.
|
||||
|
||||
Under gamescope (the Game Mode of the Steam Deck), the game does not ask,
|
||||
because a system dialog stops the game there. The game writes the new
|
||||
version in the log. To update, start the game from the desktop, or set
|
||||
`update_answer = "yes"` in the `[debug]` section of `config.toml`.
|
||||
|
||||
The game downloads through HTTPS. It examines the certificate of the server
|
||||
against the certificate authorities of the system: on Linux, the bundle of
|
||||
the distribution (`src/posix_update.c`, with Mbed TLS); on Windows, the
|
||||
@@ -827,11 +959,23 @@ GAME joins only with the correct password. The invite link of the game joins
|
||||
it without the password. The host keeps the password only while the game
|
||||
runs.
|
||||
|
||||
In the Server Browser, select a game to join it. The game joins the invite
|
||||
of the game, as for a link. When it reaches the host, it opens the lobby.
|
||||
If it cannot reach the host in 30 seconds, it marks the game FAILED. A game
|
||||
that is full or starting shows CLOSED. REFRESH asks the hosts for their
|
||||
listings again.
|
||||
In the Server Browser, as in Custom Edition's, a click selects a game
|
||||
(outlined in yellow), and a click on the selected game, a double click, A,
|
||||
Enter or JOIN joins it. The game joins the invite of the game, as for a
|
||||
link. When it reaches the host, it opens the lobby. If it cannot reach the
|
||||
host in 30 seconds, it marks the game FAILED; when this machine's NAT gives
|
||||
each destination its own port and no router forwards
|
||||
`network.tunnel_port`, the line below the games says so (turn on UPnP on
|
||||
the router, or forward the port: refer to "Connection").
|
||||
|
||||
The PING column shows the round trip to each host in milliseconds. The
|
||||
browser times it as a join would reach the host: it makes the tunnel with
|
||||
the listing's invite, keeps the shortest of three pings, and closes the
|
||||
tunnel again. It times a few hosts at once, each again every two minutes
|
||||
and on REFRESH. Joining a host whose tunnel is open uses that tunnel. A
|
||||
game with a password, whose invite the listing hides, shows no ping, nor
|
||||
does a host not reached; a game that is full or starting shows CLOSED.
|
||||
REFRESH also asks the hosts for their listings again.
|
||||
|
||||
How it operates (`src/p2p_lobby.c`):
|
||||
|
||||
@@ -870,8 +1014,9 @@ as for any public server.
|
||||
The brokers are in `brokers.txt` next to the executable (from
|
||||
`port/assets/network/brokers.txt`; on Android, the app writes it next to
|
||||
`config.toml` at each start), one `host:port` on each line. The game uses
|
||||
all of them at once (up to 4), so one that works is enough. An update
|
||||
replaces `brokers.txt`: to use brokers of your own, put them in another
|
||||
all of them at once (up to 4), so one that works is enough. Without the
|
||||
file (a game run from somewhere the builds did not put it), the game uses
|
||||
its own copy of the list. An update replaces `brokers.txt`: to use brokers of your own, put them in another
|
||||
file and name it in `network.brokers_file`. All the players must use the
|
||||
same broker to see each other's games. The game uses
|
||||
MQTT 5 if the broker has it, else MQTT 3.1.1. A broker that does not keep
|
||||
@@ -1216,7 +1361,8 @@ crafted file) is refused, and the level starts over.
|
||||
| High-res HUD | The HUD is drawn from high-res assets: redraws at 8x the size of the maps' bitmaps (4x for the largest), in `port/assets/hud`. They cover the meters, counters, panels and their outlines, the motion sensor, reticles, waypoints and scopes, but no bitmap with English text. `tools/hud_assets.py` makes them from the SVG redraws (the weapons' reticles from those of the PC HUD sheet that match the Xbox's exactly, the sniper rifle's 2x and 10x set in Overpass), and the build embeds them in the executable. When the game uploads one of those bitmaps, `src/hud_hires.c` gives the high-res texture in its place, if the bitmap's pixels are those of the English maps: another language's maps keep their own. The game sizes and places the HUD from its tags as before. `display.high_res_hud = false` turns this off. |
|
||||
| High-res text | The menus' and HUD's text is drawn with Overpass (`port/assets/fonts`, SIL Open Font License) in place of the maps' bitmap fonts, which are Interstate. `src/text_hires.c` rasterizes each glyph with stb_truetype (`port/third_party/stb`) at the resolution the game draws at, into an atlas that a placeholder bitmap of the game stands for. The game lays the text out from its font tags as before: each font is as tall as its tag's capitals, and narrowed where the tag's letters are narrower than the Xbox maps' (the fonts of a Custom Edition `loc.map`), so that its letters do not run into each other. The menus' titles (the screens' headers and the main menu's items) are pictures of text in the maps, so they are drawn as the high-res HUD is: `tools/title_assets.py` sets each one again in OpenCE, Roger White's public-domain Newtown respaced to match the maps' commercial title typeface (`tools/title_font.py`), at 4x the bitmap's size over its own plate or glow, each letter placed where the map's letter is, in `port/assets/titles`. The postgame carnage report's title is set over a hand-made SVG redraw of its panel (`port/assets/titles/svg`) instead. The A, B, X and Y button icons beside the menus' key labels and in their text ("Press A to Join") are drawn from hand-made SVG redraws at 8x the size of the maps' bitmaps (`port/assets/buttons`, made by `tools/button_assets.py`), in the same sizes and places. `display.high_res_text = false` turns it off. |
|
||||
| Anti-aliasing | Off unless `display.anti_aliasing` is set (`src/d3d8_gl.c`, `src/xgpu_post.c`). FXAA (written in the port) and SMAA (`port/third_party/smaa`, MIT licensed, at its HIGH preset, compiled as GLSL) are passes over the 3D view of each window, after the lens flares and before the HUD and the menus (`render/render.c`). Their programs are built when the setting is chosen. Supersampling draws the render targets the size of the screen at two times the resolution in each direction, and the display blit scales them down. Multisampling draws the back buffer and its depth buffer into multisampled renderbuffers, and with them any target that is drawn together with one of them (a mirror's view, in the secondary target with the back buffer's depth buffer), so that the attachments of a framebuffer are all multisampled or none is. A target's pixels are resolved into its texture before something reads the texture (as a texture, or at the display blit). Visibility tests count samples, divided by the samples of a pixel. An alpha-tested surface (foliage, grates) covers the samples of a pixel in proportion to its alpha past the reference (`gl_SampleMask`, not on Android). |
|
||||
| Sound | Xbox DirectSound on SDL3 audio (`src/dsound_sdl.c`): PCM and Xbox ADPCM, mixed at 48 kHz, with volume, pitch, mix bins, distance, stereo pan, occlusion and obstruction. There is no Doppler effect, no cones and no reverb. |
|
||||
| HDR | Off unless `display.hdr` is set (`src/d3d8_gl.c`, `src/xgpu_post.c`). The back buffer's texture, and its multisampled renderbuffer, is `GL_RGBA16F` (`GL_HALF_FLOAT` on Android), with the same `GL_DEPTH24_STENCIL8` depth buffer. The game's pixel shaders give colours from 0 to 1, as the NV2A's register combiners did, so the light past white comes from blending, which a floating-point target does not clamp. The tone mapping pass is a pass over the 3D view of each window, before the anti-aliasing (`render/render.c`): it takes each pixel from gamma 2.2 to linear light, multiplies it by `display.hdr_exposure`, applies the curve, and returns to gamma 2.2. It writes the colour only, since the game keeps its own data in the alpha. The display blit becomes a draw that clamps to 1, or, in a floating-point window, gives scRGB (linear light, 1 at the display's SDR white, which SDL reports with the headroom). The settings are read between frames; a change of `display.hdr` makes the back buffer again in the other format. |
|
||||
| Sound | Xbox DirectSound on SDL3 audio (`src/dsound_sdl.c`): PCM and Xbox ADPCM, mixed at 48 kHz in stereo or 5.1, with volume, pitch, mix bins, distance, pan, occlusion and obstruction. There is no Doppler effect and no cones. On 5.1 the game gets the AC-3 speaker setting of the Xbox and sends its 2D sounds to the center and back speakers, 3D sounds pan across the five speakers, and the reverb plays from the front and back pairs. The game sends nothing to the LFE channel. |
|
||||
| Input | XInput on SDL3 (`src/xinput_sdl.c`): keyboard, mouse, gamepads with rumble, and the debug keyboard for the console. |
|
||||
| Files | The Win32 file functions and the MSVC file functions on POSIX, with the translation of Xbox paths. |
|
||||
| Threads | Threads, events, mutexes, critical sections, interlocked operations and alertable waits. |
|
||||
@@ -1307,7 +1453,8 @@ Other changes:
|
||||
| `rasterizer/xbox/rasterizer_xbox_environment_fog.c` | A local pointer gets its value from the file-scope array with the same name. |
|
||||
| `game/player_control.c` | The mouse aims the player on controller 1 directly. |
|
||||
| `sound/game_sound.c` | The game calculates the obstruction of each sound one time for each tick, not for each frame. |
|
||||
| `cseries/errors.c` | `debug.txt` stays open between lines. |
|
||||
| `sound/sound_manager.c` | A track of a looping sound that is gone stops, even in the millisecond it started (`refresh_sound`). The Xbox never drew three frames in one millisecond; the port can (the null renderer, no frame limit), and then read the deleted looping sound and crashed. |
|
||||
| `cseries/errors.c` | `debug.txt` stays open between lines. A line that is the same as the line before it is counted, not written again (`last line repeated N times`). At 64 MB, `debug.txt` becomes `debug.old.txt` and a new `debug.txt` starts. |
|
||||
| `networking/`, `game/`, `interface/`, `bungie_net/network/` and the pools of objects, effects and sounds | The system link limits and the memory for them. |
|
||||
| `game/`, `objects/`, `units/`, `networking/` | The distributed netcode. Refer to `NETCODE.md`. |
|
||||
| `cache/cache_files.c` | When a map's tags load and unload, the port finds the bitmaps that the high-res HUD replaces (`game/hud_hires_tags.c`), adds the tags of the menus to the menus' map (`game/menu_tags.c`), and plays the mods' tags (`game/mods.c`). |
|
||||
@@ -1315,17 +1462,23 @@ Other changes:
|
||||
| `hs/hs.c` | The console's `mods_reload`, `mods_enable` and `mods_list`, which a client may run too. |
|
||||
| `interface/ui_widget.c`, `interface/ui_widget_event_handler_functions.c`, `interface/ui_widget_game_data_input_functions.c` | The main menu is the PC version's from `port/assets/menus` (`display.menus`); the menus' widgets can call the port's functions (`game/menu_functions.c`) and send the PC version's custom activation event; the widgets' memory is 256 KB, not 16 KB; the main menu and Multiplayer clear co-op's controllers, so that a gamepad going back to controller 1 is not a controller unplugged; the lobby's split screen players leave alone, and one who quits in game is not joined to the next game (`interface/player_ui.c`). |
|
||||
| `interface/player_ui.c` | Fast setup opens the pregame screen through the port's menus (the lobby), as `interface/ui_widget.c` does. |
|
||||
| `game/game_engine.c`, `game/game_engine.h`, `game/game_engine_slayer.c`, `game/game.c`, `game/aim_assist.c`, `game/players.c`, `objects/damage.c`, `objects/objects.c`, `units/units.c`, `items/weapons.c`, `saved games/playlist_profile.c`, `saved games/saved_game_files.c` | OpenCE's gametypes (`game/game_modes.c`, "OpenCE gametypes"): the gametype's PC options carry a mode and Hardcore with their options; the built-in ones are written after the Xbox's default gametypes; Infection's and Gun Game's game engines are Slayer's with their rules; SWAT's headshots, Hardcore's motion sensor, aim assist and restore of the killer; Infection's zombies' skulls, grenades, powerups, seats and melee. |
|
||||
| `game/game_time.c`, `main/main.c` | With `debug.fixed_step`, a game of one machine runs a tick a frame, each frame taking a tick's time, so that it plays the same every time (`tools/stagekit`). |
|
||||
| `input/input_abstraction.c`, `game/player_control.c`, `game/players.c`, `game/player_queues_new.c`, `units/units.h` | The keyboard and mouse's actions (`src/xinput_sdl.c`, `include/halo_keyboard.h`) join controller 1's game controls; their reload key reloads on its own, and their action key only acts (a control flag of the port's, sent with the player's action, stops the reload the controller's X falls back to). |
|
||||
| `saved games/player_profile.h`, `interface/player_ui.c` | A sixth button layout, the Master Chief Collection's Bumper Jumper (`profile.button_preset` 5). A layout the build does not know (a later build's) gets the standard buttons, not none, which moved start and back and stopped the game. |
|
||||
| `sound/sound_manager.c`, `interface/hud.c`, `game/game_engine.c` | The music's and the other sounds' volumes; the HUD's and the scoreboard's settings are read again when Settings changes them. |
|
||||
| `rasterizer/xbox/rasterizer_xbox_shadows.c` | With larger shadow maps (`display.shadow_resolution`), the blur's taps stay half a texel apart, and more passes widen it to cover the same part of the map as on the Xbox. |
|
||||
| `rasterizer/rasterizer.c` | The 128 KB of vertices of the debug display of a model's vertices are static, not on the stack: the compiler inlines the function in `render_model`, and the Windows build probed the stack a page at a time for every model drawn. |
|
||||
| `render/render.c` | The 3D view of each window is antialiased before the HUD is drawn (`display.anti_aliasing`). |
|
||||
| `render/render.c` | The 3D view of each window is tone mapped (`display.hdr`) and antialiased (`display.anti_aliasing`) before the HUD is drawn. |
|
||||
| `render/render.c` | `render_initialize` reads the structure culling tests from `display.structure_culling`. |
|
||||
| `models/models.c` | A model's size, which chooses its level of detail and whether it is drawn, is scaled as `display.model_detail` says (`halo_model_detail_scale`, `src/d3d8_gl.c`), and each permutation draws the level `game/model_detail.c` chooses from the model's (stock: the model's). |
|
||||
| `interface/hud.c` | In multiplayer, players' names are drawn above their heads (`display.player_names`, `display.player_name_scale`). |
|
||||
| `text/draw_string.c`, `interface/terminal.c`, `interface/virtual_keyboard.c` | Streamer mode's words are hidden in every string drawn or measured (`game/text_filter.c`), but in the console's line and the virtual keyboard's text being typed. |
|
||||
| `rasterizer/rasterizer_text.c`, `text/draw_string.c` | Text is drawn from an atlas of the fonts' glyphs, rasterized at the resolution the game draws at (`src/text_hires.c`), when the font has every character of the string. Text can be drawn scaled about a point (`rasterizer_text_set_scale`), as the players' names are. Each glyph's advance is centred on the font tag character's, so the layout is the same, and a glyph is cut at a text box only where the font tag's character visibly was. |
|
||||
| `interface/first_person_weapons.c` | The first-person hands are drawn with the unit's shield modifier shader, as its body is (`display.viewmodel_shield`). |
|
||||
| `render/render_objects.c`, `objects/objects.c` | In first person, your own body is drawn from the waist down with the pose `first_person_legs.c` makes (`display.first_person_legs`); the waist it found and the mesh `object_mesh.c` read are forgotten on a new map. |
|
||||
| `objects/object_lights.c` | Glows the port lights itself (`shield_glow.c`): dynamic lights attached to an object's node, colored and sized each frame by their maker, drawn with a light definition the map has. |
|
||||
| `render/render_objects.c`, `interface/first_person_weapons.c`, `rasterizer/xbox/rasterizer_xbox_plasma_energy.c`, `items/projectiles.c` | An overshield as `overshield_effect.c` draws it (`display.overshield_effect`): in its own color, its intensity full, its energy slower, faded above the height it has risen to; a hit on it plays the projectile's effect for an Elite's energy shield in place of its own (only the effect: the projectile's response is its own). |
|
||||
| `render/render_objects.c`, `interface/first_person_weapons.c`, `rasterizer/xbox/rasterizer_xbox_plasma_energy.c` | A local player's shield plasma is drawn in the chosen armor color (`display.shield_color`, `shield_color.c`), on the body and on the first-person arms. |
|
||||
| `rasterizer/xbox/rasterizer_xbox_text.c`, `rasterizer/rasterizer_text.c` | The characters of a string are one draw, not a draw each (and a second for the drop shadow). The batch is drawn early before a character is cached and before the high-res glyph atlas starts over (`src/text_hires.c`). |
|
||||
| `rasterizer/xbox/rasterizer_xbox_decals.c` | Decals drawn one after another with the same blend function and bitmap are one draw, with each decal's color in its vertices, not a draw each: a long fight leaves hundreds in view. Within a run of decals whose blend functions commute (multiply, add, min, max, reverse subtract), they are drawn by bitmap, so more of them share a draw. |
|
||||
@@ -1335,6 +1488,7 @@ Other changes:
|
||||
| `cache/cache_files.c`, `networking/network_client_manager.c`, `networking/network_server_manager.c`, `networking/network_server_message_handler.c`, `main/main.c`, `interface/interface.c` | Map sharing (`game/map_share.c`): a client that does not have the game's Custom Edition map asks the host for it instead of leaving, is not given time to precache it until it has it, and adds its players to a game in progress only then; the host gives the game's map its own name and its version (its hash's start), takes the requests from any machine in the game, lobby too, and does not drop a machine that downloads; the transfers run each frame, and their progress is drawn over the screen. |
|
||||
| `cutscene/cinematics.c` | A scenario's titles (some Custom Edition maps show their name for the whole game) are not drawn over a menu, as the letterbox is not: the screen's overlays are drawn after the players' menus. |
|
||||
| `tag_files/tag_groups.h` | `TAG_BLOCK_GET_ELEMENT` returns an element in the block without a call, and calls `tag_block_get_element_with_size` for anything else. |
|
||||
| `game/players.c`, `networking/network_server_manager.c` | Bots (`game/bots.c`, `bots.count`): the lobby of a local Slayer game takes the bot players, each the one player of a machine of its own that no real machine is, and every tick their actions come from `game/bots.c` instead of their empty queues. Nothing changes in a system link or internet game. |
|
||||
| `input/input_xbox.c`, `physics/collision_usage.c` | The clock is read only for a button held, and for collision tests only when their times are shown: a read of the clock is slow in a browser. |
|
||||
| `main/main.c`, `interface/hud.c`, `interface/hud_unit.c`, `interface/hud_draw.c`, `game/game_engine.c` | The text chat of network games (`game/network_chat.c`): its keys are read each frame, and the debug keys are not while a line is typed; each view's HUD draws its lines, above the motion sensor, whose place the HUD notes (the left of the last picture drawn); the scoreboard's menu has Mute voice and chat, and the host's Mute for everyone. |
|
||||
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
/* CE textures can exceed the Android Xbox window's current-frame capacity.
|
||||
* Keep individual allocations stable rather than repeatedly moving/reloading
|
||||
* a packed arena. This cache owns only synchronous, cached CE map pixels;
|
||||
* dynamic textures and other map storage keep their established paths. */
|
||||
#ifdef HALO_ANDROID
|
||||
#include "cseries.h"
|
||||
#include "bitmaps/bitmaps.h"
|
||||
#include "bitmaps/bitmap_group.h"
|
||||
#include "android_ce_texture_cache.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* cseries redirects free to debug_free, but calloc is the runtime allocator.
|
||||
* These cache-owned allocations must return to the matching runtime heap. */
|
||||
#undef free
|
||||
|
||||
#define ANDROID_CE_TEXTURE_BYTES (128UL * 1024UL * 1024UL)
|
||||
#define ANDROID_CE_TEXTURE_ENTRIES 8192
|
||||
#define ANDROID_CE_TEXTURE_BUCKETS 1024
|
||||
|
||||
struct android_ce_texture
|
||||
{
|
||||
struct android_ce_texture *bitmap_next, *resource_next;
|
||||
struct android_ce_texture *older, *newer;
|
||||
struct bitmap_data *bitmap;
|
||||
unsigned long header[5];
|
||||
void *pixels;
|
||||
unsigned long bytes, frame;
|
||||
};
|
||||
|
||||
static struct android_ce_texture *bitmap_buckets[ANDROID_CE_TEXTURE_BUCKETS];
|
||||
static struct android_ce_texture *resource_buckets[ANDROID_CE_TEXTURE_BUCKETS];
|
||||
static struct android_ce_texture *oldest, *newest;
|
||||
static unsigned long cache_bytes, cache_count, cache_frame;
|
||||
static unsigned long cache_loads, cache_evictions, cache_failed;
|
||||
static unsigned long cache_peak;
|
||||
extern void platform_log(const char *format, ...);
|
||||
extern void halo_custom_edition_texels_channels(const void *pixels, unsigned char order);
|
||||
|
||||
static unsigned long android_ce_texture_bucket(const void *pointer)
|
||||
{
|
||||
return (((unsigned long)pointer >> 4) * 2654435761UL) % ANDROID_CE_TEXTURE_BUCKETS;
|
||||
}
|
||||
|
||||
static void android_ce_texture_report(void)
|
||||
{
|
||||
/* One summary per unload/flush; no per-frame logging or pixel readback. */
|
||||
platform_log("textures: Android CE cache peak=%lu limit=%lu loads=%lu evictions=%lu failures=%lu",
|
||||
cache_peak, ANDROID_CE_TEXTURE_BYTES, cache_loads, cache_evictions, cache_failed);
|
||||
}
|
||||
|
||||
static void android_ce_texture_failed(void)
|
||||
{
|
||||
if (!cache_failed++)
|
||||
platform_log("textures: Android CE cache allocation failed (used=%lu limit=%lu entries=%lu)",
|
||||
cache_bytes, ANDROID_CE_TEXTURE_BYTES, cache_count);
|
||||
}
|
||||
|
||||
static void android_ce_texture_unlink(struct android_ce_texture *entry)
|
||||
{
|
||||
if (entry->older)
|
||||
entry->older->newer = entry->newer;
|
||||
else
|
||||
oldest = entry->newer;
|
||||
if (entry->newer)
|
||||
entry->newer->older = entry->older;
|
||||
else
|
||||
newest = entry->older;
|
||||
}
|
||||
|
||||
static void android_ce_texture_touch(struct android_ce_texture *entry)
|
||||
{
|
||||
if (entry != newest)
|
||||
{
|
||||
android_ce_texture_unlink(entry);
|
||||
entry->older = newest;
|
||||
entry->newer = NULL;
|
||||
if (newest)
|
||||
newest->newer = entry;
|
||||
else
|
||||
oldest = entry;
|
||||
newest = entry;
|
||||
}
|
||||
entry->frame = cache_frame;
|
||||
}
|
||||
|
||||
static void android_ce_texture_release(struct android_ce_texture *entry)
|
||||
{
|
||||
struct android_ce_texture **link;
|
||||
|
||||
/* Remove bindings and GPU copies before either address can be reused. */
|
||||
android_ce_texture_unbind(entry->header);
|
||||
android_ce_texture_gpu_forget(entry->header);
|
||||
halo_custom_edition_texels_channels(entry->pixels, 0);
|
||||
link = &bitmap_buckets[android_ce_texture_bucket(entry->bitmap)];
|
||||
while (*link != entry)
|
||||
link = &(*link)->bitmap_next;
|
||||
*link = entry->bitmap_next;
|
||||
link = &resource_buckets[android_ce_texture_bucket(entry->header)];
|
||||
while (*link != entry)
|
||||
link = &(*link)->resource_next;
|
||||
*link = entry->resource_next;
|
||||
android_ce_texture_unlink(entry);
|
||||
if (entry->bitmap->base_address == entry->pixels)
|
||||
entry->bitmap->base_address = NULL;
|
||||
cache_bytes -= entry->bytes;
|
||||
cache_count--;
|
||||
free(entry->pixels);
|
||||
free(entry);
|
||||
}
|
||||
|
||||
void android_ce_texture_delete(struct bitmap_data *bitmap)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
|
||||
for (entry = bitmap_buckets[android_ce_texture_bucket(bitmap)]; entry; entry = entry->bitmap_next)
|
||||
if (entry->bitmap == bitmap)
|
||||
{
|
||||
android_ce_texture_release(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int android_ce_texture_resident(const struct bitmap_data *bitmap)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
for (entry = bitmap_buckets[android_ce_texture_bucket(bitmap)]; entry; entry = entry->bitmap_next)
|
||||
if (entry->bitmap == bitmap)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void android_ce_texture_reset(void)
|
||||
{
|
||||
if (cache_count || cache_failed)
|
||||
android_ce_texture_report();
|
||||
while (oldest)
|
||||
android_ce_texture_release(oldest);
|
||||
cache_frame = cache_loads = cache_evictions = cache_failed = 0;
|
||||
cache_peak = 0;
|
||||
}
|
||||
|
||||
void android_ce_texture_idle(void)
|
||||
{
|
||||
/* Equality alone defines current-frame ownership. Avoid wrap aliasing. */
|
||||
if (++cache_frame == 0)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
for (entry = oldest; entry; entry = entry->newer)
|
||||
entry->frame = 0;
|
||||
cache_frame = 1;
|
||||
}
|
||||
}
|
||||
|
||||
const void *android_ce_texture_pixels(const void *resource, unsigned long *bytes)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
|
||||
for (entry = resource_buckets[android_ce_texture_bucket(resource)]; entry; entry = entry->resource_next)
|
||||
if (entry->header == resource)
|
||||
{
|
||||
*bytes = entry->bytes;
|
||||
return entry->pixels;
|
||||
}
|
||||
*bytes = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *android_ce_texture_get(struct bitmap_data *bitmap, unsigned long bytes,
|
||||
int load, android_ce_texture_load_proc read)
|
||||
{
|
||||
struct android_ce_texture *entry;
|
||||
unsigned long bucket;
|
||||
|
||||
if (!bitmap)
|
||||
return NULL;
|
||||
bucket = android_ce_texture_bucket(bitmap);
|
||||
for (entry = bitmap_buckets[bucket]; entry; entry = entry->bitmap_next)
|
||||
if (entry->bitmap == bitmap)
|
||||
{
|
||||
android_ce_texture_touch(entry);
|
||||
return entry->header;
|
||||
}
|
||||
if (!load)
|
||||
return NULL;
|
||||
if (!bytes || bytes > ANDROID_CE_TEXTURE_BYTES || !read)
|
||||
{
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
/* LRU order makes room without moving survivors. Preserve every entry
|
||||
* touched this frame, including headers already bound by earlier stages. */
|
||||
while (oldest && oldest->frame != cache_frame &&
|
||||
(cache_bytes > ANDROID_CE_TEXTURE_BYTES - bytes || cache_count == ANDROID_CE_TEXTURE_ENTRIES))
|
||||
{
|
||||
android_ce_texture_release(oldest);
|
||||
cache_evictions++;
|
||||
}
|
||||
if (cache_bytes > ANDROID_CE_TEXTURE_BYTES - bytes || cache_count == ANDROID_CE_TEXTURE_ENTRIES)
|
||||
{
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
entry = calloc(1, sizeof(*entry));
|
||||
if (!entry)
|
||||
{
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
entry->pixels = calloc(1, bytes);
|
||||
if (!entry->pixels)
|
||||
{
|
||||
free(entry);
|
||||
android_ce_texture_failed();
|
||||
return NULL;
|
||||
}
|
||||
entry->bitmap = bitmap;
|
||||
entry->bytes = bytes;
|
||||
bitmap->base_address = entry->pixels;
|
||||
read(bitmap, entry->header);
|
||||
/* A heap pointer is not an Xbox physical address. The renderer resolves
|
||||
* this header through the registry, with an allocation-length check. */
|
||||
entry->header[1] = (unsigned long)entry->pixels;
|
||||
entry->bitmap_next = bitmap_buckets[bucket];
|
||||
bitmap_buckets[bucket] = entry;
|
||||
bucket = android_ce_texture_bucket(entry->header);
|
||||
entry->resource_next = resource_buckets[bucket];
|
||||
resource_buckets[bucket] = entry;
|
||||
entry->older = newest;
|
||||
if (newest)
|
||||
newest->newer = entry;
|
||||
else
|
||||
oldest = entry;
|
||||
newest = entry;
|
||||
entry->frame = cache_frame;
|
||||
cache_bytes += bytes;
|
||||
cache_count++;
|
||||
cache_loads++;
|
||||
if (cache_bytes > cache_peak)
|
||||
cache_peak = cache_bytes;
|
||||
return entry->header;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Android CE's bounded, stable pixel storage, outside the Xbox window. */
|
||||
#ifndef ANDROID_CE_TEXTURE_CACHE_H
|
||||
#define ANDROID_CE_TEXTURE_CACHE_H
|
||||
|
||||
struct bitmap_data;
|
||||
typedef void (*android_ce_texture_load_proc)(struct bitmap_data *, void *);
|
||||
void *android_ce_texture_get(struct bitmap_data *bitmap, unsigned long bytes,
|
||||
int load, android_ce_texture_load_proc read);
|
||||
void android_ce_texture_delete(struct bitmap_data *bitmap);
|
||||
void android_ce_texture_reset(void);
|
||||
void android_ce_texture_idle(void);
|
||||
int android_ce_texture_resident(const struct bitmap_data *bitmap);
|
||||
|
||||
/* Only an exact registered header grants the renderer access to heap pixels.
|
||||
* Cached map pixels are filled synchronously before this header is published. */
|
||||
const void *android_ce_texture_pixels(const void *resource, unsigned long *bytes);
|
||||
void android_ce_texture_gpu_forget(const void *resource);
|
||||
void android_ce_texture_unbind(const void *resource);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
/* bots.h: computer players for local multiplayer games (port/linux/game/bots.c)
|
||||
|
||||
A bot is a player of a local (split screen) game whose controls come from
|
||||
code instead of a controller: it is in the lobby, the scores and the game's
|
||||
rules as any player is, spawns, respawns and scores. Each bot is the one
|
||||
player of a machine of its own at the top of the machine indices
|
||||
(BOTS_FIRST_MACHINE up), which no real machine takes: a split screen game has
|
||||
only its own machine. The bots have no view and no controller: nothing is
|
||||
drawn for them. */
|
||||
#ifndef HALO_BOTS_H
|
||||
#define HALO_BOTS_H
|
||||
|
||||
struct player_action;
|
||||
struct network_player;
|
||||
|
||||
/* the most bots in one game (with one player, the Xbox's 16) */
|
||||
#define BOTS_MAXIMUM 15
|
||||
/* the first bot's machine index (the last machine indices of the session) */
|
||||
#define BOTS_FIRST_MACHINE (HALO_PORT_MAXIMUM_NETWORK_MACHINES - BOTS_MAXIMUM)
|
||||
|
||||
enum
|
||||
{
|
||||
/* bots.teams: in a team game, the bots on both teams (evening them
|
||||
with the players), or all on the team the players are not on */
|
||||
_bots_teams_even = 0,
|
||||
_bots_teams_against,
|
||||
};
|
||||
|
||||
/* the settings (bots.count, bots.skill, bots.teams) */
|
||||
long bots_wanted_count(void);
|
||||
short bots_skill(void);
|
||||
short bots_teams(void);
|
||||
|
||||
/* a machine is a bot's */
|
||||
int bots_machine_is_bot(long machine_index);
|
||||
/* the network player for bot number `bot_index` (0 up): its machine,
|
||||
controller, name and no team or colour yet */
|
||||
void bots_network_player(long bot_index, struct network_player *player);
|
||||
|
||||
/* the game tick (players_update_before_game): every bot's controls this
|
||||
tick, into the actions of the players by their index; nothing outside a
|
||||
local game */
|
||||
void bots_update_actions(struct player_action *actions);
|
||||
|
||||
/* a map's start and end (players.c) */
|
||||
void bots_initialize_for_new_map(void);
|
||||
void bots_dispose_from_old_map(void);
|
||||
|
||||
#endif
|
||||
@@ -3572,6 +3572,8 @@ static struct custom_edition_behaviour_map
|
||||
} const custom_edition_behaviour_maps[] =
|
||||
{
|
||||
#include "custom_edition_behaviours.inc"
|
||||
/* Locally verified HUD data; not part of Chimera's generated list. */
|
||||
{ "bigass_open_v1.1", 0xD2BC19F7, BEHAVIOUR(hud_number_scale) | BEHAVIOUR(xbox_ammo_meter_channels) },
|
||||
};
|
||||
|
||||
#undef BEHAVIOUR
|
||||
@@ -3590,6 +3592,7 @@ static char const *const custom_edition_behaviour_names[NUMBER_OF_CUSTOM_EDITION
|
||||
"old_widescreen_fix",
|
||||
"gearbox_shader_environment_types",
|
||||
"block_multitexture_overlays",
|
||||
"xbox_ammo_meter_channels",
|
||||
};
|
||||
|
||||
/* the behaviours the map named `map_name` relies on, found as Chimera finds
|
||||
|
||||
@@ -252,6 +252,8 @@ enum custom_edition_channel_order
|
||||
where this build's meters take the fill order from color and discard
|
||||
what has no alpha */
|
||||
_custom_edition_channels_hud_meter,
|
||||
/* Authored Xbox-order meters, including sheets also used as artwork. */
|
||||
_custom_edition_channels_hud_meter_xbox,
|
||||
|
||||
NUMBER_OF_CUSTOM_EDITION_CHANNEL_ORDERS
|
||||
};
|
||||
@@ -281,6 +283,8 @@ enum custom_edition_behaviour
|
||||
_custom_edition_behaviour_gearbox_shader_environment_types,
|
||||
/* HUD multitexture overlays are not drawn (hud_draw.c) */
|
||||
_custom_edition_behaviour_block_multitexture_overlays,
|
||||
/* Bigass Open's ammo sheet has fill in color and shape in alpha. */
|
||||
_custom_edition_behaviour_xbox_ammo_meter_channels,
|
||||
|
||||
NUMBER_OF_CUSTOM_EDITION_BEHAVIOURS
|
||||
};
|
||||
|
||||
@@ -0,0 +1,329 @@
|
||||
/*
|
||||
COOP_PICKUPS.C
|
||||
|
||||
Server Setup's EXTRA PICKUPS (network.coop_pickups): weapons, grenades,
|
||||
health kits, overshields and camouflage placed by the campaign, grown by PER PLAYER
|
||||
(network.coop_enemies) or STATIC MULTIPLIER (network.coop_enemies_multiplier),
|
||||
to at most eight times their number. Fractions
|
||||
are distributed over placements of the same definition, rather than
|
||||
rounding every loose grenade up. Enemies' drops and inventory are not
|
||||
scenario placements and never enter here.
|
||||
|
||||
Only the host creates copies. A source's remaining count is kept in its
|
||||
item flags, alongside a placement identity and a copy marker, in the existing
|
||||
checkpoint image: no allocation or datum size changes. A revert restores
|
||||
them together; scripted recreation counts surviving copies against the budget.
|
||||
Copies are made once the source is connected to the current BSP, with
|
||||
ground, a clear bounding sphere and no wall between them and the source.
|
||||
No safe position means no copy; the level's originals are never moved.
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "items/equipment.h"
|
||||
#include "items/equipment_definitions.h"
|
||||
#include "items/items.h"
|
||||
#include "items/weapons.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "networking/network_game_manager.h"
|
||||
#include "objects/objects.h"
|
||||
#include "physics/collision_models.h"
|
||||
#include "physics/collisions.h"
|
||||
#include "scenario/scenario.h"
|
||||
#include "scenario/scenario_definitions.h"
|
||||
#include "coop_pickups.h"
|
||||
#include "coop_scaling.h"
|
||||
#include "network_coop.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
char const *config_string(char const *name);
|
||||
long config_integer(char const *name);
|
||||
/* collisions.c's: TRUE outside the BSP or when the sphere touches it */
|
||||
boolean collision_test_sphere(real_point3d const *center, real radius, long ignore_object_index);
|
||||
|
||||
enum
|
||||
{
|
||||
/* items.h uses bits 0..6. These three bits store 0..7 extras and are
|
||||
cleared before creating them; ordinary copies keep zero here. */
|
||||
PICKUPS_COUNT_SHIFT = 7,
|
||||
PICKUPS_COUNT_MASK = 7 << PICKUPS_COUNT_SHIFT,
|
||||
/* Saved provenance for scripted recreation: bit 10 marks copies,
|
||||
bits 11..25 identify the scenario placement (1..SHORT_MAX). */
|
||||
PICKUPS_COPY_FLAG = 1 << 10,
|
||||
PICKUPS_ID_SHIFT = 11,
|
||||
PICKUPS_ID_MASK = 0x7fff << PICKUPS_ID_SHIFT,
|
||||
PICKUPS_SOURCES_PER_TICK = 8,
|
||||
PICKUPS_RINGS = 5,
|
||||
PICKUPS_PLACES_PER_RING = 12,
|
||||
};
|
||||
|
||||
#define PICKUPS_COLLISION_FLAGS (FLAG(_collision_test_structure_bit) | FLAG(_collision_test_objects_bit) | \
|
||||
_collision_test_objects_sight_blocking_flags | FLAG(_collision_test_front_facing_surfaces_bit) | \
|
||||
FLAG(_collision_test_back_facing_surfaces_bit))
|
||||
|
||||
static boolean pickups_enabled;
|
||||
static short pickups_percent;
|
||||
static short pickups_multiplier;
|
||||
|
||||
static boolean pickups_host(void)
|
||||
{
|
||||
return pickups_enabled && game_connection() == _game_connection_network_server && network_coop_active();
|
||||
}
|
||||
|
||||
/* Incremental rounding gives a group of N placements exactly
|
||||
round(N * growth / 100) extras, up to 7*N. */
|
||||
static short pickups_extra_count(long ordinal, short players, short percent, short multiplier)
|
||||
{
|
||||
long growth;
|
||||
|
||||
if (ordinal < 1 || ordinal > SHORT_MAX)
|
||||
return 0;
|
||||
growth = multiplier > 0 ? (MIN(multiplier, COOP_SCALING_MAXIMUM_GROWTH) - 1) * 100 :
|
||||
coop_scaling_growth(players, percent);
|
||||
return (short)((ordinal * growth + 50) / 100 - ((ordinal - 1) * growth + 50) / 100);
|
||||
}
|
||||
|
||||
static short pickups_player_count(void)
|
||||
{
|
||||
struct network_game *game = network_game_get_game();
|
||||
short index, count = 0;
|
||||
|
||||
for (index = 0; game && index < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; index++)
|
||||
if (network_player_is_valid(&game->players[index]))
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
static boolean pickups_definition_allowed(long definition_index)
|
||||
{
|
||||
struct object_definition *definition = object_definition_get(definition_index);
|
||||
|
||||
if (definition->object.type == _object_type_weapon)
|
||||
return TRUE;
|
||||
if (definition->object.type == _object_type_equipment)
|
||||
{
|
||||
short type = equipment_definition_get(definition_index)->equipment.powerup_type;
|
||||
|
||||
return type == _equipment_powerup_grenade || type == _equipment_powerup_overshield ||
|
||||
type == _equipment_powerup_active_camouflage || type == _equipment_powerup_health;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Placement identity is the address in the scenario block, not a position
|
||||
that two items might share. Only earlier placements of this same tag
|
||||
contribute to fractional rounding. */
|
||||
static long pickups_ordinal(struct item_datum const *item, struct scenario_object_datum const *source,
|
||||
struct tag_block *palette, long *identity)
|
||||
{
|
||||
long element_size, index, ordinal = 0;
|
||||
struct tag_block *placements = scenario_get_object_type_scenario_datums(global_scenario_get(),
|
||||
item->object.type, &element_size);
|
||||
|
||||
for (index = 0; index < MIN(placements->count, SHORT_MAX); index++)
|
||||
{
|
||||
struct scenario_object_datum *entry = tag_block_get_element_with_size(placements, index, element_size);
|
||||
|
||||
if (VALID_INDEX(entry->palette_entry_index, palette->count) &&
|
||||
TAG_BLOCK_GET_ELEMENT(palette, entry->palette_entry_index, struct scenario_object_palette_entry)->reference.index ==
|
||||
item->definition_index)
|
||||
ordinal++;
|
||||
if (entry == source)
|
||||
{
|
||||
*identity = index + 1;
|
||||
return ordinal;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* A script may recreate a named supply. Surviving copies (even in an
|
||||
inventory) count against that placement's budget, rather than producing
|
||||
another complete set. Identity and provenance travel in saved item flags. */
|
||||
static short pickups_existing_copies(long definition_index, unsigned long identity)
|
||||
{
|
||||
struct object_iterator iterator;
|
||||
struct item_datum *item;
|
||||
short count = 0;
|
||||
|
||||
object_iterator_new(&iterator, _object_mask_weapon | _object_mask_equipment, 0);
|
||||
while ((item = object_iterator_next(&iterator)) != NULL)
|
||||
if (item->definition_index == definition_index && (item->item.flags & PICKUPS_COPY_FLAG) &&
|
||||
(item->item.flags & PICKUPS_ID_MASK) == identity && ++count >= COOP_SCALING_MAXIMUM_GROWTH - 1)
|
||||
break;
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Bounding spheres keep pickups apart. For large scenery bounds, test
|
||||
the collision mesh as well so a room-sized crate group does not exclude
|
||||
all otherwise free floor. */
|
||||
static boolean pickups_occupied(real_point3d const *center, real radius, long source_index)
|
||||
{
|
||||
struct location location;
|
||||
long indices[64];
|
||||
short count, index;
|
||||
|
||||
scenario_location_from_point(&location, center);
|
||||
if (location.leaf_index == NONE || location.cluster_index == NONE)
|
||||
return TRUE;
|
||||
count = objects_in_sphere(0, _object_mask_all & ~_object_mask_projectile, &location, center,
|
||||
radius + 0.04f, indices, NUMBEROF(indices));
|
||||
if (count == NUMBEROF(indices))
|
||||
return TRUE;
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
struct object_datum *object = object_get(indices[index]);
|
||||
real dx = object->object.bounding_sphere_center.x - center->x;
|
||||
real dy = object->object.bounding_sphere_center.y - center->y;
|
||||
real dz = object->object.bounding_sphere_center.z - center->z;
|
||||
real clearance = radius + object->object.bounding_sphere_radius + 0.04f;
|
||||
|
||||
if (object->object.parent_object_index != NONE || dx*dx + dy*dy + dz*dz >= clearance*clearance)
|
||||
continue;
|
||||
if (indices[index] != source_index && TEST_FLAG(_object_mask_sightblocking | _object_mask_device,
|
||||
object->object.type))
|
||||
{
|
||||
struct collision_model_instance instance;
|
||||
|
||||
if (collision_model_instance_new(&instance, indices[index]) &&
|
||||
!collision_model_test_sphere(&instance, center, radius + 0.04f))
|
||||
continue;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean pickups_position(long source_index, real_point3d const *origin, real radius,
|
||||
long attempt, real_point3d *center)
|
||||
{
|
||||
short ring = (short)(attempt / PICKUPS_PLACES_PER_RING);
|
||||
short place = (short)(attempt % PICKUPS_PLACES_PER_RING);
|
||||
real angle = ((real)place + 0.5f * (ring % 2)) * (_pi * 2.0f / PICKUPS_PLACES_PER_RING);
|
||||
real distance = (2.0f * radius + 0.15f) * (ring + 1);
|
||||
real_point3d from = *origin;
|
||||
real_point3d above;
|
||||
real_vector3d down = {0.0f, 0.0f, -2.0f};
|
||||
real_vector3d way;
|
||||
struct collision_result collision;
|
||||
|
||||
from.z += 0.75f;
|
||||
above = from;
|
||||
above.x += cosf(angle) * distance;
|
||||
above.y += sinf(angle) * distance;
|
||||
vector_from_points3d(&from, &above, &way);
|
||||
if (collision_test_vector(PICKUPS_COLLISION_FLAGS, &from, &way, source_index, &collision) ||
|
||||
!collision_test_vector(PICKUPS_COLLISION_FLAGS, &above, &down, source_index, &collision) ||
|
||||
collision.plane.n.k < 0.7f)
|
||||
return FALSE;
|
||||
*center = collision.point;
|
||||
center->z += radius + 0.04f;
|
||||
if (fabsf(center->z - origin->z) > 0.75f || collision_test_sphere(center, radius + 0.02f, source_index) ||
|
||||
pickups_occupied(center, radius, source_index))
|
||||
return FALSE;
|
||||
vector_from_points3d(origin, center, &way);
|
||||
return !collision_test_vector(PICKUPS_COLLISION_FLAGS, origin, &way, source_index, &collision);
|
||||
}
|
||||
|
||||
static void pickups_place(long source_index)
|
||||
{
|
||||
struct item_datum *source = item_get(source_index);
|
||||
struct object_placement_data placement;
|
||||
struct weapon_magazine magazines[2];
|
||||
real_point3d origin = source->object.bounding_sphere_center;
|
||||
real_vector3d offset;
|
||||
real radius = source->object.bounding_sphere_radius;
|
||||
short remaining = (short)((source->item.flags & PICKUPS_COUNT_MASK) >> PICKUPS_COUNT_SHIFT);
|
||||
short type = source->object.type;
|
||||
unsigned long identity = source->item.flags & PICKUPS_ID_MASK;
|
||||
long item_flags = source->item.flags & (FLAG(_item_does_not_accelerate_bit) | FLAG(_equipment_orient_to_ground_bit));
|
||||
long object_flags = source->object.flags & (FLAG(_object_cannot_be_garbage_bit) | FLAG(_object_shadowless_bit));
|
||||
long attempt;
|
||||
|
||||
/* Clear first, including invalid/no-space cases. This saved source can
|
||||
never amplify itself again; copies have no pending count. */
|
||||
source->item.flags &= ~PICKUPS_COUNT_MASK;
|
||||
remaining = (short)MAX(0, remaining - pickups_existing_copies(source->definition_index, identity));
|
||||
if (!remaining || !(radius > 0.0f && radius < 2.0f) || source->object.parent_object_index != NONE)
|
||||
return;
|
||||
vector_from_points3d(&source->object.position, &origin, &offset);
|
||||
object_placement_data_new(&placement, source->definition_index, NONE);
|
||||
placement.forward = source->object.forward;
|
||||
placement.up = source->object.up;
|
||||
placement.variant_number = source->object.forced_shader_permutation_index;
|
||||
csmemcpy(placement.change_colors, source->object.base_change_colors, sizeof(placement.change_colors));
|
||||
if (type == _object_type_weapon)
|
||||
csmemcpy(magazines, weapon_get(source_index)->weapon.magazines, sizeof(magazines));
|
||||
for (attempt = 0; remaining > 0 && attempt < PICKUPS_RINGS * PICKUPS_PLACES_PER_RING; attempt++)
|
||||
{
|
||||
real_point3d center;
|
||||
long copy_index;
|
||||
struct item_datum *copy;
|
||||
|
||||
/* Leave room for the campaign's actors and scripted objects. */
|
||||
if (object_header_data->actual_count >= MAXIMUM_OBJECTS_PER_MAP - 512)
|
||||
break;
|
||||
if (!pickups_position(source_index, &origin, radius, attempt, ¢er))
|
||||
continue;
|
||||
placement.position.x = center.x - offset.i;
|
||||
placement.position.y = center.y - offset.j;
|
||||
placement.position.z = center.z - offset.k;
|
||||
copy_index = object_new(&placement);
|
||||
if (copy_index == NONE)
|
||||
break;
|
||||
copy = item_get(copy_index);
|
||||
copy->item.flags |= item_flags | identity | PICKUPS_COPY_FLAG;
|
||||
copy->object.flags |= object_flags;
|
||||
if (type == _object_type_weapon)
|
||||
csmemcpy(weapon_get(copy_index)->weapon.magazines, magazines, sizeof(magazines));
|
||||
remaining--;
|
||||
}
|
||||
}
|
||||
|
||||
void coop_pickups_new_game(void)
|
||||
{
|
||||
char const *mode = config_string("network.coop_pickups");
|
||||
|
||||
pickups_enabled = !strcmp(mode, "per_player") || !strcmp(mode, "multiplier");
|
||||
pickups_percent = (short)PIN(config_integer("network.coop_enemies"), 25, 200);
|
||||
pickups_multiplier = !strcmp(mode, "multiplier") ?
|
||||
(short)PIN(config_integer("network.coop_enemies_multiplier"), 2, 32) : 0;
|
||||
}
|
||||
|
||||
void coop_pickups_register(long object_index, struct scenario_object_datum const *source, struct tag_block *palette)
|
||||
{
|
||||
struct item_datum *item;
|
||||
short extra;
|
||||
long identity = 0;
|
||||
|
||||
if (!pickups_host())
|
||||
return;
|
||||
item = item_try_and_get(object_index);
|
||||
if (!item || !pickups_definition_allowed(item->definition_index))
|
||||
return;
|
||||
extra = pickups_extra_count(pickups_ordinal(item, source, palette, &identity), pickups_player_count(),
|
||||
pickups_percent, pickups_multiplier);
|
||||
item->item.flags = (item->item.flags & ~(PICKUPS_COUNT_MASK | PICKUPS_ID_MASK | PICKUPS_COPY_FLAG)) |
|
||||
((unsigned long)extra << PICKUPS_COUNT_SHIFT) | ((unsigned long)identity << PICKUPS_ID_SHIFT);
|
||||
}
|
||||
|
||||
/* After the host's tick, outside object iteration/physics: object_new may
|
||||
compact the object pool. Gather indices before allocating any copies. */
|
||||
void coop_pickups_update(void)
|
||||
{
|
||||
struct object_iterator iterator;
|
||||
struct item_datum *item;
|
||||
long indices[PICKUPS_SOURCES_PER_TICK];
|
||||
short count = 0, index;
|
||||
|
||||
if (!pickups_host())
|
||||
return;
|
||||
object_iterator_new(&iterator, _object_mask_weapon | _object_mask_equipment, 0);
|
||||
while ((item = object_iterator_next(&iterator)) != NULL && count < NUMBEROF(indices))
|
||||
if ((item->item.flags & PICKUPS_COUNT_MASK) && TEST_FLAG(item->object.flags, _object_connected_to_map_bit) &&
|
||||
!TEST_FLAG(item->object.flags, _object_outside_of_map_bit))
|
||||
indices[count++] = iterator.index;
|
||||
for (index = 0; index < count; index++)
|
||||
pickups_place(indices[index]);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
COOP_PICKUPS.H
|
||||
|
||||
The co-op host's extra campaign pickups (coop_pickups.c).
|
||||
*/
|
||||
#ifndef __COOP_PICKUPS_H
|
||||
#define __COOP_PICKUPS_H
|
||||
|
||||
struct scenario_object_datum;
|
||||
struct tag_block;
|
||||
|
||||
void coop_pickups_new_game(void);
|
||||
void coop_pickups_register(long object_index, struct scenario_object_datum const *source, struct tag_block *palette);
|
||||
void coop_pickups_update(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
/* Shared per-player growth; the first player never adds growth. */
|
||||
#ifndef __COOP_SCALING_H
|
||||
#define __COOP_SCALING_H
|
||||
|
||||
enum { COOP_SCALING_MAXIMUM_GROWTH = 8 };
|
||||
|
||||
static inline long coop_scaling_growth(short players, short percent)
|
||||
{
|
||||
if (players <= 1 || percent <= 0)
|
||||
return 0;
|
||||
return MIN((long)MIN(percent, 200) *
|
||||
(MIN(players, HALO_PORT_MAXIMUM_NETWORK_PLAYERS) - 1),
|
||||
(COOP_SCALING_MAXIMUM_GROWTH - 1) * 100);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -103,33 +103,11 @@ boolean coop_scripts_any_player_will_do(
|
||||
return any;
|
||||
}
|
||||
|
||||
void coop_scripts_gather_in_volume(
|
||||
short trigger_volume_index,
|
||||
boolean coop_scripts_empty_player_list(
|
||||
long object_list_index)
|
||||
{
|
||||
long reference_index;
|
||||
long object_index;
|
||||
long inside_index = NONE;
|
||||
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE && inside_index == NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (scenario_trigger_volume_test_object(trigger_volume_index, object_index))
|
||||
inside_index = object_index;
|
||||
}
|
||||
if (inside_index == NONE)
|
||||
return;
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (!scenario_trigger_volume_test_object(trigger_volume_index, object_index))
|
||||
{
|
||||
player_teleport(player_index_from_unit_index(object_index), inside_index,
|
||||
&object_get(inside_index)->object.bounding_sphere_center);
|
||||
}
|
||||
}
|
||||
return coop_scripts_host() && (object_list_index == NONE ||
|
||||
(object_list_is_players(object_list_index) && object_list_count(object_list_index) == 0));
|
||||
}
|
||||
|
||||
/* the units of the players following player0, if `unit_index` is
|
||||
@@ -141,22 +119,29 @@ static short players_following(
|
||||
{
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
short position = 0;
|
||||
long players[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
short player_count = 0;
|
||||
short position;
|
||||
short count = 0;
|
||||
|
||||
if (unit_index == NONE || !coop_scripts_host())
|
||||
return 0;
|
||||
/* (in the order (players) lists them: player0 is the first with a unit) */
|
||||
/* hs_players adds each unit to the head of a reference list. Its
|
||||
player0 is the LAST live unit in datum order, not the first. Keep that
|
||||
same order here, including gaps left by dead or disconnected players. */
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = data_iterator_next(&iterator)) != NULL)
|
||||
{
|
||||
if (player->unit_index == NONE)
|
||||
continue;
|
||||
if (position == 0 && player->unit_index != unit_index)
|
||||
return 0;
|
||||
if (position >= NAMED_PLAYERS && count < maximum_count)
|
||||
unit_indices[count++] = player->unit_index;
|
||||
position++;
|
||||
if (player->unit_index != NONE && player_count < NUMBEROF(players))
|
||||
players[player_count++] = player->unit_index;
|
||||
}
|
||||
if (player_count == 0 || players[player_count - 1] != unit_index)
|
||||
return 0;
|
||||
for (position = player_count - NAMED_PLAYERS - 1;
|
||||
position >= 0 && count < maximum_count;
|
||||
position--)
|
||||
{
|
||||
unit_indices[count++] = players[position];
|
||||
}
|
||||
return count;
|
||||
}
|
||||
@@ -221,6 +206,70 @@ static boolean teleport_to(
|
||||
return arrived;
|
||||
}
|
||||
|
||||
/* A placement may fail after moving the unit, or find free ground outside
|
||||
this volume. Restore that unit before retrying; never move the loaded BSP.
|
||||
The second attempt uses the same crowd fallback as scripted teleports. */
|
||||
static void gather_player_in_volume(
|
||||
short trigger_volume_index,
|
||||
long unit_index,
|
||||
long anchor_index,
|
||||
real_point3d const *destination)
|
||||
{
|
||||
long player_index = player_index_from_unit_index(unit_index);
|
||||
real_point3d original;
|
||||
real_point3d placed;
|
||||
short attempt;
|
||||
|
||||
if (player_index == NONE)
|
||||
return;
|
||||
object_get_origin(unit_index, &original);
|
||||
for (attempt = 0; attempt < 2; attempt++)
|
||||
{
|
||||
boolean arrived = teleport_to(player_index, anchor_index, destination, attempt != 0);
|
||||
|
||||
if (arrived && scenario_trigger_volume_test_object(trigger_volume_index, unit_index) &&
|
||||
!player_position_switches_bsp(object_get_origin(unit_index, &placed)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* This was the unit's valid position at entry, on the same tick. */
|
||||
object_set_position(unit_index, &original, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void coop_scripts_gather_in_volume(
|
||||
short trigger_volume_index,
|
||||
long object_list_index)
|
||||
{
|
||||
long reference_index;
|
||||
long object_index;
|
||||
long inside_index = NONE;
|
||||
real_point3d destination;
|
||||
|
||||
if (!coop_scripts_host())
|
||||
return;
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (scenario_trigger_volume_test_object(trigger_volume_index, object_index) &&
|
||||
!player_position_switches_bsp(object_get_origin(object_index, &destination)))
|
||||
{
|
||||
inside_index = object_index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (inside_index == NONE)
|
||||
return;
|
||||
for (object_index = object_list_get_first(object_list_index, &reference_index);
|
||||
object_index != NONE;
|
||||
object_index = object_list_get_next(object_list_index, &reference_index))
|
||||
{
|
||||
if (!scenario_trigger_volume_test_object(trigger_volume_index, object_index))
|
||||
gather_player_in_volume(trigger_volume_index, object_index, inside_index, &destination);
|
||||
}
|
||||
}
|
||||
|
||||
boolean coop_scripts_unit_near(
|
||||
long unit_index,
|
||||
real_point3d const *destination)
|
||||
|
||||
@@ -16,9 +16,14 @@ Campaign scripts made to work for every player in network co-op
|
||||
list as inside once any of it is, because every object in it is a player */
|
||||
boolean coop_scripts_any_player_will_do(
|
||||
long object_list_index);
|
||||
/* An empty (players) result or failed list allocation cannot advance a
|
||||
co-op gate. Does not change valid empty AI lists or non-host behavior. */
|
||||
boolean coop_scripts_empty_player_list(
|
||||
long object_list_index);
|
||||
/* and when a script waits on it and one player is inside, the players of
|
||||
the list outside come beside that one, so a gate (the Maw's lift, the run
|
||||
to its bridge, a30's Pelicans) leaves no one behind */
|
||||
to its bridge, a30's Pelicans) leaves no one behind. The caller must test
|
||||
the volume again: a failed placement leaves the script waiting. */
|
||||
void coop_scripts_gather_in_volume(
|
||||
short trigger_volume_index,
|
||||
long object_list_index);
|
||||
|
||||
@@ -0,0 +1,338 @@
|
||||
/*
|
||||
COOP_VEHICLES.C
|
||||
|
||||
EXTRA VEHICLES: one replacement at the cleared starting place whenever a
|
||||
player clears the previous vehicle from the home, with a 15 percent buffer. Each authored placement
|
||||
has its own floor-rounded PER PLAYER budget or STATIC MULTIPLIER total;
|
||||
copies never register as new
|
||||
sources. Pelican cargo is anchored only after detaching and coming to rest.
|
||||
|
||||
The host alone makes ordinary networked objects. Keep full salted handles,
|
||||
never datum pointers across object_new (which can compact the object pool).
|
||||
The small home table follows in-memory campaign checkpoints through the
|
||||
save/load callbacks, without changing the game's saved allocations or datums.
|
||||
A disk/core load without a matching in-memory checkpoint forgets the table;
|
||||
it must not manufacture homes or budgets from coop_vehicle_homes in an unknown state.
|
||||
*/
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "game/players.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "networking/network_game_manager.h"
|
||||
#include "objects/objects.h"
|
||||
#include "physics/collisions.h"
|
||||
#include "physics/collision_models.h"
|
||||
#include "physics/physics_definitions.h"
|
||||
#include "scenario/scenario.h"
|
||||
#include "scenario/scenario_definitions.h"
|
||||
#include "units/vehicles.h"
|
||||
#include "units/vehicle_datum.h"
|
||||
#include "units/vehicle_definitions.h"
|
||||
#include "network_coop.h"
|
||||
#include "coop_vehicles.h"
|
||||
|
||||
char const *config_string(char const *name);
|
||||
long config_integer(char const *name);
|
||||
boolean collision_test_sphere(real_point3d const *center, real radius, long ignore_object_index);
|
||||
|
||||
/* vehicles.c's tag layout; the public header deliberately leaves it opaque. */
|
||||
struct coop_vehicle_definition
|
||||
{
|
||||
byte unused[0x2f4];
|
||||
short type;
|
||||
};
|
||||
typedef char coop_vehicle_type_offset_assert[
|
||||
offsetof(struct coop_vehicle_definition, type) == 0x2f4 ? 1 : -1];
|
||||
|
||||
enum { VEHICLE_HOMES = 256, VEHICLE_SETTLE_TICKS = 15 };
|
||||
#define VEHICLE_CLEARANCE 1.15f
|
||||
#define VEHICLE_SCALING_NUMERATOR 2
|
||||
#define VEHICLE_SCALING_DENOMINATOR 3
|
||||
#define VEHICLE_COLLISION_FLAGS (FLAG(_collision_test_structure_bit) | FLAG(_collision_test_objects_bit) | \
|
||||
_collision_test_objects_sight_blocking_flags | FLAG(_collision_test_front_facing_surfaces_bit) | \
|
||||
FLAG(_collision_test_back_facing_surfaces_bit))
|
||||
|
||||
struct coop_vehicle_home
|
||||
{
|
||||
struct scenario_object_datum const *source;
|
||||
long current;
|
||||
long definition;
|
||||
short copies;
|
||||
short settled;
|
||||
short bsp;
|
||||
boolean anchored;
|
||||
boolean entered;
|
||||
struct object_placement_data placement;
|
||||
real_point3d center;
|
||||
real radius;
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
short count;
|
||||
struct coop_vehicle_home homes[VEHICLE_HOMES];
|
||||
} coop_vehicle_homes, saved_vehicles;
|
||||
static boolean vehicles_enabled, saved_valid;
|
||||
static short vehicles_percent, vehicles_multiplier;
|
||||
static long saved_tick;
|
||||
|
||||
static boolean vehicles_host(void)
|
||||
{
|
||||
return vehicles_enabled && game_connection() == _game_connection_network_server && network_coop_active();
|
||||
}
|
||||
|
||||
/* Apply two-thirds extra growth in either mode, then round down. */
|
||||
static short vehicles_extra_count(short players, short percent, short multiplier)
|
||||
{
|
||||
return multiplier > 0 ? (short)((PIN(multiplier, 2, 32) - 1) * VEHICLE_SCALING_NUMERATOR / VEHICLE_SCALING_DENOMINATOR) :
|
||||
(short)(MAX(0, MIN(players, HALO_PORT_MAXIMUM_NETWORK_PLAYERS) - 1) *
|
||||
(long)PIN(percent, 25, 200) * VEHICLE_SCALING_NUMERATOR / (100 * VEHICLE_SCALING_DENOMINATOR));
|
||||
}
|
||||
|
||||
static short vehicles_player_count(void)
|
||||
{
|
||||
struct network_game *game = network_game_get_game();
|
||||
short index, count = 0;
|
||||
|
||||
for (index = 0; game && index < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; index++)
|
||||
if (network_player_is_valid(&game->players[index]))
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
static boolean vehicles_player_driving(long index, struct vehicle_datum const *vehicle)
|
||||
{
|
||||
struct unit_datum *driver = unit_try_and_get(vehicle->unit.driver_object_index);
|
||||
struct player_datum *player;
|
||||
|
||||
if (!driver || driver->object.parent_object_index != index || driver->unit.player_index == NONE)
|
||||
return FALSE;
|
||||
player = player_try_and_get(driver->unit.player_index);
|
||||
return player && player->unit_index == vehicle->unit.driver_object_index;
|
||||
}
|
||||
|
||||
/* Capture an unloaded, upright vehicle's resting pose, rather than a
|
||||
dropship's airborne authored placement. A ray below it must find ground. */
|
||||
static boolean vehicles_anchor(struct coop_vehicle_home *home, struct vehicle_datum const *vehicle)
|
||||
{
|
||||
real_point3d above = vehicle->object.position;
|
||||
real_vector3d down = {0.0f, 0.0f, -1.5f};
|
||||
real_vector3d const *speed = &vehicle->object.translational_velocity;
|
||||
struct collision_result hit;
|
||||
|
||||
if (vehicle->vehicle.airborne_ticks || vehicle->object.up.k < 0.5f || speed->i*speed->i + speed->j*speed->j + speed->k*speed->k > 0.0004f ||
|
||||
TEST_FLAG(vehicle->unit.flags, _unit_possessed_by_recording_bit))
|
||||
return FALSE;
|
||||
above.z += 0.2f;
|
||||
if (!collision_test_vector(VEHICLE_COLLISION_FLAGS, &above, &down, home->current, &hit) || hit.plane.n.k < 0.65f)
|
||||
return FALSE;
|
||||
object_placement_data_new(&home->placement, vehicle->definition_index, NONE);
|
||||
home->placement.position = vehicle->object.position;
|
||||
home->placement.forward = vehicle->object.forward;
|
||||
home->placement.up = vehicle->object.up;
|
||||
home->placement.variant_number = vehicle->object.variant_number;
|
||||
csmemcpy(home->placement.change_colors, vehicle->object.base_change_colors, sizeof(home->placement.change_colors));
|
||||
home->center = vehicle->object.bounding_sphere_center;
|
||||
home->radius = vehicle->object.bounding_sphere_radius;
|
||||
home->bsp = global_structure_bsp_index;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Use the physics mass points, not the vehicle's large bounding sphere
|
||||
(which normally intersects its own floor). Check their upper halves with
|
||||
a small lift above contact, and check nearby objects against their collision meshes.
|
||||
An obstructed pad is retried later, never replaced by a guessed nearby spot. */
|
||||
static boolean vehicles_home_clear(struct coop_vehicle_home const *home)
|
||||
{
|
||||
struct unit_definition *definition = vehicle_definition_get(home->definition);
|
||||
struct physics_definition *physics;
|
||||
struct location location;
|
||||
real_vector3d left;
|
||||
long indices[64];
|
||||
short index, count;
|
||||
|
||||
if (home->bsp != global_structure_bsp_index || definition->object.physics.index == NONE)
|
||||
return FALSE;
|
||||
scenario_location_from_point(&location, &home->center);
|
||||
if (location.leaf_index == NONE || location.cluster_index == NONE)
|
||||
return FALSE;
|
||||
count = objects_in_sphere(0, _object_mask_all & ~_object_mask_projectile, &location,
|
||||
&home->center, home->radius + 0.1f, indices, NUMBEROF(indices));
|
||||
if (count == NUMBEROF(indices))
|
||||
return FALSE;
|
||||
physics = physics_definition_get(definition->object.physics.index);
|
||||
if (physics->mass_points.count < 1 || physics->mass_points.count > MAXIMUM_MASS_POINTS_PER_PHYSICS)
|
||||
return FALSE;
|
||||
cross_product3d(&home->placement.up, &home->placement.forward, &left);
|
||||
for (index = 0; index < physics->mass_points.count; index++)
|
||||
{
|
||||
struct mass_point_definition const *point = TAG_BLOCK_GET_ELEMENT(&physics->mass_points, index, struct mass_point_definition);
|
||||
real_point3d center = home->placement.position;
|
||||
real radius = MAX(0.02f, point->radius * 0.5f);
|
||||
|
||||
center.x += home->placement.forward.i * point->position.x + left.i * point->position.y + home->placement.up.i * point->position.z;
|
||||
center.y += home->placement.forward.j * point->position.x + left.j * point->position.y + home->placement.up.j * point->position.z;
|
||||
center.z += home->placement.forward.k * point->position.x + left.k * point->position.y + home->placement.up.k * point->position.z + 0.1f;
|
||||
if (collision_test_sphere(¢er, radius, home->current))
|
||||
return FALSE;
|
||||
{
|
||||
short other;
|
||||
|
||||
for (other = 0; other < count; other++)
|
||||
{
|
||||
struct object_datum *object = object_get(indices[other]);
|
||||
struct collision_model_instance instance;
|
||||
real dx, dy, dz, clearance;
|
||||
|
||||
if (object->object.parent_object_index != NONE)
|
||||
continue;
|
||||
if (collision_model_instance_new(&instance, indices[other]))
|
||||
{
|
||||
if (!collision_model_test_sphere(&instance, ¢er, radius))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
dx = object->object.bounding_sphere_center.x - center.x;
|
||||
dy = object->object.bounding_sphere_center.y - center.y;
|
||||
dz = object->object.bounding_sphere_center.z - center.z;
|
||||
clearance = radius + object->object.bounding_sphere_radius;
|
||||
if (dx*dx + dy*dy + dz*dz >= clearance*clearance)
|
||||
continue;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void coop_vehicles_new_game(void)
|
||||
{
|
||||
char const *mode = config_string("network.coop_vehicles");
|
||||
|
||||
csmemset(&coop_vehicle_homes, 0, sizeof(coop_vehicle_homes));
|
||||
saved_valid = FALSE;
|
||||
vehicles_enabled = !strcmp(mode, "per_player") || !strcmp(mode, "multiplier");
|
||||
vehicles_percent = (short)PIN(config_integer("network.coop_enemies"), 25, 200);
|
||||
vehicles_multiplier = !strcmp(mode, "multiplier") ?
|
||||
(short)PIN(config_integer("network.coop_enemies_multiplier"), 2, 32) : 0;
|
||||
}
|
||||
|
||||
void coop_vehicles_register(long index, struct scenario_object_datum const *source)
|
||||
{
|
||||
struct vehicle_datum *vehicle;
|
||||
struct coop_vehicle_definition const *definition;
|
||||
struct coop_vehicle_home *home;
|
||||
short number;
|
||||
|
||||
if (!vehicles_host())
|
||||
return;
|
||||
vehicle = vehicle_datum_try_and_get(index);
|
||||
if (!vehicle)
|
||||
return;
|
||||
definition = (struct coop_vehicle_definition const *)vehicle_definition_get(vehicle->definition_index);
|
||||
/* Tanks, Warthogs, Ghosts and Banshees; no dropships or fixed turrets. */
|
||||
if (definition->type != 0 && definition->type != 1 && definition->type != 4 && definition->type != 5)
|
||||
return;
|
||||
for (number = 0; number < coop_vehicle_homes.count; number++)
|
||||
if (coop_vehicle_homes.homes[number].source == source)
|
||||
break;
|
||||
if (number == coop_vehicle_homes.count)
|
||||
{
|
||||
if (coop_vehicle_homes.count == VEHICLE_HOMES)
|
||||
return;
|
||||
coop_vehicle_homes.count++;
|
||||
}
|
||||
home = &coop_vehicle_homes.homes[number];
|
||||
/* Scripted recreation cannot reset the used budget or displace a copy. */
|
||||
if (home->source && vehicle_try_and_get(home->current))
|
||||
return;
|
||||
home->source = source;
|
||||
home->definition = vehicle->definition_index;
|
||||
home->current = index;
|
||||
home->settled = 0;
|
||||
home->anchored = home->entered = FALSE;
|
||||
}
|
||||
|
||||
void coop_vehicles_update(void)
|
||||
{
|
||||
short number, budget;
|
||||
|
||||
if (!vehicles_host())
|
||||
return;
|
||||
budget = vehicles_extra_count(vehicles_player_count(), vehicles_percent, vehicles_multiplier);
|
||||
for (number = 0; number < coop_vehicle_homes.count; number++)
|
||||
{
|
||||
struct coop_vehicle_home *home = &coop_vehicle_homes.homes[number];
|
||||
struct vehicle_datum *vehicle = vehicle_datum_try_and_get(home->current);
|
||||
real dx, dy, dz, clearance;
|
||||
long copy;
|
||||
struct object_placement_data placement;
|
||||
|
||||
if (!vehicle || vehicle->definition_index != home->definition ||
|
||||
TEST_FLAG(vehicle->object.damage_flags, _object_dead_bit))
|
||||
continue;
|
||||
if (vehicle->object.parent_object_index != NONE)
|
||||
{
|
||||
home->anchored = home->entered = FALSE;
|
||||
home->settled = 0;
|
||||
continue;
|
||||
}
|
||||
if (!TEST_FLAG(vehicle->object.flags, _object_connected_to_map_bit) ||
|
||||
TEST_FLAG(vehicle->object.flags, _object_outside_of_map_bit))
|
||||
continue;
|
||||
if (!home->anchored)
|
||||
{
|
||||
if (!vehicles_anchor(home, vehicle))
|
||||
home->settled = 0;
|
||||
else if (++home->settled >= VEHICLE_SETTLE_TICKS)
|
||||
home->anchored = TRUE;
|
||||
continue;
|
||||
}
|
||||
if (vehicles_player_driving(home->current, vehicle))
|
||||
home->entered = TRUE;
|
||||
if (!home->entered || home->copies >= budget || game_time_get() % 6)
|
||||
continue;
|
||||
/* Separate both bounding spheres, including a buffer, before
|
||||
checking the pad against the collision meshes. */
|
||||
clearance = (home->radius + vehicle->object.bounding_sphere_radius) * VEHICLE_CLEARANCE;
|
||||
dx = vehicle->object.bounding_sphere_center.x - home->center.x;
|
||||
dy = vehicle->object.bounding_sphere_center.y - home->center.y;
|
||||
dz = vehicle->object.bounding_sphere_center.z - home->center.z;
|
||||
if (dx*dx + dy*dy + dz*dz < clearance*clearance ||
|
||||
object_header_data->actual_count >= MAXIMUM_OBJECTS_PER_MAP - 512 || !vehicles_home_clear(home))
|
||||
continue;
|
||||
placement = home->placement;
|
||||
/* vehicle_new lifts physics objects by half their tag radius. */
|
||||
placement.position.z -= vehicle_definition_get(home->definition)->object.bounding_radius * 0.5f;
|
||||
copy = object_new(&placement);
|
||||
if (copy == NONE)
|
||||
continue;
|
||||
home->current = copy;
|
||||
home->copies++;
|
||||
home->entered = FALSE;
|
||||
/* Only one allocation per tick, outside object/physics iteration. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void coop_vehicles_before_save(void)
|
||||
{
|
||||
if (vehicles_host())
|
||||
{
|
||||
saved_vehicles = coop_vehicle_homes;
|
||||
saved_tick = game_time_get();
|
||||
saved_valid = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void coop_vehicles_after_load(void)
|
||||
{
|
||||
if (!vehicles_host())
|
||||
return;
|
||||
if (saved_valid && saved_tick == game_time_get())
|
||||
coop_vehicle_homes = saved_vehicles;
|
||||
else
|
||||
csmemset(&coop_vehicle_homes, 0, sizeof(coop_vehicle_homes));
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/* The host's optional campaign vehicle copies (coop_vehicles.c). */
|
||||
#ifndef __COOP_VEHICLES_H
|
||||
#define __COOP_VEHICLES_H
|
||||
|
||||
struct scenario_object_datum;
|
||||
void coop_vehicles_new_game(void);
|
||||
void coop_vehicles_register(long object_index, struct scenario_object_datum const *source);
|
||||
void coop_vehicles_update(void);
|
||||
void coop_vehicles_before_save(void);
|
||||
void coop_vehicles_after_load(void);
|
||||
|
||||
#endif
|
||||
@@ -197,6 +197,7 @@ struct reordered_bitmap
|
||||
struct custom_edition_bitmaps_globals
|
||||
{
|
||||
struct reordered_bitmap *reordered_bitmaps;
|
||||
unsigned long behaviours;
|
||||
long reordered_bitmap_count;
|
||||
long reordered_bitmap_capacity;
|
||||
};
|
||||
@@ -394,7 +395,9 @@ static boolean reordered_bitmap_mark(
|
||||
|
||||
if (index != NONE)
|
||||
{
|
||||
if (globals->reordered_bitmaps[index].channel_order != channel_order)
|
||||
if (globals->reordered_bitmaps[index].channel_order != channel_order &&
|
||||
!(globals->reordered_bitmaps[index].channel_order == _custom_edition_channels_hud_meter_xbox &&
|
||||
channel_order == NONE))
|
||||
{
|
||||
globals->reordered_bitmaps[index].drawn_otherwise = TRUE;
|
||||
}
|
||||
@@ -477,8 +480,16 @@ static boolean meter_bitmaps_mark(
|
||||
struct tag_view const *view,
|
||||
struct meter_hud_element_definition const *meter)
|
||||
{
|
||||
short order = _custom_edition_channels_hud_meter;
|
||||
|
||||
/* Open v1.1 changed this shared weapon sheet to Xbox channel order.
|
||||
Keep the explicit identity even when static elements use it too. */
|
||||
if ((custom_edition_bitmaps_globals.behaviours & (1UL << _custom_edition_behaviour_xbox_ammo_meter_channels)) &&
|
||||
!strcmp(view_tag_name(view, DATUM_INDEX_TO_ABSOLUTE_INDEX(meter->meter_bitmap.index)),
|
||||
"bourrin\\hud\\v3\\bitmaps\\all icons wips"))
|
||||
order = _custom_edition_channels_hud_meter_xbox;
|
||||
return reordered_bitmaps_mark(view, meter->meter_bitmap.index, meter->sequence_index,
|
||||
_custom_edition_channels_hud_meter);
|
||||
order);
|
||||
}
|
||||
|
||||
/* the bitmaps a HUD static element draws as they are */
|
||||
@@ -776,10 +787,12 @@ boolean custom_edition_bitmaps_verify(
|
||||
|
||||
boolean custom_edition_reordered_bitmaps_find(
|
||||
byte *tag_cache,
|
||||
unsigned long loaded_bytes)
|
||||
unsigned long loaded_bytes,
|
||||
unsigned long behaviours)
|
||||
{
|
||||
struct tag_view view;
|
||||
|
||||
custom_edition_bitmaps_globals.behaviours = behaviours;
|
||||
view.tag_cache = tag_cache;
|
||||
view.loaded_bytes = loaded_bytes;
|
||||
|
||||
@@ -824,6 +837,7 @@ void custom_edition_bitmaps_dispose(
|
||||
globals->reordered_bitmaps = NULL;
|
||||
globals->reordered_bitmap_count = 0;
|
||||
globals->reordered_bitmap_capacity = 0;
|
||||
globals->behaviours = 0;
|
||||
/* the pixels it was told of are the texture cache's to reuse */
|
||||
halo_custom_edition_texels_forget();
|
||||
|
||||
|
||||
@@ -375,6 +375,153 @@ static boolean custom_edition_resource_map_path(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* the locale resource map custom_edition_locale_open opened */
|
||||
static struct
|
||||
{
|
||||
boolean open;
|
||||
struct custom_edition_file file;
|
||||
struct resource_map map;
|
||||
} custom_edition_locale;
|
||||
|
||||
/* a unicode string list tag: its strings' block (count, address and
|
||||
definition), each element a tag_data of the string's UTF-16 characters
|
||||
(size, then the address 12 bytes in) */
|
||||
#define STRING_LIST_HEADER_BYTES 12
|
||||
#define STRING_LIST_ELEMENT_BYTES 20
|
||||
#define STRING_LIST_ELEMENT_ADDRESS_OFFSET 12
|
||||
#define STRING_LIST_MAXIMUM_COUNT 32767
|
||||
|
||||
boolean custom_edition_locale_open(
|
||||
void)
|
||||
{
|
||||
char path[MAP_PATH_SIZE];
|
||||
short folder;
|
||||
|
||||
custom_edition_locale_close();
|
||||
for (folder = 0; folder < NUMBER_OF_MAPS_FOLDERS; folder++)
|
||||
{
|
||||
if (maps_folder_has(maps_folder(folder), resource_map_type_describe(_resource_map_locale), MAP_FILE_EXTENSION, path))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (folder == NUMBER_OF_MAPS_FOLDERS || !custom_edition_file_open(&custom_edition_locale.file, path))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (resource_map_open(&custom_edition_locale.file.source, _resource_map_locale, &custom_edition_locale.map) !=
|
||||
_cache_file_status_ok)
|
||||
{
|
||||
error(_error_silent, "custom edition: '%s' is not a locale resource map", path);
|
||||
custom_edition_file_close(&custom_edition_locale.file);
|
||||
return FALSE;
|
||||
}
|
||||
custom_edition_locale.open = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void custom_edition_locale_close(
|
||||
void)
|
||||
{
|
||||
if (custom_edition_locale.open)
|
||||
{
|
||||
resource_map_close(&custom_edition_locale.map);
|
||||
custom_edition_file_close(&custom_edition_locale.file);
|
||||
custom_edition_locale.open = FALSE;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
struct custom_edition_string_list *custom_edition_locale_strings(
|
||||
char const *name)
|
||||
{
|
||||
struct resource_map const *map = &custom_edition_locale.map;
|
||||
struct resource_map_item const *item = NULL;
|
||||
struct custom_edition_string_list *list = NULL;
|
||||
byte *tag;
|
||||
int32_t count, index;
|
||||
uint32_t address, text_bytes = 0;
|
||||
unsigned short *characters;
|
||||
|
||||
for (index = 0; custom_edition_locale.open && index < map->item_count && !item; index++)
|
||||
{
|
||||
if (!csstrcasecmp(map->items[index].name, name))
|
||||
{
|
||||
item = &map->items[index];
|
||||
}
|
||||
}
|
||||
if (!item || item->size < STRING_LIST_HEADER_BYTES || !(tag = malloc(item->size)))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (!custom_edition_locale.file.source.read(custom_edition_locale.file.source.context, item->data_offset, item->size, tag))
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
/* (the tag's addresses count from its start; every string lies within
|
||||
it, so together they are no longer than it) */
|
||||
memcpy(&count, tag, sizeof(count));
|
||||
memcpy(&address, tag + sizeof(count), sizeof(address));
|
||||
if (count <= 0 || count > STRING_LIST_MAXIMUM_COUNT || address > item->size ||
|
||||
(uint32_t)count > (item->size - address) / STRING_LIST_ELEMENT_BYTES)
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
byte const *element = tag + address + (uint32_t)index * STRING_LIST_ELEMENT_BYTES;
|
||||
int32_t size;
|
||||
uint32_t data;
|
||||
|
||||
memcpy(&size, element, sizeof(size));
|
||||
memcpy(&data, element + STRING_LIST_ELEMENT_ADDRESS_OFFSET, sizeof(data));
|
||||
if (size < 0 || (size & 1) || data > item->size || (uint32_t)size > item->size - data ||
|
||||
(uint32_t)size > item->size - text_bytes)
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
text_bytes += (uint32_t)size;
|
||||
}
|
||||
/* one block: the list, its strings' addresses and lengths, then their
|
||||
characters, each terminated */
|
||||
list = malloc(sizeof(*list) + (size_t)count * (sizeof(*list->strings) + sizeof(*list->lengths)) +
|
||||
(size_t)text_bytes + (size_t)count * sizeof(unsigned short));
|
||||
if (!list)
|
||||
{
|
||||
goto done;
|
||||
}
|
||||
list->count = count;
|
||||
list->strings = (unsigned short const **)(list + 1);
|
||||
list->lengths = (long *)(list->strings + count);
|
||||
characters = (unsigned short *)(list->lengths + count);
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
byte const *element = tag + address + (uint32_t)index * STRING_LIST_ELEMENT_BYTES;
|
||||
int32_t size;
|
||||
uint32_t data;
|
||||
long length;
|
||||
|
||||
memcpy(&size, element, sizeof(size));
|
||||
memcpy(&data, element + STRING_LIST_ELEMENT_ADDRESS_OFFSET, sizeof(data));
|
||||
memcpy(characters, tag + data, (size_t)size);
|
||||
length = size / 2;
|
||||
if (!length || characters[length - 1])
|
||||
{
|
||||
characters[length++] = 0;
|
||||
}
|
||||
list->strings[index] = characters;
|
||||
list->lengths[index] = length;
|
||||
characters += length;
|
||||
}
|
||||
|
||||
done:
|
||||
free(tag);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
static void custom_edition_cache_files_close(
|
||||
void)
|
||||
{
|
||||
@@ -449,6 +596,14 @@ static void custom_edition_behaviours_log(
|
||||
{
|
||||
if (!((behaviours >> behaviour) & 1))
|
||||
continue;
|
||||
if (behaviour == _custom_edition_behaviour_gearbox_meters ||
|
||||
behaviour == _custom_edition_behaviour_old_widescreen_fix)
|
||||
{
|
||||
error(_error_silent,
|
||||
"custom edition: relies on Halo PC's %s (Chimera's map list), partially supported (HUD tint/warning placement)",
|
||||
custom_edition_behaviour_name(behaviour));
|
||||
continue;
|
||||
}
|
||||
error(
|
||||
_error_silent,
|
||||
(FOLLOWED_BEHAVIOURS >> behaviour) & 1 ?
|
||||
@@ -595,7 +750,7 @@ static boolean custom_edition_cache_tags_convert(
|
||||
|
||||
return custom_edition_cache_tags_validate(tag_cache, report) &&
|
||||
custom_edition_bitmaps_verify(tag_cache, loaded_bytes) &&
|
||||
custom_edition_reordered_bitmaps_find(tag_cache, loaded_bytes) &&
|
||||
custom_edition_reordered_bitmaps_find(tag_cache, loaded_bytes, custom_edition_cache_globals.behaviours) &&
|
||||
custom_edition_scripts_convert(tag_cache, loaded_bytes) &&
|
||||
custom_edition_cache_models_convert(tag_cache, report);
|
||||
}
|
||||
@@ -1126,6 +1281,12 @@ void custom_edition_cache_tags_unload(
|
||||
return;
|
||||
}
|
||||
|
||||
struct resource_map const *custom_edition_cache_bitmap_resources(void)
|
||||
{
|
||||
return custom_edition_cache_tags_loaded() ?
|
||||
custom_edition_cache_globals.resource_maps[_resource_map_bitmaps] : NULL;
|
||||
}
|
||||
|
||||
void custom_edition_cache_read(
|
||||
long tag_index,
|
||||
long offset,
|
||||
|
||||
@@ -57,6 +57,9 @@ Custom Edition map is loaded. */
|
||||
boolean custom_edition_cache_stock_tag(
|
||||
long tag_index);
|
||||
|
||||
/* Borrowed until map unload; reads remain bounds checked by the source. */
|
||||
struct resource_map const *custom_edition_cache_bitmap_resources(void);
|
||||
|
||||
/* When `header` (CACHE_FILE_HEADER_BYTES bytes, with `build` its build
|
||||
string field) is a Custom Edition cache header that reached the Xbox loader,
|
||||
logs why the file at `path` cannot run and returns TRUE: the map is refused,
|
||||
@@ -158,6 +161,27 @@ struct cache_file_tag_header *custom_edition_cache_tags_load(
|
||||
(paths.custom_edition) */
|
||||
boolean custom_edition_install_present(
|
||||
void);
|
||||
|
||||
/* The locale resource map (loc.map) of the maps folders, which holds the
|
||||
text of the Custom Edition the maps come from, in its language: opened (FALSE
|
||||
if there is none, or it is not one) until custom_edition_locale_close. */
|
||||
boolean custom_edition_locale_open(
|
||||
void);
|
||||
void custom_edition_locale_close(
|
||||
void);
|
||||
/* The strings of its unicode string list tag `name` (as
|
||||
"ui\\shell\\main_menu\\..."): each string's UTF-16 characters, its
|
||||
terminator included, lengths[index] of them from strings[index]. One
|
||||
block, released with free(); NULL if it holds no such list, or one that
|
||||
does not fit in its tag. */
|
||||
struct custom_edition_string_list
|
||||
{
|
||||
long count;
|
||||
unsigned short const **strings;
|
||||
long *lengths;
|
||||
};
|
||||
struct custom_edition_string_list *custom_edition_locale_strings(
|
||||
char const *name);
|
||||
boolean custom_edition_cache_tags_loaded(
|
||||
void);
|
||||
/* Whether the structure bsp reference (of the loaded map's scenario) names
|
||||
@@ -200,7 +224,8 @@ FALSE after logging why it cannot. custom_edition_bitmaps_dispose forgets
|
||||
them either way. */
|
||||
boolean custom_edition_reordered_bitmaps_find(
|
||||
byte *tag_cache,
|
||||
unsigned long loaded_bytes);
|
||||
unsigned long loaded_bytes,
|
||||
unsigned long behaviours);
|
||||
/* As custom_edition_reordered_bitmaps_find, in the loaded map's tags, which
|
||||
the validator has checked: for the bitmaps of mods (mod_bitmaps.c), Halo
|
||||
PC's on any map. FALSE after logging why it cannot. */
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* CE warning graphics use crosshair states but are not aiming reticles. */
|
||||
#ifndef CUSTOM_EDITION_HUD_H
|
||||
#define CUSTOM_EDITION_HUD_H
|
||||
#include "cache_file_formats.h"
|
||||
#include "custom_edition_cache.h"
|
||||
|
||||
static boolean custom_edition_hud_warning(short state)
|
||||
{
|
||||
return custom_edition_cache_tags_loaded() &&
|
||||
((state >= 3 && state <= 15) || state == 18);
|
||||
}
|
||||
|
||||
/* Legacy HUDs placed warnings beside corner panels using offsets from a
|
||||
* 640x480 canvas center with PC's 8-pixel HUD margins (Chimera's
|
||||
* hud_bitmap_scale.hpp). Translate to the current title-safe frame, just
|
||||
* as the corner panels do. Centered warnings remain centered. */
|
||||
static void custom_edition_hud_warning_placement(short state, short width, short height,
|
||||
struct hud_placement_definition *placement)
|
||||
{
|
||||
long extra;
|
||||
if (!custom_edition_hud_warning(state) ||
|
||||
!custom_edition_cache_relies_on(_custom_edition_behaviour_old_widescreen_fix))
|
||||
return;
|
||||
extra = (width - 624) / 2;
|
||||
if (placement->offset.x > 0)
|
||||
placement->offset.x = (short)PIN(placement->offset.x + extra, SHORT_MIN, SHORT_MAX);
|
||||
else if (placement->offset.x < 0)
|
||||
placement->offset.x = (short)PIN(placement->offset.x - extra, SHORT_MIN, SHORT_MAX);
|
||||
extra = (height - 464) / 2;
|
||||
if (placement->offset.y > 0)
|
||||
placement->offset.y = (short)PIN(placement->offset.y + extra, SHORT_MIN, SHORT_MAX);
|
||||
else if (placement->offset.y < 0)
|
||||
placement->offset.y = (short)PIN(placement->offset.y - extra, SHORT_MIN, SHORT_MAX);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,118 @@
|
||||
/* Original controller sprites for CE maps whose messaging sheet holds weapons.
|
||||
* Resource tag addresses are offsets into that item, not engine pointers. */
|
||||
#ifndef CUSTOM_EDITION_HUD_BUTTONS_H
|
||||
#define CUSTOM_EDITION_HUD_BUTTONS_H
|
||||
#include "cache_file_formats.h"
|
||||
#include "custom_edition_cache.h"
|
||||
#include "interface/hud_draw.h"
|
||||
|
||||
static struct
|
||||
{
|
||||
byte tag[8192];
|
||||
unsigned long size;
|
||||
struct bitmap_data *bitmaps[2];
|
||||
boolean attempted;
|
||||
} ce_hud_buttons;
|
||||
|
||||
static unsigned long ce_hud_button_u32(byte const *p)
|
||||
{
|
||||
return (unsigned long)p[0] | ((unsigned long)p[1] << 8) |
|
||||
((unsigned long)p[2] << 16) | ((unsigned long)p[3] << 24);
|
||||
}
|
||||
|
||||
static byte const *ce_hud_button_range(unsigned long offset, unsigned long count, unsigned long stride)
|
||||
{
|
||||
if (offset > ce_hud_buttons.size || count > (ce_hud_buttons.size - offset) / stride)
|
||||
return NULL;
|
||||
return ce_hud_buttons.tag + offset;
|
||||
}
|
||||
|
||||
static void ce_hud_buttons_forget(void)
|
||||
{
|
||||
short i;
|
||||
for (i = 0; i < 2; i++)
|
||||
if (ce_hud_buttons.bitmaps[i]) bitmap_delete(ce_hud_buttons.bitmaps[i]);
|
||||
csmemset(&ce_hud_buttons, 0, sizeof(ce_hud_buttons));
|
||||
}
|
||||
|
||||
static boolean ce_hud_button_draw(struct icon_hud_element_definition const *icon,
|
||||
rectangle2d *cursor, pixel32 color)
|
||||
{
|
||||
struct resource_map const *resources = custom_edition_cache_bitmap_resources();
|
||||
byte const *sequences, *sequence, *sprites, *data;
|
||||
struct bitmap_group_sprite sprite;
|
||||
struct bitmap_data *bitmap;
|
||||
unsigned long count, frame, bitmap_index, offset, bytes;
|
||||
long i;
|
||||
real viewport, scale, width, height;
|
||||
point2d point;
|
||||
if (!resources) return FALSE;
|
||||
if (!ce_hud_buttons.attempted)
|
||||
{
|
||||
ce_hud_buttons.attempted = TRUE;
|
||||
for (i = 0; i < resources->item_count; i++)
|
||||
{
|
||||
struct resource_map_item const *item = &resources->items[i];
|
||||
if (strcmp(item->name, "ui\\hud\\bitmaps\\hud_msg_icons_sm")) continue;
|
||||
if (item->size >= 108 && item->size <= sizeof(ce_hud_buttons.tag) &&
|
||||
resources->source->read(resources->source->context, item->data_offset,
|
||||
item->size, ce_hud_buttons.tag)) ce_hud_buttons.size = item->size;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ce_hud_buttons.size || icon->sequence_index < 0) return FALSE;
|
||||
count = ce_hud_button_u32(ce_hud_buttons.tag + 84);
|
||||
sequences = ce_hud_button_range(ce_hud_button_u32(ce_hud_buttons.tag + 88), count, 64);
|
||||
if (!sequences || (unsigned long)icon->sequence_index >= count) return FALSE;
|
||||
sequence = sequences + icon->sequence_index * 64;
|
||||
count = ce_hud_button_u32(sequence + 52);
|
||||
sprites = ce_hud_button_range(ce_hud_button_u32(sequence + 56), count, 32);
|
||||
if (!sprites || !count) return FALSE;
|
||||
frame = icon->frame_rate > 0 ? (unsigned long)(game_time_get() / icon->frame_rate) % count : 0;
|
||||
csmemcpy(&sprite, sprites + frame * 32, sizeof(sprite));
|
||||
if (!(sprite.bounds.x0 >= 0 && sprite.bounds.x1 <= 1 && sprite.bounds.x1 > sprite.bounds.x0 &&
|
||||
sprite.bounds.y0 >= 0 && sprite.bounds.y1 <= 1 && sprite.bounds.y1 > sprite.bounds.y0)) return FALSE;
|
||||
bitmap_index = (unsigned long)sprite.bitmap_index;
|
||||
count = ce_hud_button_u32(ce_hud_buttons.tag + 96);
|
||||
data = ce_hud_button_range(ce_hud_button_u32(ce_hud_buttons.tag + 100), count, 48);
|
||||
if (!data || bitmap_index >= count || bitmap_index >= 2) return FALSE;
|
||||
data += bitmap_index * 48;
|
||||
/* The stock controller sheet is two 128-square, linear ARGB images.
|
||||
* Refuse other layouts rather than interpreting custom resource data. */
|
||||
if (ce_hud_button_u32(data + 4) != 0x00800080 ||
|
||||
ce_hud_button_u32(data + 8) != 1 || (data[12] != 11 || data[13]) ||
|
||||
(data[14] & (2 | 4 | 8 | 16))) return FALSE;
|
||||
bitmap = ce_hud_buttons.bitmaps[bitmap_index];
|
||||
if (!bitmap)
|
||||
{
|
||||
offset = ce_hud_button_u32(data + 24);
|
||||
bytes = ce_hud_button_u32(data + 28);
|
||||
if (bytes < 65536 || offset > resources->source->size ||
|
||||
65536 > resources->source->size - offset) return FALSE;
|
||||
bitmap = bitmap_2d_new(128, 128, 0, 11);
|
||||
if (!bitmap) return FALSE;
|
||||
if (!bitmap->base_address || !resources->source->read(resources->source->context,
|
||||
offset, 65536, bitmap->base_address) || !rasterizer_bitmap_new(bitmap))
|
||||
{
|
||||
bitmap_delete(bitmap);
|
||||
return FALSE;
|
||||
}
|
||||
rasterizer_bitmap_changed(bitmap);
|
||||
ce_hud_buttons.bitmaps[bitmap_index] = bitmap;
|
||||
}
|
||||
/* Match the native gameplay face's 26-pixel height: the CE resource
|
||||
* uses 20-pixel faces. Align to the active font's capitals, not the
|
||||
* stock font's baseline offsets. Keep all sprite proportions/frames. */
|
||||
viewport = local_player_count() > 1 ? 0.75f : 1.0f;
|
||||
scale = viewport * (26.0f / 20.0f);
|
||||
width = (sprite.bounds.x1 - sprite.bounds.x0) * bitmap->width * scale;
|
||||
height = (sprite.bounds.y1 - sprite.bounds.y0) * bitmap->height * scale;
|
||||
point.x = (short)(cursor->x0 + 4.0f * viewport);
|
||||
point.y = (short)(draw_unicode_string_capital_middle(cursor, L"") + height * 0.5f);
|
||||
hud_draw_bitmap_direct(bitmap, _hud_anchor_bottom_left, &point, &sprite.bounds,
|
||||
scale, 0.0f, icon->flags & 2 ? icon->color : color, FALSE);
|
||||
/* The following text run supplies its own three-pixel leading inset. */
|
||||
cursor->x0 = (short)(point.x + width - 3.0f * viewport);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,431 @@
|
||||
/*
|
||||
GAME_MODES.C
|
||||
|
||||
OpenCE's gametypes: SWAT, Infection and Gun Game, modes of Slayer, and
|
||||
Hardcore, rules over any game engine's. Which a gametype plays is in its PC
|
||||
options (game_engine.h's struct game_variant_options, from mode on), which a
|
||||
saved gametype keeps (playlist_profile.c), the network game carries to every
|
||||
machine (network_game_manager.h) and the game plays by
|
||||
(game_variant_options_get).
|
||||
|
||||
- SWAT: no shields, and a shot to the head of any weapon kills (damage.c).
|
||||
Its built-in gametype starts everyone with a pistol and an assault rifle,
|
||||
with no weapons on the map, no grenades and no motion sensor.
|
||||
- Infection (infection.c): on teams. Humans are red, zombies blue; the host
|
||||
chooses the first zombies after a countdown, a human killed joins them, and
|
||||
the zombies win when no human is left, the humans when the time runs out.
|
||||
- Gun Game (gun_game.c): free for all. Each kill gives the killer the next
|
||||
weapon of a list; a kill with the last wins.
|
||||
- Hardcore: no motion sensor, no aim assist, and a kill restores the
|
||||
killer's health and shields.
|
||||
|
||||
The built-in gametypes (game_modes_gametype) are written with the Xbox's
|
||||
default ones, after them, and the Select Gametype screen lists them in a bank
|
||||
of their own (menu_functions.c's OPENCE).
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_engine.h"
|
||||
#include "game/game_engine_playlist.h"
|
||||
#include "game/players.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "objects/objects.h"
|
||||
#include "units/units.h"
|
||||
#include "game_modes.h"
|
||||
#include "gun_game.h"
|
||||
#include "infection.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* game_engine.c's values of the variant's (its enums goal_radar,
|
||||
game_engine_weapons and game_engine_vehicles) */
|
||||
enum
|
||||
{
|
||||
GOAL_RADAR_NAV_POINT = 1,
|
||||
WEAPON_SET_NO_GRENADES = 10,
|
||||
VEHICLE_SET_NONE = 1
|
||||
};
|
||||
|
||||
/* Infection's options when a gametype has none (game_modes_options_sanitize) */
|
||||
enum
|
||||
{
|
||||
INFECTION_DEFAULT_INITIAL_ZOMBIES = 1,
|
||||
INFECTION_DEFAULT_ZOMBIE_SPEED = 150,
|
||||
INFECTION_DEFAULT_SKULL_DAMAGE = 200,
|
||||
INFECTION_DEFAULT_RESPAWN_TIME = 5,
|
||||
INFECTION_DEFAULT_COUNTDOWN = 10
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
_gametype_swat = 0,
|
||||
_gametype_infection,
|
||||
_gametype_gun_game,
|
||||
_gametype_hardcore_slayer,
|
||||
_gametype_hardcore_ctf,
|
||||
_gametype_hardcore_oddball,
|
||||
_gametype_hardcore_king,
|
||||
NUMBER_OF_GAMETYPES
|
||||
};
|
||||
|
||||
static struct
|
||||
{
|
||||
/* debug.network_test's */
|
||||
char const *name;
|
||||
/* the gametype lists' */
|
||||
wchar_t const *display_name;
|
||||
/* the variant's own (11 characters at most: the lobby's and the server
|
||||
browser's) */
|
||||
wchar_t const *variant_name;
|
||||
} const game_modes_gametypes[NUMBER_OF_GAMETYPES] =
|
||||
{
|
||||
{ "swat", L"SWAT", L"SWAT" },
|
||||
{ "infection", L"Infection", L"Infection" },
|
||||
{ "gun_game", L"Gun Game", L"Gun Game" },
|
||||
{ "hardcore", L"Hardcore Slayer", L"Hardcore" },
|
||||
{ "hardcore_ctf", L"Hardcore CTF", L"HC CTF" },
|
||||
{ "hardcore_oddball", L"Hardcore Oddball", L"HC Oddball" },
|
||||
{ "hardcore_king", L"Hardcore King", L"HC King" },
|
||||
};
|
||||
|
||||
/* the kill being recorded is a melee's (game_modes_kill_by_melee) */
|
||||
static boolean game_modes_melee_kill;
|
||||
|
||||
/* ---- the built-in gametypes */
|
||||
|
||||
short game_modes_gametype_count(
|
||||
void)
|
||||
{
|
||||
return NUMBER_OF_GAMETYPES;
|
||||
}
|
||||
|
||||
wchar_t const *game_modes_gametype_name(
|
||||
short index)
|
||||
{
|
||||
return VALID_INDEX(index, NUMBER_OF_GAMETYPES) ? game_modes_gametypes[index].display_name : L"";
|
||||
}
|
||||
|
||||
/* a variant without a motion sensor: no players on it, and a goal (a flag,
|
||||
the ball, the hill) shown by its nav point instead */
|
||||
static void game_modes_no_motion_sensor(
|
||||
struct game_variant *variant,
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_draw_object_in_motion_sensor_bit, FALSE);
|
||||
variant->universal_variant.goal_radar = GOAL_RADAR_NAV_POINT;
|
||||
options->radar_players = _radar_players_none;
|
||||
}
|
||||
|
||||
void game_modes_gametype(
|
||||
short index,
|
||||
struct game_variant *variant,
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
struct game_variant temporary;
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case _gametype_hardcore_ctf:
|
||||
*variant = *build_game_variant_ctf(&temporary);
|
||||
break;
|
||||
case _gametype_hardcore_oddball:
|
||||
*variant = *build_game_variant_team_oddball(&temporary);
|
||||
break;
|
||||
case _gametype_hardcore_king:
|
||||
*variant = *build_game_variant_team_king(&temporary);
|
||||
break;
|
||||
case _gametype_gun_game:
|
||||
*variant = *build_game_variant_slayer(&temporary);
|
||||
break;
|
||||
default:
|
||||
*variant = *build_game_variant_team_slayer(&temporary);
|
||||
break;
|
||||
}
|
||||
game_variant_options_default(variant, options);
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case _gametype_swat:
|
||||
options->mode = _game_mode_swat;
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_no_shields_bit, TRUE);
|
||||
variant->universal_variant.weapon_set = WEAPON_SET_NO_GRENADES;
|
||||
variant->universal_variant.vehicle_set = VEHICLE_SET_NONE;
|
||||
variant->universal_variant.respawn_time = 150;
|
||||
game_modes_no_motion_sensor(variant, options);
|
||||
options->loadout = _loadout_custom;
|
||||
options->primary_weapon = _loadout_weapon_pistol;
|
||||
options->secondary_weapon = _loadout_weapon_assault_rifle;
|
||||
options->no_map_weapons = TRUE;
|
||||
break;
|
||||
case _gametype_infection:
|
||||
options->mode = _game_mode_infection;
|
||||
variant->universal_variant.vehicle_set = VEHICLE_SET_NONE;
|
||||
variant->universal_variant.respawn_time = INFECTION_DEFAULT_RESPAWN_TIME * TICKS_PER_SECOND;
|
||||
variant->universal_variant.suicide_penalty = 0;
|
||||
options->time_limit = 5;
|
||||
options->friendly_fire = _friendly_fire_off;
|
||||
break;
|
||||
case _gametype_gun_game:
|
||||
options->mode = _game_mode_gun_game;
|
||||
variant->universal_variant.weapon_set = WEAPON_SET_NO_GRENADES;
|
||||
variant->universal_variant.vehicle_set = VEHICLE_SET_NONE;
|
||||
variant->universal_variant.respawn_time = 90;
|
||||
variant->universal_variant.suicide_penalty = 0;
|
||||
options->no_map_weapons = TRUE;
|
||||
break;
|
||||
default:
|
||||
options->hardcore = TRUE;
|
||||
options->friendly_fire = _friendly_fire_on;
|
||||
game_modes_no_motion_sensor(variant, options);
|
||||
break;
|
||||
}
|
||||
/* (each team's vehicles the variant's, as game_variant_options_default
|
||||
gives them) */
|
||||
options->vehicle_set[0] = options->vehicle_set[1] = (byte)variant->universal_variant.vehicle_set;
|
||||
game_modes_options_sanitize(options);
|
||||
csmemset(variant->human_readable_game_description, 0, sizeof(variant->human_readable_game_description));
|
||||
if (VALID_INDEX(index, NUMBER_OF_GAMETYPES))
|
||||
{
|
||||
ustrncpy(variant->human_readable_game_description, game_modes_gametypes[index].variant_name,
|
||||
NUMBEROF(variant->human_readable_game_description) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
boolean game_modes_gametype_by_name(
|
||||
char const *name,
|
||||
struct game_variant *variant,
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
short index;
|
||||
|
||||
for (index = 0; index < NUMBER_OF_GAMETYPES; index++)
|
||||
{
|
||||
if (!strcmp(name, game_modes_gametypes[index].name))
|
||||
{
|
||||
game_modes_gametype(index, variant, options);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ---- a gametype's options */
|
||||
|
||||
void game_modes_options_default(
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
options->mode = _game_mode_none;
|
||||
options->hardcore = FALSE;
|
||||
options->infection_initial_zombies = INFECTION_DEFAULT_INITIAL_ZOMBIES;
|
||||
options->infection_zombie_speed = INFECTION_DEFAULT_ZOMBIE_SPEED;
|
||||
options->infection_skull_damage = INFECTION_DEFAULT_SKULL_DAMAGE;
|
||||
options->infection_respawn_time = INFECTION_DEFAULT_RESPAWN_TIME;
|
||||
options->infection_countdown = INFECTION_DEFAULT_COUNTDOWN;
|
||||
options->infection_zombie_shields = TRUE;
|
||||
options->gun_game_order = _gun_game_order_strongest_first;
|
||||
options->gun_game_melee_demotes = TRUE;
|
||||
csmemset(options->reserved, 0, sizeof(options->reserved));
|
||||
}
|
||||
|
||||
/* a byte option within its range, else its default */
|
||||
static byte game_modes_option(
|
||||
byte value,
|
||||
byte minimum,
|
||||
byte maximum,
|
||||
byte default_value)
|
||||
{
|
||||
return value >= minimum && value <= maximum ? value : default_value;
|
||||
}
|
||||
|
||||
void game_modes_options_sanitize(
|
||||
struct game_variant_options *options)
|
||||
{
|
||||
if (options->mode >= NUMBER_OF_GAME_MODES)
|
||||
options->mode = _game_mode_none;
|
||||
options->hardcore = options->hardcore != FALSE;
|
||||
options->infection_initial_zombies = game_modes_option(options->infection_initial_zombies, 1, 16,
|
||||
INFECTION_DEFAULT_INITIAL_ZOMBIES);
|
||||
options->infection_zombie_speed = game_modes_option(options->infection_zombie_speed, 100, 200,
|
||||
INFECTION_DEFAULT_ZOMBIE_SPEED);
|
||||
options->infection_skull_damage = game_modes_option(options->infection_skull_damage, 100, 250,
|
||||
INFECTION_DEFAULT_SKULL_DAMAGE);
|
||||
options->infection_respawn_time = game_modes_option(options->infection_respawn_time, 1, 30,
|
||||
INFECTION_DEFAULT_RESPAWN_TIME);
|
||||
options->infection_countdown = game_modes_option(options->infection_countdown, 0, 30,
|
||||
INFECTION_DEFAULT_COUNTDOWN);
|
||||
options->infection_zombie_shields = options->infection_zombie_shields != FALSE;
|
||||
if (options->gun_game_order >= NUMBER_OF_GUN_GAME_ORDERS)
|
||||
options->gun_game_order = _gun_game_order_strongest_first;
|
||||
options->gun_game_melee_demotes = options->gun_game_melee_demotes != FALSE;
|
||||
csmemset(options->reserved, 0, sizeof(options->reserved));
|
||||
}
|
||||
|
||||
short game_modes_variant_mode(
|
||||
struct game_variant const *variant,
|
||||
struct game_variant_options const *options)
|
||||
{
|
||||
if (!variant || !options || variant->game_engine_index != game_engine_slayer)
|
||||
return _game_mode_none;
|
||||
switch (options->mode)
|
||||
{
|
||||
case _game_mode_swat:
|
||||
return _game_mode_swat;
|
||||
case _game_mode_infection:
|
||||
return variant->universal_variant.teams ? _game_mode_infection : _game_mode_none;
|
||||
case _game_mode_gun_game:
|
||||
return !variant->universal_variant.teams ? _game_mode_gun_game : _game_mode_none;
|
||||
}
|
||||
return _game_mode_none;
|
||||
}
|
||||
|
||||
wchar_t const *game_modes_variant_kind_name(
|
||||
struct game_variant const *variant,
|
||||
struct game_variant_options const *options)
|
||||
{
|
||||
switch (game_modes_variant_mode(variant, options))
|
||||
{
|
||||
case _game_mode_swat:
|
||||
return options->hardcore ? L"HARDCORE SWAT" : L"SWAT";
|
||||
case _game_mode_infection:
|
||||
return options->hardcore ? L"HARDCORE INFECTION" : L"INFECTION";
|
||||
case _game_mode_gun_game:
|
||||
return options->hardcore ? L"HARDCORE GUN GAME" : L"GUN GAME";
|
||||
}
|
||||
if (!options || !options->hardcore || !variant)
|
||||
return NULL;
|
||||
switch (variant->game_engine_index)
|
||||
{
|
||||
case game_engine_ctf:
|
||||
return L"HARDCORE CTF";
|
||||
case game_engine_slayer:
|
||||
return L"HARDCORE SLAYER";
|
||||
case game_engine_oddball:
|
||||
return L"HARDCORE ODDBALL";
|
||||
case game_engine_king:
|
||||
return L"HARDCORE KING";
|
||||
case game_engine_race:
|
||||
return L"HARDCORE RACE";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
boolean game_modes_variant_is_opence(
|
||||
struct game_variant const *variant,
|
||||
struct game_variant_options const *options)
|
||||
{
|
||||
return options && (options->hardcore || game_modes_variant_mode(variant, options) != _game_mode_none);
|
||||
}
|
||||
|
||||
/* ---- the game being played */
|
||||
|
||||
short game_modes_mode(
|
||||
void)
|
||||
{
|
||||
if (!game_engine_running())
|
||||
return _game_mode_none;
|
||||
return game_modes_variant_mode(game_engine_get_variant(), game_variant_options_get());
|
||||
}
|
||||
|
||||
boolean game_modes_hardcore(
|
||||
void)
|
||||
{
|
||||
return game_engine_running() && game_variant_options_get()->hardcore;
|
||||
}
|
||||
|
||||
struct game_engine *game_modes_engine(
|
||||
struct game_engine *engine)
|
||||
{
|
||||
switch (game_modes_mode())
|
||||
{
|
||||
case _game_mode_swat:
|
||||
/* (SWAT is played without shields, whatever its variant's) */
|
||||
SET_FLAG(game_engine_get_variant()->universal_variant.flags, _game_variant_no_shields_bit, TRUE);
|
||||
break;
|
||||
case _game_mode_infection:
|
||||
return infection_engine_get(engine);
|
||||
case _game_mode_gun_game:
|
||||
return gun_game_engine_get(engine);
|
||||
}
|
||||
return engine;
|
||||
}
|
||||
|
||||
void game_modes_postspawn(
|
||||
long player_index)
|
||||
{
|
||||
switch (game_modes_mode())
|
||||
{
|
||||
case _game_mode_infection:
|
||||
infection_postspawn(player_index);
|
||||
break;
|
||||
case _game_mode_gun_game:
|
||||
gun_game_postspawn(player_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void game_modes_player_killed(
|
||||
long killing_player_index,
|
||||
long dead_player_index,
|
||||
boolean friendly_fire)
|
||||
{
|
||||
struct player_datum *killer;
|
||||
struct unit_datum *unit;
|
||||
|
||||
/* Hardcore: the host restores the killer's health, and their shields
|
||||
unless an overshield has them past full */
|
||||
if (!game_modes_hardcore() || network_game_distributed_client() || friendly_fire ||
|
||||
killing_player_index == NONE || killing_player_index == dead_player_index)
|
||||
{
|
||||
return;
|
||||
}
|
||||
killer = player_try_and_get(killing_player_index);
|
||||
if (!killer || killer->unit_index == NONE)
|
||||
return;
|
||||
unit = unit_try_and_get(killer->unit_index);
|
||||
if (!unit || TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
return;
|
||||
unit->object.body_vitality = 1.0f;
|
||||
if (unit->object.maximum_shield_vitality > 0.0f && unit->object.shield_vitality < 1.0f)
|
||||
{
|
||||
unit->object.shield_vitality = 1.0f;
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_depleted_bit, FALSE);
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_charging_bit, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void game_modes_kill_by_melee(
|
||||
boolean melee)
|
||||
{
|
||||
game_modes_melee_kill = melee;
|
||||
}
|
||||
|
||||
boolean game_modes_killed_by_melee(
|
||||
void)
|
||||
{
|
||||
return game_modes_melee_kill;
|
||||
}
|
||||
|
||||
boolean game_modes_headshot_kills(
|
||||
long object_index,
|
||||
boolean shot)
|
||||
{
|
||||
struct unit_datum *unit;
|
||||
|
||||
if (!shot || game_modes_mode() != _game_mode_swat)
|
||||
return FALSE;
|
||||
unit = (struct unit_datum *)object_try_and_get_and_verify_type(object_index, _object_mask_biped);
|
||||
return unit && unit->unit.player_index != NONE;
|
||||
}
|
||||
|
||||
boolean game_modes_motion_sensor_hidden(
|
||||
void)
|
||||
{
|
||||
return game_modes_hardcore();
|
||||
}
|
||||
|
||||
boolean game_modes_aim_assist_off(
|
||||
void)
|
||||
{
|
||||
return game_modes_hardcore();
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/* game_modes.h: OpenCE's gametypes (port/linux/game/game_modes.c)
|
||||
|
||||
SWAT, Infection and Gun Game are modes of Slayer, and Hardcore is a set of
|
||||
rules over any game engine's: a gametype's PC options (game_engine.h's struct
|
||||
game_variant_options, from mode on) say which, so a saved gametype, the
|
||||
network game and the game all carry them. The built-in ones are written with
|
||||
the Xbox's default gametypes (playlist_profile.c), after them, and the
|
||||
Select Gametype screen lists them in a bank of their own, OPENCE. */
|
||||
#ifndef HALO_GAME_MODES_H
|
||||
#define HALO_GAME_MODES_H
|
||||
|
||||
struct game_engine;
|
||||
struct game_variant;
|
||||
struct game_variant_options;
|
||||
|
||||
/* the built-in gametypes' place among the default ones (the Xbox's 26 come
|
||||
first: playlist_profile.c checks it) */
|
||||
#define GAME_MODES_FIRST_DEFAULT_PLAYLIST_PROFILE 26
|
||||
|
||||
/* ---- the built-in gametypes */
|
||||
|
||||
short game_modes_gametype_count(void);
|
||||
/* its name in the gametype lists */
|
||||
wchar_t const *game_modes_gametype_name(short index);
|
||||
/* its variant and options */
|
||||
void game_modes_gametype(short index, struct game_variant *variant, struct game_variant_options *options);
|
||||
/* the one of that name (debug.network_test's: "swat", "infection",
|
||||
"gun_game", "hardcore", "hardcore_ctf" ...), FALSE if none is */
|
||||
boolean game_modes_gametype_by_name(char const *name, struct game_variant *variant,
|
||||
struct game_variant_options *options);
|
||||
|
||||
/* ---- a gametype's options */
|
||||
|
||||
/* OpenCE's options at their defaults, with no mode (a gametype's that has
|
||||
none of its own: game_variant_options_default, and one saved before them) */
|
||||
void game_modes_options_default(struct game_variant_options *options);
|
||||
/* each of OpenCE's options in range (a file's or another machine's), its
|
||||
mode's own set to their defaults where none were given */
|
||||
void game_modes_options_sanitize(struct game_variant_options *options);
|
||||
/* the mode a gametype plays: its options' if its game engine and teams
|
||||
allow it (SWAT and Infection on teams, Gun Game free for all, all of them
|
||||
Slayer), else none */
|
||||
short game_modes_variant_mode(struct game_variant const *variant, struct game_variant_options const *options);
|
||||
/* the name the menus show for its kind of game ("INFECTION", "HARDCORE
|
||||
CTF"), NULL for a game engine's own ("SLAYER") */
|
||||
wchar_t const *game_modes_variant_kind_name(struct game_variant const *variant,
|
||||
struct game_variant_options const *options);
|
||||
/* whether a gametype is one of OpenCE's (a mode, or Hardcore) */
|
||||
boolean game_modes_variant_is_opence(struct game_variant const *variant, struct game_variant_options const *options);
|
||||
|
||||
/* ---- the game being played */
|
||||
|
||||
/* its mode (_game_mode_none with no game engine) */
|
||||
short game_modes_mode(void);
|
||||
/* whether it plays by Hardcore's rules */
|
||||
boolean game_modes_hardcore(void);
|
||||
/* the game engine a mode plays with: Infection's and Gun Game's are
|
||||
Slayer's with their own rules; SWAT's variant has no shields
|
||||
(game_engine_initialize) */
|
||||
struct game_engine *game_modes_engine(struct game_engine *engine);
|
||||
/* a player's spawn, after its starting equipment (game_engine_postspawn_player_update) */
|
||||
void game_modes_postspawn(long player_index);
|
||||
/* a player killed (game_engine_player_killed, after the game engine's):
|
||||
Hardcore's restore of the killer */
|
||||
void game_modes_player_killed(long killing_player_index, long dead_player_index, boolean friendly_fire);
|
||||
/* the kill being recorded is a melee's (damage.c, around
|
||||
game_statistics_record_kill) */
|
||||
void game_modes_kill_by_melee(boolean melee);
|
||||
boolean game_modes_killed_by_melee(void);
|
||||
/* a shot's hit on a player's head (a bullet's, a plasma bolt's, a needle's,
|
||||
not a melee's or an explosion's) kills at once (SWAT) */
|
||||
boolean game_modes_headshot_kills(long object_index, boolean shot);
|
||||
/* the motion sensor is not drawn (Hardcore) */
|
||||
boolean game_modes_motion_sensor_hidden(void);
|
||||
/* no aim assist: neither autoaim nor magnetism (Hardcore) */
|
||||
boolean game_modes_aim_assist_off(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,300 @@
|
||||
/*
|
||||
GUN_GAME.C
|
||||
|
||||
Gun Game, a mode of free for all Slayer (game_modes.c). Everyone starts with
|
||||
the first weapon of a list and nothing else; each kill gives the killer the
|
||||
next, and a kill with the last wins. A player's level is their Slayer score
|
||||
(the kills less the suicides), so the scores the host sends its clients
|
||||
(game_engine_slayer_write_network_state) carry it, and the game ends as
|
||||
Slayer's does, at the score to win, which is the list's length.
|
||||
|
||||
The list is those of the loadout weapons (game_engine.h's _loadout_weapon_*)
|
||||
the map has, the strongest first (the rocket launcher, the shotgun, the
|
||||
sniper rifle, the plasma rifle, the assault rifle, the needler, the plasma
|
||||
pistol, the pistol), the weakest first, or in an order the host draws for
|
||||
each game. Only the host gives weapons: a player's weapons go to every
|
||||
machine with their inventory (network_objects.c). No one picks up a
|
||||
weapon; a weapon emptied is replaced with a full one; and a melee kill can
|
||||
take the victim back a weapon (gun_game_melee_demotes).
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_engine.h"
|
||||
#include "game/game_engine_slayer.h"
|
||||
#include "game/players.h"
|
||||
#include "items/weapons.h"
|
||||
#include "items/weapon_definitions.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "objects/objects.h"
|
||||
#include "units/units.h"
|
||||
#include "game_modes.h"
|
||||
#include "gun_game.h"
|
||||
|
||||
static byte const gun_game_strongest_first[] =
|
||||
{
|
||||
_loadout_weapon_rocket_launcher,
|
||||
_loadout_weapon_shotgun,
|
||||
_loadout_weapon_sniper_rifle,
|
||||
_loadout_weapon_plasma_rifle,
|
||||
_loadout_weapon_assault_rifle,
|
||||
_loadout_weapon_needler,
|
||||
_loadout_weapon_plasma_pistol,
|
||||
_loadout_weapon_pistol,
|
||||
};
|
||||
|
||||
#define GUN_GAME_MAXIMUM_LEVELS NUMBEROF(gun_game_strongest_first)
|
||||
|
||||
static struct
|
||||
{
|
||||
struct game_engine engine;
|
||||
struct game_engine slayer;
|
||||
/* the map's list, its weapons as _loadout_weapon_* */
|
||||
byte levels[GUN_GAME_MAXIMUM_LEVELS];
|
||||
short level_count;
|
||||
/* the host's: each player's unit given a level's weapon, and that level
|
||||
(by absolute player index) */
|
||||
long equipped_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
short equipped_level[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
/* a weapon being given (gun_game_allow_pick_up allows it) */
|
||||
boolean equipping;
|
||||
} gun_game;
|
||||
|
||||
short gun_game_level_count(
|
||||
void)
|
||||
{
|
||||
return gun_game.level_count;
|
||||
}
|
||||
|
||||
byte gun_game_level_weapon(
|
||||
short level)
|
||||
{
|
||||
return VALID_INDEX(level, gun_game.level_count) ? gun_game.levels[level] : _loadout_weapon_none;
|
||||
}
|
||||
|
||||
/* a player's level: their score, within the list */
|
||||
static short gun_game_player_level(
|
||||
long player_index)
|
||||
{
|
||||
long score = gun_game.slayer.get_player_score(player_index, _get_score_individual);
|
||||
|
||||
return (short)PIN(score, 0, MAX(gun_game.level_count - 1, 0));
|
||||
}
|
||||
|
||||
/* a weapon with no rounds left (none loaded nor carried), or a battery
|
||||
spent */
|
||||
static boolean gun_game_weapon_empty(
|
||||
long weapon_index)
|
||||
{
|
||||
struct weapon_datum *weapon = weapon_try_and_get(weapon_index);
|
||||
struct weapon_definition *definition;
|
||||
short magazine;
|
||||
|
||||
if (!weapon)
|
||||
return FALSE;
|
||||
definition = weapon_definition_get(weapon->definition_index);
|
||||
if (definition->weapon.magazines.count <= 0)
|
||||
return weapon->weapon.age >= 1.0f;
|
||||
for (magazine = 0; magazine < MIN(definition->weapon.magazines.count, NUMBEROF(weapon->weapon.magazines));
|
||||
magazine++)
|
||||
{
|
||||
if (weapon->weapon.magazines[magazine].rounds_loaded > 0 || weapon->weapon.magazines[magazine].rounds_total > 0)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* every weapon of a unit gone, the one in its hand too (which
|
||||
unit_delete_all_weapons keeps) */
|
||||
static void gun_game_delete_weapons(
|
||||
long unit_index)
|
||||
{
|
||||
struct unit_datum *unit = unit_get(unit_index);
|
||||
short slot;
|
||||
short other;
|
||||
|
||||
for (slot = 0; slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
long weapon_index = unit->unit.weapon_object_indices[slot];
|
||||
|
||||
if (weapon_index == NONE)
|
||||
continue;
|
||||
/* (each deleted once, should two slots hold it) */
|
||||
for (other = slot; other < MAXIMUM_WEAPONS_PER_UNIT; other++)
|
||||
{
|
||||
if (unit->unit.weapon_object_indices[other] == weapon_index)
|
||||
{
|
||||
unit->unit.weapon_object_indices[other] = NONE;
|
||||
if (unit->unit.current_weapon_index == other)
|
||||
unit->unit.current_weapon_index = NONE;
|
||||
if (unit->unit.desired_weapon_index == other)
|
||||
unit->unit.desired_weapon_index = NONE;
|
||||
}
|
||||
}
|
||||
if (object_try_and_get(weapon_index))
|
||||
object_delete(weapon_index);
|
||||
}
|
||||
}
|
||||
|
||||
/* the host gives a living player their level's weapon (their others gone),
|
||||
again when it is spent */
|
||||
static void gun_game_equip(
|
||||
long player_index)
|
||||
{
|
||||
struct player_datum *player = player_get(player_index);
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
struct unit_datum *unit;
|
||||
short level;
|
||||
long definition_index;
|
||||
long weapon_index;
|
||||
struct object_placement_data placement;
|
||||
|
||||
if (network_game_distributed_client() || !VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS) ||
|
||||
player->quit_out_of_game || player->unit_index == NONE || !gun_game.level_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
unit = unit_try_and_get(player->unit_index);
|
||||
if (!unit || TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
return;
|
||||
level = gun_game_player_level(player_index);
|
||||
if (gun_game.equipped_unit[slot] == player->unit_index && gun_game.equipped_level[slot] == level)
|
||||
{
|
||||
long current = VALID_INDEX(unit->unit.current_weapon_index, MAXIMUM_WEAPONS_PER_UNIT) ?
|
||||
unit->unit.weapon_object_indices[unit->unit.current_weapon_index] : NONE;
|
||||
|
||||
if (current != NONE && !gun_game_weapon_empty(current))
|
||||
return;
|
||||
}
|
||||
/* (no weapon in the hand: a grenade being thrown has it, so wait) */
|
||||
if (unit->unit.grenade_throw_state != _unit_grenade_throw_idle)
|
||||
return;
|
||||
definition_index = game_engine_loadout_weapon_definition(gun_game.levels[level]);
|
||||
if (definition_index == NONE)
|
||||
return;
|
||||
gun_game.equipping = TRUE;
|
||||
gun_game_delete_weapons(player->unit_index);
|
||||
object_placement_data_new(&placement, definition_index, NONE);
|
||||
weapon_index = object_new(&placement);
|
||||
if (weapon_index != NONE && !unit_add_weapon_to_inventory(player->unit_index, weapon_index, 2))
|
||||
{
|
||||
object_delete(weapon_index);
|
||||
weapon_index = NONE;
|
||||
}
|
||||
gun_game.equipping = FALSE;
|
||||
gun_game.equipped_unit[slot] = player->unit_index;
|
||||
gun_game.equipped_level[slot] = level;
|
||||
}
|
||||
|
||||
void gun_game_postspawn(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
|
||||
if (VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
gun_game.equipped_unit[slot] = NONE;
|
||||
gun_game_equip(player_index);
|
||||
}
|
||||
|
||||
/* the map's list, in the gametype's order */
|
||||
static void gun_game_levels_build(
|
||||
void)
|
||||
{
|
||||
short order = game_variant_options_get()->gun_game_order;
|
||||
short index;
|
||||
|
||||
gun_game.level_count = 0;
|
||||
for (index = 0; index < (short)GUN_GAME_MAXIMUM_LEVELS; index++)
|
||||
{
|
||||
byte weapon = gun_game_strongest_first[order == _gun_game_order_weakest_first ?
|
||||
GUN_GAME_MAXIMUM_LEVELS - 1 - index : index];
|
||||
|
||||
if (game_engine_loadout_weapon_definition(weapon) != NONE)
|
||||
gun_game.levels[gun_game.level_count++] = weapon;
|
||||
}
|
||||
/* (the host's draw: only the host gives weapons) */
|
||||
if (order == _gun_game_order_random && !network_game_distributed_client())
|
||||
{
|
||||
for (index = gun_game.level_count - 1; index > 0; index--)
|
||||
{
|
||||
short other = (short)local_random_range(0, index + 1);
|
||||
byte weapon = gun_game.levels[index];
|
||||
|
||||
gun_game.levels[index] = gun_game.levels[other];
|
||||
gun_game.levels[other] = weapon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static boolean gun_game_initialize_for_new_map(
|
||||
void)
|
||||
{
|
||||
gun_game_levels_build();
|
||||
csmemset(gun_game.equipped_unit, 0xFF, sizeof(gun_game.equipped_unit));
|
||||
csmemset(gun_game.equipped_level, 0xFF, sizeof(gun_game.equipped_level));
|
||||
gun_game.equipping = FALSE;
|
||||
/* (the game is won with a kill with the last weapon: every machine's
|
||||
list is as long) */
|
||||
if (gun_game.level_count)
|
||||
game_engine_get_variant()->universal_variant.score_to_win = gun_game.level_count;
|
||||
return gun_game.slayer.initialize_for_new_map ? gun_game.slayer.initialize_for_new_map() : TRUE;
|
||||
}
|
||||
|
||||
static void gun_game_player_update_each_tick(
|
||||
long player_index)
|
||||
{
|
||||
if (gun_game.slayer.player_update_each_tick)
|
||||
gun_game.slayer.player_update_each_tick(player_index);
|
||||
gun_game_equip(player_index);
|
||||
}
|
||||
|
||||
/* only the weapons given (and a weapon held, which readying it asks of) */
|
||||
static boolean gun_game_allow_pick_up(
|
||||
long unit_index,
|
||||
long weapon_index)
|
||||
{
|
||||
struct unit_datum *unit = unit_try_and_get(unit_index);
|
||||
short slot;
|
||||
|
||||
if (gun_game.equipping)
|
||||
return TRUE;
|
||||
for (slot = 0; unit && slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
if (unit->unit.weapon_object_indices[slot] == weapon_index)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void gun_game_player_killed_player(
|
||||
long killing_player_index,
|
||||
long killing_object_index,
|
||||
long dead_player_index,
|
||||
boolean friendly_fire)
|
||||
{
|
||||
gun_game.slayer.player_killed_player(killing_player_index, killing_object_index, dead_player_index, friendly_fire);
|
||||
if (network_game_distributed_client() || player_get(dead_player_index)->quit_out_of_game)
|
||||
return;
|
||||
/* a melee kill takes the victim back a weapon */
|
||||
if (game_variant_options_get()->gun_game_melee_demotes && game_modes_killed_by_melee() && !friendly_fire &&
|
||||
killing_player_index != NONE && killing_player_index != dead_player_index &&
|
||||
gun_game.slayer.get_player_score(dead_player_index, _get_score_individual) > 0)
|
||||
{
|
||||
game_engine_slayer_adjust_score(dead_player_index, -1);
|
||||
}
|
||||
/* (a suicide at the first weapon leaves the score at 0) */
|
||||
if (gun_game.slayer.get_player_score(dead_player_index, _get_score_individual) < 0)
|
||||
game_engine_slayer_adjust_score(dead_player_index, 1);
|
||||
}
|
||||
|
||||
struct game_engine *gun_game_engine_get(
|
||||
struct game_engine const *slayer)
|
||||
{
|
||||
gun_game.slayer = *slayer;
|
||||
gun_game.engine = *slayer;
|
||||
gun_game.engine.initialize_for_new_map = gun_game_initialize_for_new_map;
|
||||
gun_game.engine.player_update_each_tick = gun_game_player_update_each_tick;
|
||||
gun_game.engine.allow_pick_up = gun_game_allow_pick_up;
|
||||
gun_game.engine.player_killed_player = gun_game_player_killed_player;
|
||||
return &gun_game.engine;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/* gun_game.h: Gun Game, a mode of free for all Slayer (port/linux/game/gun_game.c) */
|
||||
#ifndef HALO_GUN_GAME_H
|
||||
#define HALO_GUN_GAME_H
|
||||
|
||||
struct game_engine;
|
||||
|
||||
/* Slayer's engine with Gun Game's rules (game_modes_engine) */
|
||||
struct game_engine *gun_game_engine_get(struct game_engine const *slayer);
|
||||
/* a player spawned: their weapon (game_modes_postspawn) */
|
||||
void gun_game_postspawn(long player_index);
|
||||
/* the weapons of the map's list (each machine's alike), and a level's (a
|
||||
_loadout_weapon_*) */
|
||||
short gun_game_level_count(void);
|
||||
byte gun_game_level_weapon(short level);
|
||||
|
||||
#endif
|
||||
@@ -33,6 +33,21 @@ When the texture cannot be drawn, the sprites are drawn from their bitmap.
|
||||
#include "rasterizer/rasterizer.h"
|
||||
#include "text/draw_string.h"
|
||||
#include "hud_button_layout.h"
|
||||
#include "scenario/scenario_definitions.h"
|
||||
#include "cache/texture_cache.h"
|
||||
#ifdef HALO_ANDROID
|
||||
#include "android_ce_texture_cache.h"
|
||||
#endif
|
||||
|
||||
static boolean hud_hires_bitmap_resident(struct bitmap_data const *bitmap)
|
||||
{
|
||||
#ifdef HALO_ANDROID
|
||||
/* CE heap pixels have no Xbox LRU block. Query without touching their age. */
|
||||
if (android_ce_texture_resident(bitmap))
|
||||
return TRUE;
|
||||
#endif
|
||||
return bitmap->cache_block_index != NONE;
|
||||
}
|
||||
|
||||
/* the platform layer's (port/linux/src) */
|
||||
void platform_log(char const *format, ...);
|
||||
@@ -46,12 +61,26 @@ long hud_hires_asset_fits(long asset, long width, long height);
|
||||
unsigned long hud_hires_asset_sprites(long asset);
|
||||
int hud_hires_sprites_drawable(long asset, unsigned long address, unsigned long level0_size);
|
||||
void hud_hires_register_placeholder(long asset, unsigned long const *texture);
|
||||
int hud_hires_asset_custom_edition(long asset);
|
||||
int hud_hires_asset_ce_only(long asset);
|
||||
long hud_hires_ce_stock_count_get(void);
|
||||
long hud_hires_ce_stock_find(char const *tag, long bitmap);
|
||||
char const *hud_hires_ce_stock_tag(long index);
|
||||
long hud_hires_ce_stock_bitmap(long index);
|
||||
int hud_hires_ce_stock_matches(long index, unsigned long address, long width, long height, unsigned long size);
|
||||
/* (custom_edition_cache.c) */
|
||||
boolean custom_edition_cache_stock_tag(long tag_index);
|
||||
boolean custom_edition_cache_tags_loaded(void);
|
||||
|
||||
void hud_hires_tags_loaded(void);
|
||||
void hud_hires_map_loaded(const long *assets, long count);
|
||||
void hud_hires_map_unloaded(void);
|
||||
void hud_hires_tags_loaded(long scenario_index);
|
||||
void hud_hires_tags_unloaded(void);
|
||||
long hud_hires_asset_at(unsigned long address, long width, long height);
|
||||
struct bitmap_data const *hud_hires_sprite_bitmap(struct bitmap_data const *bitmap, short sequence_index);
|
||||
|
||||
#include "custom_edition_hud_buttons.h"
|
||||
|
||||
/* ---------- constants */
|
||||
|
||||
enum
|
||||
@@ -66,12 +95,17 @@ static struct
|
||||
{
|
||||
struct bitmap_data *bitmap;
|
||||
long asset;
|
||||
/* A compatible CE resource sheet: checked against CE's pixel signature
|
||||
in the platform layer, rather than the Xbox signature. */
|
||||
boolean stock_custom_edition;
|
||||
} hires_bitmaps[MAXIMUM_HIRES_BITMAPS];
|
||||
static long hires_bitmap_count = 0;
|
||||
|
||||
/* Sheets without redraws: retain their original lettering and sprite layout. */
|
||||
static struct { struct bitmap_data *bitmap; long kind; } upscale_bitmaps[16];
|
||||
static long upscale_bitmap_count;
|
||||
static struct { struct bitmap_data *bitmap; long signature; } ce_stock_bitmaps[128];
|
||||
static long ce_stock_bitmap_count;
|
||||
|
||||
/* the bitmaps some of whose sprites have a texture, with their placeholder,
|
||||
and whether the texture can be drawn for the pixels at checked_address
|
||||
@@ -101,6 +135,7 @@ static short hud_buttons_style;
|
||||
static void hud_buttons_forget(void)
|
||||
{
|
||||
long index;
|
||||
ce_hud_buttons_forget();
|
||||
for (index = 0; index < 14; index++)
|
||||
{
|
||||
if (hud_buttons[index].bitmap)
|
||||
@@ -136,7 +171,7 @@ static void hud_hires_sprite_bitmaps_forget(
|
||||
/* ---------- public code */
|
||||
|
||||
void hud_hires_tags_loaded(
|
||||
void)
|
||||
long scenario_index)
|
||||
{
|
||||
long asset_count = hud_hires_asset_count();
|
||||
long asset;
|
||||
@@ -145,6 +180,22 @@ void hud_hires_tags_loaded(
|
||||
hires_bitmap_count = 0;
|
||||
hud_hires_sprite_bitmaps_forget();
|
||||
upscale_bitmap_count = 0;
|
||||
ce_stock_bitmap_count = 0;
|
||||
if (custom_edition_cache_tags_loaded())
|
||||
{
|
||||
long index;
|
||||
for (index = 0; index < hud_hires_ce_stock_count_get() && ce_stock_bitmap_count < NUMBEROF(ce_stock_bitmaps); index++)
|
||||
{
|
||||
long group = tag_loaded(BITMAP_GROUP_TAG, hud_hires_ce_stock_tag(index));
|
||||
struct bitmap_data *bitmap = group == NONE ? NULL :
|
||||
bitmap_group_try_and_get_bitmap(group, (short)hud_hires_ce_stock_bitmap(index));
|
||||
if (bitmap && custom_edition_cache_stock_tag(group))
|
||||
{
|
||||
ce_stock_bitmaps[ce_stock_bitmap_count].bitmap = bitmap;
|
||||
ce_stock_bitmaps[ce_stock_bitmap_count++].signature = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
static struct { char const *tag; short first, last; } const sheets[] = {
|
||||
{ "ui\\hud\\bitmaps\\combined\\hud_unit_backgrounds", 8, 12 },
|
||||
@@ -159,7 +210,8 @@ void hud_hires_tags_loaded(
|
||||
{
|
||||
long group = tag_loaded(BITMAP_GROUP_TAG, sheets[sheet].tag);
|
||||
|
||||
if (group == NONE)
|
||||
/* CE's custom sheets must not enter the Xbox-only upscaler. */
|
||||
if (group == NONE || custom_edition_cache_tags_loaded())
|
||||
continue;
|
||||
for (index = sheets[sheet].first; index <= sheets[sheet].last; index++)
|
||||
{
|
||||
@@ -180,6 +232,14 @@ void hud_hires_tags_loaded(
|
||||
struct bitmap_data *bitmap = group_index == NONE ? NULL :
|
||||
bitmap_group_try_and_get_bitmap(group_index, (short)hud_hires_asset_bitmap(asset));
|
||||
|
||||
/* Only the verified compatible resource sheets have CE redraws.
|
||||
Embedded custom art keeps its own pixels, even under a stock name. */
|
||||
if (custom_edition_cache_tags_loaded() &&
|
||||
(!hud_hires_asset_custom_edition(asset) || !custom_edition_cache_stock_tag(group_index)))
|
||||
continue;
|
||||
if (!custom_edition_cache_tags_loaded() && hud_hires_asset_ce_only(asset))
|
||||
continue;
|
||||
|
||||
if (!bitmap)
|
||||
{
|
||||
/* (the main menu's map has only some of the HUD) */
|
||||
@@ -204,11 +264,27 @@ void hud_hires_tags_loaded(
|
||||
{
|
||||
hires_bitmaps[hires_bitmap_count].bitmap = bitmap;
|
||||
hires_bitmaps[hires_bitmap_count].asset = asset;
|
||||
hires_bitmaps[hires_bitmap_count].stock_custom_edition =
|
||||
hud_hires_asset_custom_edition(asset) && custom_edition_cache_stock_tag(group_index);
|
||||
hires_bitmap_count++;
|
||||
}
|
||||
}
|
||||
platform_log("high-res hud: %ld of %ld bitmaps in this map, %ld for some of their sprites (%ld not in it)",
|
||||
hires_bitmap_count + hires_sprite_bitmap_count, asset_count, hires_sprite_bitmap_count, missing);
|
||||
/* (their PNGs decoded now, ahead of the HUD's first frame: not the main
|
||||
menu's, which draws no HUD) */
|
||||
if (scenario_definition_get(scenario_index)->type != _scenario_type_main_menu)
|
||||
{
|
||||
long assets[MAXIMUM_HIRES_BITMAPS + MAXIMUM_HIRES_SPRITE_BITMAPS];
|
||||
long count = 0;
|
||||
long index;
|
||||
|
||||
for (index = 0; index < hires_bitmap_count; index++)
|
||||
assets[count++] = hires_bitmaps[index].asset;
|
||||
for (index = 0; index < hires_sprite_bitmap_count; index++)
|
||||
assets[count++] = hires_sprite_bitmaps[index].asset;
|
||||
hud_hires_map_loaded(assets, count);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -218,7 +294,9 @@ void hud_hires_tags_unloaded(
|
||||
{
|
||||
hires_bitmap_count = 0;
|
||||
upscale_bitmap_count = 0;
|
||||
ce_stock_bitmap_count = 0;
|
||||
hud_hires_sprite_bitmaps_forget();
|
||||
hud_hires_map_unloaded();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -241,7 +319,7 @@ struct bitmap_data const *hud_hires_sprite_bitmap(
|
||||
continue;
|
||||
}
|
||||
/* (checked on its pixels in the texture cache, once they are loaded) */
|
||||
if (sprite_bitmap->cache_block_index == NONE || !sprite_bitmap->base_address)
|
||||
if (!hud_hires_bitmap_resident(sprite_bitmap) || !sprite_bitmap->base_address)
|
||||
break;
|
||||
if (hires_sprite_bitmaps[index].checked_address != sprite_bitmap->base_address ||
|
||||
hires_sprite_bitmaps[index].checked_at != config_changes())
|
||||
@@ -290,6 +368,30 @@ struct bitmap_data const *hud_hires_sprite_bitmap(
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/* whether the bitmap at address that `asset` stands for is a Custom Edition
|
||||
map's stock one (its pixels are not those the texture was drawn from) */
|
||||
long hud_hires_asset_stock_custom_edition(
|
||||
unsigned long address,
|
||||
long width,
|
||||
long height,
|
||||
long asset)
|
||||
{
|
||||
long index;
|
||||
|
||||
for (index = 0; index < hires_bitmap_count; index++)
|
||||
{
|
||||
struct bitmap_data *bitmap = hires_bitmaps[index].bitmap;
|
||||
|
||||
if (hires_bitmaps[index].asset == asset && hud_hires_bitmap_resident(bitmap) &&
|
||||
(unsigned long)bitmap->base_address == address && bitmap->width == width && bitmap->height == height)
|
||||
{
|
||||
return hires_bitmaps[index].stock_custom_edition;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
long hud_hires_asset_at(
|
||||
unsigned long address,
|
||||
long width,
|
||||
@@ -301,7 +403,7 @@ long hud_hires_asset_at(
|
||||
{
|
||||
struct bitmap_data *bitmap = hires_bitmaps[index].bitmap;
|
||||
|
||||
if (bitmap->cache_block_index != NONE &&
|
||||
if (hud_hires_bitmap_resident(bitmap) &&
|
||||
(unsigned long)bitmap->base_address == address &&
|
||||
bitmap->width == width &&
|
||||
bitmap->height == height)
|
||||
@@ -317,20 +419,56 @@ long hud_hires_upscale_at(unsigned long address, long width, long height)
|
||||
{
|
||||
long index;
|
||||
|
||||
for (index = 0; index < ce_stock_bitmap_count; index++)
|
||||
{
|
||||
struct bitmap_data const *bitmap = ce_stock_bitmaps[index].bitmap;
|
||||
if (hud_hires_bitmap_resident(bitmap) && (unsigned long)bitmap->base_address == address &&
|
||||
bitmap->width == width && bitmap->height == height &&
|
||||
hud_hires_ce_stock_matches(ce_stock_bitmaps[index].signature, address, width, height,
|
||||
(unsigned long)bitmap_mipmap_get_pixel_data_size(bitmap, 0)))
|
||||
return 4;
|
||||
}
|
||||
|
||||
for (index = 0; index < upscale_bitmap_count; index++)
|
||||
{
|
||||
struct bitmap_data const *bitmap = upscale_bitmaps[index].bitmap;
|
||||
|
||||
if (bitmap->cache_block_index != NONE && (unsigned long)bitmap->base_address == address &&
|
||||
if (hud_hires_bitmap_resident(bitmap) && (unsigned long)bitmap->base_address == address &&
|
||||
bitmap->width == width && bitmap->height == height)
|
||||
return upscale_bitmaps[index].kind;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean ce_hud_buttons_stock(struct icon_hud_element_definition const *icon, long button)
|
||||
{
|
||||
/* CE keeps these Xbox controller definitions even when its messaging
|
||||
sheet contains only weapon pictures. Identify the controller entry, not
|
||||
the sheet: weapon icons are separate records and keep their own art. */
|
||||
static const short stock[18][7] = {
|
||||
{0,-6,-2,-5,0,2,0}, {1,-6,-2,-5,0,2,0},
|
||||
{2,-6,-2,-5,0,2,0}, {3,-6,-2,-5,0,2,0},
|
||||
{13,-6,-2,-5,0,2,1}, {13,-6,-2,-5,0,2,2},
|
||||
{21,-6,-2,-5,0,0,3}, {22,-6,-2,-5,0,0,4},
|
||||
{0,0,0,0,0,1,5}, {0,0,0,0,0,1,6},
|
||||
{0,0,0,0,0,1,7}, {0,0,0,0,0,1,8},
|
||||
{18,-6,-2,-5,0,0,9}, {17,-6,-2,-5,0,0,10},
|
||||
{19,28,-2,-5,10,4,11}, {20,28,-2,-5,10,4,12},
|
||||
{15,-6,-2,-5,0,0,11}, {16,-6,-2,-5,0,0,12}
|
||||
};
|
||||
if (!custom_edition_cache_tags_loaded()) return TRUE;
|
||||
if (button < 0 || button >= NUMBEROF(stock) ||
|
||||
icon->sequence_index != stock[button][0] || icon->width_offset != stock[button][1] ||
|
||||
icon->offset.x != stock[button][2] || icon->offset.y != stock[button][3] ||
|
||||
icon->frame_rate != stock[button][4] || icon->flags != stock[button][5] ||
|
||||
icon->text_index != stock[button][6]) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Match the controller entry itself: weapon icons may reuse its sequence.
|
||||
* Draw the existing Xbox menu faces with straight alpha, independently of
|
||||
* the messaging sheet and its tint. Disabling the HUD keeps the map's art. */
|
||||
* the messaging sheet and its tint. CE custom sheets also need this fallback
|
||||
* with High-Res HUD off: their stock button entries can name weapon art. */
|
||||
boolean hud_hires_button_draw(struct icon_hud_element_definition const *icon,
|
||||
rectangle2d *cursor, pixel32 color)
|
||||
{
|
||||
@@ -356,7 +494,9 @@ boolean hud_hires_button_draw(struct icon_hud_element_definition const *icon,
|
||||
short i;
|
||||
short style, slot;
|
||||
|
||||
if (!config_boolean("display.high_res_hud") || !hud_globals)
|
||||
if (!hud_globals || (!config_boolean("display.high_res_hud") &&
|
||||
(!custom_edition_cache_tags_loaded() ||
|
||||
custom_edition_cache_stock_tag(hud_globals->messaging.messaging_icons.index))))
|
||||
return FALSE;
|
||||
buttons = hud_globals->messaging.button_icons.address;
|
||||
if (!buttons) return FALSE;
|
||||
@@ -364,6 +504,9 @@ boolean hud_hires_button_draw(struct icon_hud_element_definition const *icon,
|
||||
if (icon == buttons + index) break;
|
||||
if (index >= 18 || index >= hud_globals->messaging.button_icons.count)
|
||||
return FALSE;
|
||||
if (!ce_hud_buttons_stock(icon, index)) return FALSE;
|
||||
if (!config_boolean("display.high_res_hud"))
|
||||
return ce_hud_button_draw(icon, cursor, color);
|
||||
slot = index < 6 ? (short)index : hud_button_control_slot((short)index,
|
||||
icon->frame_rate > 0 ? game_time_get() / icon->frame_rate : 0);
|
||||
if (slot < 0) return FALSE;
|
||||
|
||||
@@ -0,0 +1,972 @@
|
||||
/*
|
||||
INFECTION.C
|
||||
|
||||
Infection, a mode of team Slayer (game_modes.c). Humans are red and keep the
|
||||
gametype's equipment; zombies are blue, carry the Oddball skull and nothing
|
||||
else, and fight on foot, faster than humans, their skull's melee stronger.
|
||||
The round waits for two living players, counts down, and then the host
|
||||
chooses the first zombies (leaving at least one human). A human killed by a
|
||||
zombie, by themselves or by the world becomes a zombie (one killed by a
|
||||
teammate does not); a zombie respawns a zombie, and a player who joins late
|
||||
joins the zombies. The zombies win when no human is left, the humans when the
|
||||
round's time runs out. Each player scores a kill of the other side.
|
||||
|
||||
Only the host decides: it chooses the zombies, turns the dead, gives the
|
||||
skulls and ends the round, and sends every client its state
|
||||
(struct distributed_infection_state, with the game type's:
|
||||
game_engine_write_network_state), which a client checks whole before taking.
|
||||
Each machine then sets each player's team, speed and shields by their role.
|
||||
|
||||
Its options are the gametype's (game_engine.h's struct game_variant_options,
|
||||
infection_*). The rules and much of the code follow the Infection of pull
|
||||
request #420 by arisson2001rojas-design.
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_engine.h"
|
||||
#include "game/players.h"
|
||||
#include "math/real_math.h"
|
||||
#include "memory/data.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "networking/network_game_manager.h"
|
||||
#include "networking/network_server_manager.h"
|
||||
#include "objects/objects.h"
|
||||
#include "objects/object_definitions.h"
|
||||
#include "physics/collisions.h"
|
||||
#include "text/unicode.h"
|
||||
#include "units/units.h"
|
||||
#include "units/unit_definitions.h"
|
||||
#include "game_modes.h"
|
||||
#include "infection.h"
|
||||
#include "network_infection.h"
|
||||
|
||||
void platform_log(char const *format, ...);
|
||||
|
||||
/* a score past this is not a client's to take */
|
||||
#define INFECTION_MAXIMUM_SCORE 1000000
|
||||
|
||||
static struct
|
||||
{
|
||||
struct game_engine engine;
|
||||
struct game_engine slayer;
|
||||
struct distributed_infection_state state;
|
||||
/* the host's, by absolute player index: the player of the slot, the unit
|
||||
given its role's equipment, the unit counted dead, the skull given, and
|
||||
the unit whose shields a zombie's role took (and their maximum) */
|
||||
long participant[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long equipped_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long killed_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long skull[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long shield_unit[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
real shield_maximum[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
/* a skull being given (the pickup checks allow it) */
|
||||
boolean equipping;
|
||||
/* the map has no skull, or one could not be given: the round ends */
|
||||
boolean missing_skull;
|
||||
} infection;
|
||||
|
||||
/* ---- the players' roles */
|
||||
|
||||
boolean infection_enabled(
|
||||
void)
|
||||
{
|
||||
return game_modes_mode() == _game_mode_infection;
|
||||
}
|
||||
|
||||
/* a player's identity on every machine: their name and place in the game */
|
||||
static unsigned long infection_player_identity(
|
||||
long player_index)
|
||||
{
|
||||
struct network_player const *network_player = &player_get(player_index)->network_player_data;
|
||||
unsigned long hash = 2166136261UL;
|
||||
short index;
|
||||
|
||||
for (index = 0; index < NUMBEROF(network_player->name); index++)
|
||||
hash = (hash ^ (word)network_player->name[index]) * 16777619UL;
|
||||
hash = (hash ^ (byte)network_player->machine_index) * 16777619UL;
|
||||
hash = (hash ^ (byte)network_player->controller_index) * 16777619UL;
|
||||
hash = (hash ^ (byte)network_player->player_list_index) * 16777619UL;
|
||||
return hash ? hash : 1;
|
||||
}
|
||||
|
||||
/* a player's role, if the state has it for them (not one who left, whose
|
||||
slot another took) */
|
||||
static struct distributed_infection_player *infection_player(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
|
||||
if (player_index == NONE || !VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS) ||
|
||||
!player_try_and_get(player_index) ||
|
||||
infection.state.players[slot].identity != infection_player_identity(player_index))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return &infection.state.players[slot];
|
||||
}
|
||||
|
||||
static boolean infection_weapon_is_skull(
|
||||
long weapon_index)
|
||||
{
|
||||
struct object_datum *object = object_try_and_get_and_verify_type(weapon_index, _object_mask_weapon);
|
||||
|
||||
return object && object->definition_index == get_ball_definition_index();
|
||||
}
|
||||
|
||||
boolean infection_can_delete_skull(
|
||||
long object_index)
|
||||
{
|
||||
return infection_enabled() && infection_weapon_is_skull(object_index);
|
||||
}
|
||||
|
||||
boolean infection_unit_is_zombie(
|
||||
long unit_index)
|
||||
{
|
||||
struct unit_datum *unit;
|
||||
struct distributed_infection_player *role;
|
||||
|
||||
if (unit_index == NONE || !infection_enabled() || (unit = unit_try_and_get(unit_index)) == NULL)
|
||||
return FALSE;
|
||||
role = infection_player(unit->unit.player_index);
|
||||
return role && role->role == _distributed_infection_role_zombie;
|
||||
}
|
||||
|
||||
/* asked of a player's own drops only: a death, and the inventories the host
|
||||
sends, still take a skull away */
|
||||
boolean infection_allow_weapon_drop(
|
||||
long unit_index,
|
||||
long weapon_index)
|
||||
{
|
||||
struct unit_datum *unit;
|
||||
struct player_datum *player;
|
||||
|
||||
if (!infection_enabled() || infection.state.phase != _distributed_infection_active || infection.equipping ||
|
||||
!infection_unit_is_zombie(unit_index))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
unit = unit_get(unit_index);
|
||||
player = player_try_and_get(unit->unit.player_index);
|
||||
if (!player || player->quit_out_of_game || player->unit_index != unit_index ||
|
||||
TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return !infection_weapon_is_skull(weapon_index);
|
||||
}
|
||||
|
||||
/* a zombie's skull in the hand */
|
||||
static boolean infection_unit_holds_skull(
|
||||
long unit_index)
|
||||
{
|
||||
struct unit_datum *unit = unit_get(unit_index);
|
||||
|
||||
return VALID_INDEX(unit->unit.current_weapon_index, MAXIMUM_WEAPONS_PER_UNIT) &&
|
||||
infection_weapon_is_skull(unit->unit.weapon_object_indices[unit->unit.current_weapon_index]);
|
||||
}
|
||||
|
||||
real infection_melee_multiplier(
|
||||
long unit_index)
|
||||
{
|
||||
if (!infection_unit_is_zombie(unit_index) || infection.state.phase != _distributed_infection_active ||
|
||||
!infection_unit_holds_skull(unit_index))
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
return game_variant_options_get()->infection_skull_damage / 100.0f;
|
||||
}
|
||||
|
||||
/* a living human in a seat of a vehicle that is not hidden, whom a zombie
|
||||
holding its skull struck itself (not the vehicle: Slayer's melee hits the
|
||||
vehicle a rider is in) */
|
||||
boolean infection_melee_rider_target(
|
||||
long attacker_index,
|
||||
long target_index)
|
||||
{
|
||||
struct unit_datum *target;
|
||||
struct unit_datum *vehicle;
|
||||
struct distributed_infection_player *role;
|
||||
struct unit_definition *definition;
|
||||
short seat;
|
||||
|
||||
if (!infection_unit_is_zombie(attacker_index) || infection.state.phase != _distributed_infection_active ||
|
||||
!infection_unit_holds_skull(attacker_index))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
target = unit_try_and_get(target_index);
|
||||
if (!target || target->object.type != _object_type_biped || TEST_FLAG(target->object.damage_flags, _object_dead_bit))
|
||||
return FALSE;
|
||||
role = infection_player(target->unit.player_index);
|
||||
if (!role || role->role != _distributed_infection_role_human)
|
||||
return FALSE;
|
||||
vehicle = (struct unit_datum *)object_try_and_get_and_verify_type(target->object.parent_object_index,
|
||||
_object_mask_vehicle);
|
||||
if (!vehicle)
|
||||
return FALSE;
|
||||
definition = unit_definition_get(vehicle->definition_index);
|
||||
seat = target->unit.parent_seat_index;
|
||||
return VALID_INDEX(seat, definition->unit.seats.count) &&
|
||||
!TEST_FLAG(TAG_BLOCK_GET_ELEMENT(&definition->unit.seats, seat, struct unit_seat)->flags,
|
||||
_unit_seat_invisible_bit);
|
||||
}
|
||||
|
||||
/* the host's check of a client's melee report on a rider: one of its own
|
||||
lines through the melee's cone (0.8 world units from the attacker's head,
|
||||
as the game's melee) reaches the rider, through the host's own world, not
|
||||
from a place the client says */
|
||||
boolean infection_melee_rider_visible(
|
||||
long attacker_index,
|
||||
long target_index,
|
||||
real_vector3d const *direction)
|
||||
{
|
||||
struct object_marker head;
|
||||
real_vector3d facing = *direction;
|
||||
real_vector3d perpendicular;
|
||||
real_vector3d cross;
|
||||
real_vector3d ray;
|
||||
struct collision_result hit;
|
||||
long outer;
|
||||
long inner;
|
||||
|
||||
if (!infection_melee_rider_target(attacker_index, target_index) || normalize3d(&facing) <= 0.0f)
|
||||
return FALSE;
|
||||
object_get_marker_by_name(attacker_index, "head", &head, 1);
|
||||
normalize3d(perpendicular3d(&facing, &perpendicular));
|
||||
cross_product3d(&facing, &perpendicular, &cross);
|
||||
for (outer = -2; outer <= 2; outer++)
|
||||
{
|
||||
for (inner = -2; inner <= 2; inner++)
|
||||
{
|
||||
ray.i = facing.i * 0.8f + (cross.i * inner + perpendicular.i * outer) * 0.1f;
|
||||
ray.j = facing.j * 0.8f + (cross.j * inner + perpendicular.j * outer) * 0.1f;
|
||||
ray.k = facing.k * 0.8f + (cross.k * inner + perpendicular.k * outer) * 0.1f;
|
||||
if (collision_test_vector(_collision_test_for_projectiles_flags, &head.matrix.position, &ray,
|
||||
attacker_index, &hit) && hit.type == _collision_result_object && hit.object_index == target_index)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ---- the host's round */
|
||||
|
||||
static void infection_finish(
|
||||
long winner)
|
||||
{
|
||||
if (infection.state.phase == _distributed_infection_finished)
|
||||
return;
|
||||
infection.state.winner = winner;
|
||||
infection.state.phase = _distributed_infection_finished;
|
||||
infection.state.revision++;
|
||||
platform_log("infection: finished, winner %ld", winner);
|
||||
game_engine_end_game();
|
||||
}
|
||||
|
||||
/* a unit's armour in its team's colour (a human turned while alive), as a
|
||||
spawn colours it; the colour channels a function drives (the shield's glow)
|
||||
are left to it */
|
||||
static void infection_color_unit(
|
||||
struct unit_datum *unit,
|
||||
long player_index)
|
||||
{
|
||||
struct object_definition *definition = object_definition_get(unit->definition_index);
|
||||
real_rgb_color color;
|
||||
short channel;
|
||||
|
||||
game_engine_player_get_change_color(&color, player_index);
|
||||
for (channel = 0; channel < NUMBER_OF_OBJECT_CHANGE_COLORS; channel++)
|
||||
{
|
||||
unit->object.base_change_colors[channel] = color;
|
||||
if (channel < definition->object.change_colors.count)
|
||||
{
|
||||
struct object_change_color_definition *change_color = TAG_BLOCK_GET_ELEMENT(
|
||||
&definition->object.change_colors, channel, struct object_change_color_definition);
|
||||
|
||||
if (change_color->scaled_by || change_color->darken_by)
|
||||
continue;
|
||||
}
|
||||
unit->object.outgoing_change_colors[channel] = color;
|
||||
}
|
||||
}
|
||||
|
||||
/* a zombie without shields (the gametype's infection_zombie_shields): a
|
||||
shield capacity of 0, the game's own unshielded unit, which neither takes
|
||||
shield damage nor recharges; a human again (or the option on) gets the
|
||||
unit's capacity back, without healing its body */
|
||||
static void infection_apply_shields(
|
||||
long slot,
|
||||
long unit_index,
|
||||
struct unit_datum *unit,
|
||||
boolean disabled)
|
||||
{
|
||||
if (infection.shield_unit[slot] != unit_index)
|
||||
infection.shield_unit[slot] = NONE;
|
||||
if (disabled)
|
||||
{
|
||||
if (infection.shield_unit[slot] == NONE)
|
||||
{
|
||||
infection.shield_unit[slot] = unit_index;
|
||||
infection.shield_maximum[slot] = unit->object.maximum_shield_vitality;
|
||||
}
|
||||
unit->object.maximum_shield_vitality = 0.0f;
|
||||
unit->object.shield_vitality = 0.0f;
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_charging_bit, FALSE);
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_over_charging_bit, FALSE);
|
||||
SET_FLAG(unit->object.damage_flags, _object_shield_depleted_bit, TRUE);
|
||||
}
|
||||
else if (infection.shield_unit[slot] == unit_index)
|
||||
{
|
||||
unit->object.maximum_shield_vitality = infection.shield_maximum[slot];
|
||||
infection.shield_unit[slot] = NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void infection_reconcile_player(
|
||||
long player_index)
|
||||
{
|
||||
struct game_variant_options const *options = game_variant_options_get();
|
||||
struct distributed_infection_player *role;
|
||||
struct player_datum *player;
|
||||
struct unit_datum *unit;
|
||||
long team;
|
||||
|
||||
if (!infection_enabled() || (role = infection_player(player_index)) == NULL ||
|
||||
role->role == _distributed_infection_role_none)
|
||||
{
|
||||
return;
|
||||
}
|
||||
player = player_get(player_index);
|
||||
team = role->role == _distributed_infection_role_zombie ? 1 : 0;
|
||||
player->team_index = team;
|
||||
player->network_player_data.team_index = (char)team;
|
||||
player->speed_multiplier = team ? options->infection_zombie_speed / 100.0f : 1.0f;
|
||||
if (player->unit_index != NONE && (unit = unit_try_and_get(player->unit_index)) != NULL)
|
||||
{
|
||||
infection_apply_shields(DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index), player->unit_index, unit,
|
||||
team && !options->infection_zombie_shields);
|
||||
unit->object.owner_team_index = (short)team;
|
||||
infection_color_unit(unit, player_index);
|
||||
/* (a living zombie's grenades and powerups gone; a dead one's are its
|
||||
body's, which drops them) */
|
||||
if (team && !TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
{
|
||||
/* (a grenade being wound up when its thrower turned is not thrown:
|
||||
the throw would find no grenade left) */
|
||||
if (unit->unit.grenade_throw_state == _unit_grenade_throw_wind_up)
|
||||
unit->unit.grenade_throw_state = _unit_grenade_throw_ending;
|
||||
csmemset(unit->unit.grenade_counts, 0, sizeof(unit->unit.grenade_counts));
|
||||
csmemset(player->powerup_durations, 0, sizeof(player->powerup_durations));
|
||||
}
|
||||
}
|
||||
/* (and the host's game record, which the lobby and late joins read) */
|
||||
if (!network_game_distributed_client())
|
||||
{
|
||||
struct network_game_server *server = global_network_game_server_get();
|
||||
struct network_game *game = server ? network_game_server_get_game(server) : NULL;
|
||||
long list_index = player->network_player_data.player_list_index;
|
||||
|
||||
if (game && VALID_INDEX(list_index, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
game->players[list_index].team_index = (char)team;
|
||||
}
|
||||
}
|
||||
|
||||
static void infection_delete_weapon(
|
||||
long weapon_index)
|
||||
{
|
||||
long slot;
|
||||
|
||||
for (slot = 0; slot < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; slot++)
|
||||
{
|
||||
if (infection.skull[slot] == weapon_index)
|
||||
infection.skull[slot] = NONE;
|
||||
}
|
||||
if (weapon_index != NONE && object_try_and_get(weapon_index))
|
||||
object_delete(weapon_index);
|
||||
}
|
||||
|
||||
static void infection_delete_skull(
|
||||
long slot)
|
||||
{
|
||||
infection_delete_weapon(infection.skull[slot]);
|
||||
infection.skull[slot] = NONE;
|
||||
}
|
||||
|
||||
/* a unit's weapons gone but the one kept (skulls only: a human's skull
|
||||
picked up), each deleted once */
|
||||
static void infection_strip_weapons(
|
||||
long unit_index,
|
||||
long keep,
|
||||
boolean skulls_only)
|
||||
{
|
||||
struct unit_datum *unit = unit_get(unit_index);
|
||||
long removed[MAXIMUM_WEAPONS_PER_UNIT];
|
||||
long count = 0;
|
||||
long slot;
|
||||
long previous;
|
||||
long kept = NONE;
|
||||
|
||||
for (slot = 0; slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
long weapon_index = unit->unit.weapon_object_indices[slot];
|
||||
|
||||
if (weapon_index == NONE)
|
||||
continue;
|
||||
if (weapon_index == keep && kept == NONE)
|
||||
{
|
||||
kept = slot;
|
||||
continue;
|
||||
}
|
||||
if (skulls_only && !infection_weapon_is_skull(weapon_index))
|
||||
continue;
|
||||
unit->unit.weapon_object_indices[slot] = NONE;
|
||||
if (unit->unit.current_weapon_index == slot)
|
||||
unit->unit.current_weapon_index = NONE;
|
||||
if (unit->unit.desired_weapon_index == slot)
|
||||
unit->unit.desired_weapon_index = NONE;
|
||||
if (weapon_index == keep)
|
||||
continue;
|
||||
for (previous = 0; previous < count && removed[previous] != weapon_index; previous++)
|
||||
{
|
||||
}
|
||||
if (previous == count)
|
||||
removed[count++] = weapon_index;
|
||||
}
|
||||
for (slot = 0; slot < count; slot++)
|
||||
infection_delete_weapon(removed[slot]);
|
||||
if (kept != NONE)
|
||||
unit->unit.desired_weapon_index = (short)kept;
|
||||
else if (unit->unit.desired_weapon_index == NONE)
|
||||
unit->unit.desired_weapon_index = unit_inventory_next_weapon(unit_index, NONE, 0);
|
||||
}
|
||||
|
||||
/* the host gives a living player their role's equipment: a zombie its skull
|
||||
alone (out of any vehicle, without grenades or powerups), a human what they
|
||||
spawned with, without a skull */
|
||||
static void infection_equip(
|
||||
long player_index)
|
||||
{
|
||||
struct player_datum *player = player_get(player_index);
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
struct distributed_infection_player *role = infection_player(player_index);
|
||||
struct unit_datum *unit;
|
||||
long weapon_index;
|
||||
short inventory_slot;
|
||||
|
||||
if (network_game_distributed_client() || !role || player->quit_out_of_game || player->unit_index == NONE ||
|
||||
infection.missing_skull)
|
||||
{
|
||||
return;
|
||||
}
|
||||
unit = unit_get(player->unit_index);
|
||||
if (TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
return;
|
||||
if (infection.equipped_unit[slot] == player->unit_index)
|
||||
{
|
||||
if (role->role == _distributed_infection_role_human)
|
||||
{
|
||||
infection_strip_weapons(player->unit_index, NONE, TRUE);
|
||||
return;
|
||||
}
|
||||
/* (a zombie still holding its skull keeps it; any other weapon goes) */
|
||||
for (inventory_slot = 0; inventory_slot < MAXIMUM_WEAPONS_PER_UNIT; inventory_slot++)
|
||||
{
|
||||
weapon_index = unit->unit.weapon_object_indices[inventory_slot];
|
||||
if (infection_weapon_is_skull(weapon_index))
|
||||
{
|
||||
if (infection.skull[slot] != weapon_index)
|
||||
infection_delete_skull(slot);
|
||||
infection.skull[slot] = weapon_index;
|
||||
infection_strip_weapons(player->unit_index, weapon_index, FALSE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
infection.equipping = TRUE;
|
||||
infection_strip_weapons(player->unit_index, NONE, role->role == _distributed_infection_role_human);
|
||||
infection_delete_skull(slot);
|
||||
if (role->role == _distributed_infection_role_zombie)
|
||||
{
|
||||
if (unit->object.parent_object_index != NONE)
|
||||
unit_exit_seat_end(player->unit_index);
|
||||
csmemset(unit->unit.grenade_counts, 0, sizeof(unit->unit.grenade_counts));
|
||||
if (unit->unit.equipment_object_index != NONE)
|
||||
{
|
||||
object_delete(unit->unit.equipment_object_index);
|
||||
unit->unit.equipment_object_index = NONE;
|
||||
}
|
||||
weapon_index = NONE;
|
||||
if (get_ball_definition_index() != NONE)
|
||||
{
|
||||
struct object_placement_data placement;
|
||||
|
||||
object_placement_data_new(&placement, get_ball_definition_index(), NONE);
|
||||
placement.owner_team_index = 1;
|
||||
weapon_index = object_new(&placement);
|
||||
}
|
||||
if (weapon_index == NONE || !unit_add_weapon_to_inventory(player->unit_index, weapon_index, 2))
|
||||
{
|
||||
if (weapon_index != NONE)
|
||||
object_delete(weapon_index);
|
||||
infection.missing_skull = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
infection.skull[slot] = weapon_index;
|
||||
}
|
||||
}
|
||||
infection.equipping = FALSE;
|
||||
infection.equipped_unit[slot] = player->unit_index;
|
||||
infection.killed_unit[slot] = NONE;
|
||||
}
|
||||
|
||||
/* a player new to the round: a human before the zombies are chosen, a
|
||||
zombie after */
|
||||
static void infection_player_added(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
struct distributed_infection_player *role;
|
||||
|
||||
if (infection.slayer.player_added)
|
||||
infection.slayer.player_added(player_index);
|
||||
if (!VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
return;
|
||||
role = &infection.state.players[slot];
|
||||
if (!network_game_distributed_client())
|
||||
{
|
||||
infection_delete_skull(slot);
|
||||
csmemset(role, 0, sizeof(*role));
|
||||
role->identity = infection_player_identity(player_index);
|
||||
role->role = infection.state.phase >= _distributed_infection_active ? _distributed_infection_role_zombie :
|
||||
_distributed_infection_role_human;
|
||||
infection.participant[slot] = player_index;
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection.killed_unit[slot] = NONE;
|
||||
infection.state.revision++;
|
||||
}
|
||||
infection_reconcile_player(player_index);
|
||||
}
|
||||
|
||||
void infection_postspawn(
|
||||
long player_index)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
|
||||
if (!VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
return;
|
||||
if (!network_game_distributed_client() && infection.participant[slot] != player_index)
|
||||
infection_player_added(player_index);
|
||||
infection_reconcile_player(player_index);
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection_equip(player_index);
|
||||
}
|
||||
|
||||
static void infection_player_killed_player(
|
||||
long killing_player_index,
|
||||
long killing_object_index,
|
||||
long dead_player_index,
|
||||
boolean friendly_fire)
|
||||
{
|
||||
struct distributed_infection_player *dead = infection_player(dead_player_index);
|
||||
struct distributed_infection_player *killer = infection_player(killing_player_index);
|
||||
struct player_datum *player = player_get(dead_player_index);
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(dead_player_index);
|
||||
long unit_index = player->unit_index != NONE ? player->unit_index : player->dead_unit_index;
|
||||
|
||||
(void)killing_object_index;
|
||||
if (network_game_distributed_client() || infection.state.phase != _distributed_infection_active || !dead ||
|
||||
player->quit_out_of_game || infection.killed_unit[slot] != NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
infection.killed_unit[slot] = unit_index == NONE ? 0 : unit_index;
|
||||
if (killer && killer != dead && killer->role != dead->role && killer->score < INFECTION_MAXIMUM_SCORE)
|
||||
killer->score++;
|
||||
/* (a human killed by a zombie, themselves or the world turns; one killed
|
||||
by a human teammate does not) */
|
||||
if (dead->role == _distributed_infection_role_human &&
|
||||
!(friendly_fire && killer && killer != dead && killer->role == dead->role))
|
||||
{
|
||||
dead->role = _distributed_infection_role_zombie;
|
||||
platform_log("infection: player %ld infected", slot);
|
||||
}
|
||||
infection_reconcile_player(dead_player_index);
|
||||
/* (the body's skull is deleted on the player's next tick, once the
|
||||
unit's death has dropped what it held) */
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection.state.revision++;
|
||||
}
|
||||
|
||||
/* the round's result: 0 the humans won, 1 the zombies, 2 no one (everyone
|
||||
left), NONE still on. Turning the last human wins over the time running
|
||||
out on the same tick. */
|
||||
static long infection_round_result(
|
||||
long humans,
|
||||
long zombies,
|
||||
long elapsed,
|
||||
long limit)
|
||||
{
|
||||
if (!humans && !zombies)
|
||||
return 2;
|
||||
if (!humans)
|
||||
return 1;
|
||||
if (!zombies || (limit > 0 && elapsed >= limit))
|
||||
return 0;
|
||||
return NONE;
|
||||
}
|
||||
|
||||
static long infection_time_limit_ticks(
|
||||
void)
|
||||
{
|
||||
return game_variant_options_get()->time_limit * 60L * TICKS_PER_SECOND;
|
||||
}
|
||||
|
||||
static void infection_update(
|
||||
void)
|
||||
{
|
||||
struct game_variant_options const *options = game_variant_options_get();
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
boolean present[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long candidates[HALO_PORT_MAXIMUM_NETWORK_PLAYERS];
|
||||
long humans = 0;
|
||||
long zombies = 0;
|
||||
long count = 0;
|
||||
long index;
|
||||
long now = game_time_get();
|
||||
|
||||
if (infection.slayer.update)
|
||||
infection.slayer.update();
|
||||
if (network_game_distributed_client() || infection.state.phase == _distributed_infection_finished)
|
||||
return;
|
||||
csmemset(present, 0, sizeof(present));
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = (struct player_datum *)data_iterator_next(&iterator)) != NULL)
|
||||
{
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(iterator.datum_index);
|
||||
struct unit_datum *unit;
|
||||
|
||||
if (player->quit_out_of_game || !VALID_INDEX(slot, HALO_PORT_MAXIMUM_NETWORK_PLAYERS))
|
||||
continue;
|
||||
present[slot] = TRUE;
|
||||
if (infection.participant[slot] != iterator.datum_index)
|
||||
infection_player_added(iterator.datum_index);
|
||||
infection_reconcile_player(iterator.datum_index);
|
||||
if (infection.state.players[slot].role == _distributed_infection_role_human)
|
||||
humans++;
|
||||
else
|
||||
zombies++;
|
||||
/* (the first zombies are chosen of the living: a full map can leave
|
||||
players waiting to spawn) */
|
||||
unit = player->unit_index != NONE ? unit_try_and_get(player->unit_index) : NULL;
|
||||
if (unit && !TEST_FLAG(unit->object.damage_flags, _object_dead_bit))
|
||||
candidates[count++] = iterator.datum_index;
|
||||
}
|
||||
for (index = 0; index < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; index++)
|
||||
{
|
||||
if (!present[index] && infection.participant[index] != NONE)
|
||||
{
|
||||
infection_delete_skull(index);
|
||||
infection.participant[index] = NONE;
|
||||
infection.equipped_unit[index] = NONE;
|
||||
infection.killed_unit[index] = NONE;
|
||||
csmemset(&infection.state.players[index], 0, sizeof(infection.state.players[index]));
|
||||
infection.state.revision++;
|
||||
}
|
||||
}
|
||||
if (infection.missing_skull)
|
||||
{
|
||||
platform_log("infection: no skull to give (the map has no Oddball ball), the round ends");
|
||||
infection_finish(NONE);
|
||||
return;
|
||||
}
|
||||
if (infection.state.phase == _distributed_infection_active)
|
||||
{
|
||||
long result = infection_round_result(humans, zombies, now - infection.state.phase_tick,
|
||||
infection_time_limit_ticks());
|
||||
|
||||
if (result != NONE)
|
||||
{
|
||||
platform_log("infection: result %ld, %ld humans, %ld zombies", result, humans, zombies);
|
||||
infection_finish(result == 2 ? NONE : result);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (count < 2)
|
||||
{
|
||||
if (infection.state.phase != _distributed_infection_waiting)
|
||||
infection.state.revision++;
|
||||
infection.state.phase = _distributed_infection_waiting;
|
||||
infection.state.phase_tick = now;
|
||||
return;
|
||||
}
|
||||
if (infection.state.phase == _distributed_infection_waiting)
|
||||
{
|
||||
infection.state.phase = _distributed_infection_countdown;
|
||||
infection.state.phase_tick = now;
|
||||
infection.state.revision++;
|
||||
platform_log("infection: countdown, %ld players", count);
|
||||
}
|
||||
if (now - infection.state.phase_tick < options->infection_countdown * TICKS_PER_SECOND)
|
||||
return;
|
||||
infection.state.phase = _distributed_infection_active;
|
||||
infection.state.phase_tick = now;
|
||||
/* the first zombies, drawn without repeats, leaving a human */
|
||||
for (index = 0; index < MIN(count - 1, options->infection_initial_zombies); index++)
|
||||
{
|
||||
long pick = index + local_random_range(0, (short)(count - index));
|
||||
long chosen = candidates[pick];
|
||||
long slot = DATUM_INDEX_TO_ABSOLUTE_INDEX(chosen);
|
||||
|
||||
candidates[pick] = candidates[index];
|
||||
candidates[index] = chosen;
|
||||
infection.state.players[slot].role = _distributed_infection_role_zombie;
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
infection_reconcile_player(chosen);
|
||||
infection_equip(chosen);
|
||||
}
|
||||
infection.state.revision++;
|
||||
platform_log("infection: active, %ld players, %ld zombies", count,
|
||||
MIN(count - 1, (long)options->infection_initial_zombies));
|
||||
}
|
||||
|
||||
long infection_remaining_ticks(
|
||||
void)
|
||||
{
|
||||
long limit = infection_time_limit_ticks();
|
||||
|
||||
return infection.state.phase == _distributed_infection_active ?
|
||||
MAX(0, limit - (game_time_get() - infection.state.phase_tick)) : limit;
|
||||
}
|
||||
|
||||
static boolean infection_initialize_for_new_map(
|
||||
void)
|
||||
{
|
||||
struct game_variant *variant = game_engine_get_variant();
|
||||
|
||||
csmemset(&infection.state, 0, sizeof(infection.state));
|
||||
csmemset(infection.participant, 0xFF, sizeof(infection.participant));
|
||||
csmemset(infection.equipped_unit, 0xFF, sizeof(infection.equipped_unit));
|
||||
csmemset(infection.killed_unit, 0xFF, sizeof(infection.killed_unit));
|
||||
csmemset(infection.skull, 0xFF, sizeof(infection.skull));
|
||||
csmemset(infection.shield_unit, 0xFF, sizeof(infection.shield_unit));
|
||||
infection.state.winner = NONE;
|
||||
infection.state.game_number = network_game_get_game() ? network_game_get_number_of_games_played() : 0;
|
||||
infection.missing_skull = get_ball_definition_index() == NONE;
|
||||
infection.equipping = FALSE;
|
||||
/* (everyone respawns; the variant's traits give zombies no infinite
|
||||
grenades nor camouflage) */
|
||||
variant->universal_variant.lives = 0;
|
||||
variant->universal_variant.odd_man_out = FALSE;
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_infinite_grenades_bit, FALSE);
|
||||
SET_FLAG(variant->universal_variant.flags, _game_variant_always_invisible_bit, FALSE);
|
||||
return infection.slayer.initialize_for_new_map ? infection.slayer.initialize_for_new_map() : TRUE;
|
||||
}
|
||||
|
||||
/* a skull is picked up only as it is given; a zombie picks up nothing else
|
||||
(and readying the skull it holds asks this too) */
|
||||
static boolean infection_allow_pick_up(
|
||||
long unit_index,
|
||||
long weapon_index)
|
||||
{
|
||||
short slot;
|
||||
|
||||
if (infection.equipping)
|
||||
return TRUE;
|
||||
if (infection_weapon_is_skull(weapon_index))
|
||||
{
|
||||
if (infection_unit_is_zombie(unit_index))
|
||||
{
|
||||
for (slot = 0; slot < MAXIMUM_WEAPONS_PER_UNIT; slot++)
|
||||
{
|
||||
if (unit_get(unit_index)->unit.weapon_object_indices[slot] == weapon_index)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
return !infection_unit_is_zombie(unit_index);
|
||||
}
|
||||
|
||||
static boolean infection_picking_up(
|
||||
long weapon_index,
|
||||
long player_index)
|
||||
{
|
||||
(void)weapon_index;
|
||||
(void)player_index;
|
||||
return infection.equipping;
|
||||
}
|
||||
|
||||
/* a skull dropped (its zombie killed, or forced out of a hand): given again
|
||||
on the next tick, if its zombie lives */
|
||||
static void infection_weapon_dropped(
|
||||
long weapon_index)
|
||||
{
|
||||
long slot;
|
||||
|
||||
if (network_game_distributed_client() || infection.equipping)
|
||||
return;
|
||||
for (slot = 0; slot < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; slot++)
|
||||
{
|
||||
if (infection.skull[slot] == weapon_index)
|
||||
{
|
||||
infection.equipped_unit[slot] = NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void infection_player_update_each_tick(
|
||||
long player_index)
|
||||
{
|
||||
struct player_datum *player = player_get(player_index);
|
||||
|
||||
infection_reconcile_player(player_index);
|
||||
if (network_game_distributed_client())
|
||||
return;
|
||||
/* (a dead zombie's skull deleted once its unit's death has dropped it) */
|
||||
if (player->quit_out_of_game || player->unit_index == NONE ||
|
||||
TEST_FLAG(unit_get(player->unit_index)->object.damage_flags, _object_dead_bit))
|
||||
{
|
||||
infection_delete_skull(DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index));
|
||||
}
|
||||
else
|
||||
{
|
||||
infection_equip(player_index);
|
||||
}
|
||||
}
|
||||
|
||||
static long infection_get_player_score(
|
||||
long player_index,
|
||||
enum get_score_type score_type)
|
||||
{
|
||||
struct distributed_infection_player *role = infection_player(player_index);
|
||||
long slot;
|
||||
long score = 0;
|
||||
|
||||
if (!role)
|
||||
return 0;
|
||||
if (score_type != _get_score_team)
|
||||
return role->score;
|
||||
for (slot = 0; slot < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; slot++)
|
||||
{
|
||||
if (infection.state.players[slot].role == role->role)
|
||||
score += infection.state.players[slot].score;
|
||||
}
|
||||
return score;
|
||||
}
|
||||
|
||||
static wchar_t *infection_format_player_score(
|
||||
long player_index,
|
||||
wchar_t *text)
|
||||
{
|
||||
usprintf(text, L"%ld", infection_get_player_score(player_index, _get_score_individual));
|
||||
return text;
|
||||
}
|
||||
|
||||
/* (a team's score, whatever its name says) */
|
||||
static wchar_t *infection_format_team_score(
|
||||
long team_index,
|
||||
wchar_t *text)
|
||||
{
|
||||
usprintf(text, L"%ld", game_engine_get_team_score(team_index));
|
||||
return text;
|
||||
}
|
||||
|
||||
static long infection_did_player_win(
|
||||
long player_index)
|
||||
{
|
||||
struct distributed_infection_player *role = infection_player(player_index);
|
||||
|
||||
if (infection.state.winner == NONE || !role)
|
||||
return NONE;
|
||||
return (role->role == _distributed_infection_role_zombie ? 1 : 0) == infection.state.winner;
|
||||
}
|
||||
|
||||
struct game_engine *infection_engine_get(
|
||||
struct game_engine const *slayer)
|
||||
{
|
||||
infection.slayer = *slayer;
|
||||
infection.engine = *slayer;
|
||||
infection.engine.initialize_for_new_map = infection_initialize_for_new_map;
|
||||
infection.engine.player_added = infection_player_added;
|
||||
infection.engine.player_update_each_tick = infection_player_update_each_tick;
|
||||
infection.engine.prespawn_player_update = infection_reconcile_player;
|
||||
infection.engine.update = infection_update;
|
||||
infection.engine.allow_pick_up = infection_allow_pick_up;
|
||||
infection.engine.picking_up = infection_picking_up;
|
||||
infection.engine.weapon_dropped = infection_weapon_dropped;
|
||||
infection.engine.player_killed_player = infection_player_killed_player;
|
||||
infection.engine.get_player_score = infection_get_player_score;
|
||||
infection.engine.format_player_score = infection_format_player_score;
|
||||
infection.engine.format_team_name = infection_format_team_score;
|
||||
infection.engine.format_message = NULL;
|
||||
infection.engine.did_player_win = infection_did_player_win;
|
||||
return &infection.engine;
|
||||
}
|
||||
|
||||
/* ---- the state the host sends */
|
||||
|
||||
/* a state a client may take: of this game, no older than its own, every
|
||||
value in range */
|
||||
static boolean infection_state_valid(
|
||||
struct distributed_infection_state const *state,
|
||||
long game_number,
|
||||
long revision)
|
||||
{
|
||||
short index;
|
||||
|
||||
if (state->game_number != game_number || state->revision < revision || state->revision < 0 ||
|
||||
state->phase < _distributed_infection_waiting || state->phase > _distributed_infection_finished ||
|
||||
state->phase_tick < 0 || state->winner < NONE || state->winner > 1 ||
|
||||
(state->phase != _distributed_infection_finished && state->winner != NONE))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
for (index = 0; index < HALO_PORT_MAXIMUM_NETWORK_PLAYERS; index++)
|
||||
{
|
||||
struct distributed_infection_player const *player = &state->players[index];
|
||||
|
||||
if (player->role > _distributed_infection_role_zombie || player->score < 0 ||
|
||||
player->score > INFECTION_MAXIMUM_SCORE || (player->role && !player->identity) ||
|
||||
player->reserved[0] || player->reserved[1] || player->reserved[2])
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
long infection_write_network_state(
|
||||
byte *buffer,
|
||||
long size)
|
||||
{
|
||||
if (size < (long)sizeof(infection.state))
|
||||
return 0;
|
||||
csmemcpy(buffer, &infection.state, sizeof(infection.state));
|
||||
return sizeof(infection.state);
|
||||
}
|
||||
|
||||
boolean infection_read_network_state(
|
||||
byte const *buffer,
|
||||
long size,
|
||||
boolean first)
|
||||
{
|
||||
struct distributed_infection_state state;
|
||||
struct data_iterator iterator;
|
||||
|
||||
if (!network_game_distributed_client() || size != (long)sizeof(state))
|
||||
return FALSE;
|
||||
csmemcpy(&state, buffer, sizeof(state));
|
||||
if (!infection_state_valid(&state, network_game_get_number_of_games_played(), first ? 0 : infection.state.revision))
|
||||
return FALSE;
|
||||
infection.state = state;
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while (data_iterator_next(&iterator))
|
||||
infection_reconcile_player(iterator.datum_index);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/* infection.h: Infection, a mode of team Slayer (port/linux/game/infection.c) */
|
||||
#ifndef HALO_INFECTION_H
|
||||
#define HALO_INFECTION_H
|
||||
|
||||
struct game_engine;
|
||||
union real_vector3d;
|
||||
|
||||
/* the game being played is Infection (game_modes_mode's) */
|
||||
boolean infection_enabled(void);
|
||||
/* Slayer's engine with Infection's rules (game_modes_engine) */
|
||||
struct game_engine *infection_engine_get(struct game_engine const *slayer);
|
||||
/* a player spawned: a zombie's skull (game_modes_postspawn) */
|
||||
void infection_postspawn(long player_index);
|
||||
|
||||
/* a living zombie's unit */
|
||||
boolean infection_unit_is_zombie(long unit_index);
|
||||
/* a player may drop the weapon (a zombie keeps its skull: players.c, units.c) */
|
||||
boolean infection_allow_weapon_drop(long unit_index, long weapon_index);
|
||||
/* the skull may be deleted (weapons.c's and objects.c's checks that a
|
||||
game's objective is not) */
|
||||
boolean infection_can_delete_skull(long object_index);
|
||||
/* a unit's melee damage multiplier: a zombie's skull's */
|
||||
real infection_melee_multiplier(long unit_index);
|
||||
/* a zombie's melee hits a human riding in an open seat, not the vehicle
|
||||
(unit_cause_player_melee_damage) */
|
||||
boolean infection_melee_rider_target(long attacker_index, long target_index);
|
||||
/* ... which the host checks of a client's report: its own line from the
|
||||
attacker's head to the rider (network_damage.c) */
|
||||
boolean infection_melee_rider_visible(long attacker_index, long target_index, union real_vector3d const *direction);
|
||||
/* a player's team, speed and shields as their role has them (a unit
|
||||
attached: network_player_attach_unit) */
|
||||
void infection_reconcile_player(long player_index);
|
||||
/* the round's time left (the score's title) */
|
||||
long infection_remaining_ticks(void);
|
||||
/* the state the host sends its clients (game_engine_write_network_state) */
|
||||
long infection_write_network_state(byte *buffer, long size);
|
||||
boolean infection_read_network_state(byte const *buffer, long size, boolean first);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
LATENCY_METER.C
|
||||
|
||||
The latency meter of a network game (display.latency_meter, off by
|
||||
default): this machine's round trip to the host, "Ping 45 ms" with four
|
||||
bars, green below 80 ms, yellow below 150, red from 150, at the screen's top
|
||||
right under the shields while a game is played (the frame rate counter is at
|
||||
the bottom right, a map's download at the top). With the meter on, the
|
||||
scoreboard's pings are drawn in the same colours, and where this machine
|
||||
times a player's round trip itself (the host: every client's; a client: its
|
||||
own players'), the scoreboard shows that, so it agrees with the meter; the
|
||||
others are the host's measure in ticks, which every machine is sent
|
||||
(game_engine.c).
|
||||
|
||||
What it shows is the distributed netcode's own round trip (NETCODE.md),
|
||||
timed in milliseconds rather than ticks (network_distributed.c): nothing is
|
||||
sent for it, so it is the same over system link, internet play's tunnel
|
||||
and a browser's WebRTC data channel.
|
||||
|
||||
- A client: its players' input names the host's latest tick it had, and the
|
||||
host's state of its player names the client's tick the host has it at
|
||||
(its own prediction come back; driving, its vehicle's). The time since
|
||||
this machine sent that tick is the round trip: the network both ways, and
|
||||
each machine's wait for its next tick to send what it had (up to a tick,
|
||||
33 ms, each; on a LAN 15 to 35 ms in all). A client that has heard nothing
|
||||
from the host for two seconds shows "Connection problem", pulsing,
|
||||
instead.
|
||||
- The host: its clients' round trips, timed the same way by when it sent
|
||||
the tick each client's input names. It shows "Max ping", its slowest
|
||||
client's (one silent for a while, as long as it has been); alone,
|
||||
nothing.
|
||||
|
||||
Never shown in the menus, a game over, a co-op cutscene (but a connection
|
||||
problem), or a game the host plays alone.
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "cutscene/cinematics.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_engine.h"
|
||||
#include "interface/interface.h"
|
||||
#include "rasterizer/rasterizer.h"
|
||||
#include "render/render.h"
|
||||
#include "text/draw_string.h"
|
||||
#include "text/font_group.h"
|
||||
#include "network_distributed.h"
|
||||
#include "latency_meter.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* ---------- constants */
|
||||
|
||||
enum
|
||||
{
|
||||
/* the colours' bounds (milliseconds): green below the first, yellow
|
||||
below the second, red from it; four bars below the first, three below
|
||||
the second, two below the third, one */
|
||||
LATENCY_GOOD_MILLISECONDS = 80,
|
||||
LATENCY_FAIR_MILLISECONDS = 150,
|
||||
LATENCY_POOR_MILLISECONDS = 250,
|
||||
LATENCY_BARS = 4,
|
||||
/* the longest shown */
|
||||
LATENCY_MAXIMUM_MILLISECONDS = 9999,
|
||||
/* the meter's right edge from the screen's, its bars' width and gap,
|
||||
and the gap between the bars and the text (the HUD's 480 lines) */
|
||||
LATENCY_RIGHT_MARGIN = 12,
|
||||
LATENCY_BAR_WIDTH = 4,
|
||||
LATENCY_BAR_GAP = 1,
|
||||
LATENCY_TEXT_GAP = 4,
|
||||
/* draw_string.c's right-justified text (its enum is its own) */
|
||||
_latency_text_right = 1,
|
||||
};
|
||||
|
||||
/* its top: this share of the screen's height down, clear of the shields
|
||||
and health at the top right */
|
||||
#define LATENCY_TOP_FRACTION 0.15f
|
||||
|
||||
/* ---------- prototypes */
|
||||
|
||||
/* port_config.c's, cseries_windows.c's, cinematics.c's */
|
||||
int config_boolean(const char *name);
|
||||
unsigned long config_changes(void);
|
||||
unsigned long system_milliseconds(void);
|
||||
void draw_quad(rectangle2d *rectangle, pixel32 color);
|
||||
|
||||
/* ---------- private code */
|
||||
|
||||
static pixel32 latency_pixel(
|
||||
real_argb_color const *color)
|
||||
{
|
||||
return ((pixel32)(PIN(color->alpha, 0.0f, 1.0f) * 255.0f + 0.5f) << 24) |
|
||||
((pixel32)(PIN(color->red, 0.0f, 1.0f) * 255.0f + 0.5f) << 16) |
|
||||
((pixel32)(PIN(color->green, 0.0f, 1.0f) * 255.0f + 0.5f) << 8) |
|
||||
(pixel32)(PIN(color->blue, 0.0f, 1.0f) * 255.0f + 0.5f);
|
||||
}
|
||||
|
||||
/* ... and over the screen: not over a co-op cutscene (but a connection
|
||||
problem) */
|
||||
static boolean latency_meter_drawn(
|
||||
void)
|
||||
{
|
||||
return latency_meter_shown() && (!cinematic_in_progress() || distributed_connection_problem());
|
||||
}
|
||||
|
||||
/* ---------- public code */
|
||||
|
||||
boolean latency_meter_enabled(
|
||||
void)
|
||||
{
|
||||
static unsigned long changes = (unsigned long)-1;
|
||||
static boolean enabled = FALSE;
|
||||
|
||||
if (changes != config_changes())
|
||||
{
|
||||
changes = config_changes();
|
||||
enabled = config_boolean("display.latency_meter") != 0;
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
|
||||
boolean latency_meter_shown(
|
||||
void)
|
||||
{
|
||||
short connection = game_connection();
|
||||
|
||||
return (connection == _game_connection_network_client || connection == _game_connection_network_server) &&
|
||||
latency_meter_enabled() && game_in_progress() && game_engine_in_play();
|
||||
}
|
||||
|
||||
short latency_meter_color(
|
||||
long milliseconds,
|
||||
real_argb_color *color)
|
||||
{
|
||||
short bars;
|
||||
|
||||
color->alpha = 1.0f;
|
||||
if (milliseconds < LATENCY_GOOD_MILLISECONDS)
|
||||
{
|
||||
bars = 4;
|
||||
color->red = 0.35f;
|
||||
color->green = 1.0f;
|
||||
color->blue = 0.35f;
|
||||
}
|
||||
else if (milliseconds < LATENCY_FAIR_MILLISECONDS)
|
||||
{
|
||||
bars = 3;
|
||||
color->red = 1.0f;
|
||||
color->green = 0.85f;
|
||||
color->blue = 0.25f;
|
||||
}
|
||||
else
|
||||
{
|
||||
bars = milliseconds < LATENCY_POOR_MILLISECONDS ? 2 : 1;
|
||||
color->red = 1.0f;
|
||||
color->green = 0.3f;
|
||||
color->blue = 0.3f;
|
||||
}
|
||||
return bars;
|
||||
}
|
||||
|
||||
long latency_meter_player_ping(
|
||||
short player_index)
|
||||
{
|
||||
long ping = latency_meter_shown() ? distributed_player_measured_ping(player_index) : NONE;
|
||||
|
||||
return ping != NONE ? ping : distributed_player_ping(player_index);
|
||||
}
|
||||
|
||||
void latency_meter_draw(
|
||||
void)
|
||||
{
|
||||
long font_index;
|
||||
struct font_header *font;
|
||||
short line_height;
|
||||
short bar_height;
|
||||
short top;
|
||||
short right;
|
||||
short bars = 0;
|
||||
short index;
|
||||
long ping;
|
||||
char text[32];
|
||||
real_argb_color color;
|
||||
rectangle2d bounds;
|
||||
|
||||
if (!latency_meter_drawn())
|
||||
return;
|
||||
font_index = interface_get_tag_index(_interface_font_terminal);
|
||||
if (font_index == NONE)
|
||||
return;
|
||||
font = font_definition_get(font_index);
|
||||
line_height = (short)(font->ascending_height + font->descending_height + font->leading_height);
|
||||
if (line_height <= 0)
|
||||
return;
|
||||
if (game_connection() == _game_connection_network_server)
|
||||
{
|
||||
/* (the host: its slowest client's; alone, nothing) */
|
||||
ping = distributed_slowest_client_ping();
|
||||
if (ping == NONE)
|
||||
return;
|
||||
bars = latency_meter_color(ping, &color);
|
||||
snprintf(text, sizeof(text), "Max ping %ld ms", MIN(ping, (long)LATENCY_MAXIMUM_MILLISECONDS));
|
||||
}
|
||||
else if (distributed_connection_problem())
|
||||
{
|
||||
/* (pulsing, the bars empty) */
|
||||
color.alpha = system_milliseconds() % 1000 < 500 ? 1.0f : 0.45f;
|
||||
color.red = 1.0f;
|
||||
color.green = 0.3f;
|
||||
color.blue = 0.3f;
|
||||
snprintf(text, sizeof(text), "Connection problem");
|
||||
}
|
||||
else
|
||||
{
|
||||
ping = distributed_own_ping();
|
||||
if (ping == NONE)
|
||||
{
|
||||
color.alpha = 1.0f;
|
||||
color.red = color.green = color.blue = 0.6f;
|
||||
snprintf(text, sizeof(text), "Ping -- ms");
|
||||
}
|
||||
else
|
||||
{
|
||||
bars = latency_meter_color(ping, &color);
|
||||
snprintf(text, sizeof(text), "Ping %ld ms", MIN(ping, (long)LATENCY_MAXIMUM_MILLISECONDS));
|
||||
}
|
||||
}
|
||||
|
||||
bounds = render.camera.window_bounds;
|
||||
offset_rectangle2d(&bounds, (short)-render.camera.viewport_bounds.x0, (short)-render.camera.viewport_bounds.y0);
|
||||
top = (short)(bounds.y0 + (bounds.y1 - bounds.y0) * LATENCY_TOP_FRACTION);
|
||||
right = (short)(bounds.x1 - LATENCY_RIGHT_MARGIN);
|
||||
/* the bars, drawn quads rising left to right, at the right: lit as many
|
||||
as earned, the rest dim */
|
||||
bar_height = (short)MAX(line_height - 4, 4);
|
||||
for (index = 0; index < LATENCY_BARS; index++)
|
||||
{
|
||||
rectangle2d bar;
|
||||
real_argb_color bar_color = color;
|
||||
short height = (short)(bar_height * (index + 1) / LATENCY_BARS);
|
||||
|
||||
if (index >= bars)
|
||||
{
|
||||
bar_color.red = bar_color.green = bar_color.blue = 0.25f;
|
||||
bar_color.alpha = 0.6f * color.alpha;
|
||||
}
|
||||
bar.x0 = (short)(right - (LATENCY_BARS - index) * (LATENCY_BAR_WIDTH + LATENCY_BAR_GAP) + LATENCY_BAR_GAP);
|
||||
bar.x1 = (short)(bar.x0 + LATENCY_BAR_WIDTH);
|
||||
bar.y1 = (short)(top + line_height - 2);
|
||||
bar.y0 = (short)(bar.y1 - height);
|
||||
draw_quad(&bar, latency_pixel(&bar_color));
|
||||
}
|
||||
/* the text, right-justified to their left */
|
||||
bounds.x1 = (short)(right - LATENCY_BARS * (LATENCY_BAR_WIDTH + LATENCY_BAR_GAP) - LATENCY_TEXT_GAP);
|
||||
bounds.y0 = top;
|
||||
bounds.y1 = (short)(top + line_height);
|
||||
draw_string_set_draw_mode(font_index, NONE, _latency_text_right, 0, &color);
|
||||
rasterizer_draw_string(&bounds, NULL, NULL, 0, text);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
LATENCY_METER.H
|
||||
|
||||
A network game's round trip to the host, at the screen's top right while
|
||||
the game is played (display.latency_meter: latency_meter.c).
|
||||
*/
|
||||
|
||||
#ifndef __LATENCY_METER_H
|
||||
#define __LATENCY_METER_H
|
||||
|
||||
/* display.latency_meter */
|
||||
boolean latency_meter_enabled(void);
|
||||
/* ... and a network game being played */
|
||||
boolean latency_meter_shown(void);
|
||||
/* a round trip's colour (green, yellow or red), and the bars it earns (4
|
||||
to 1) */
|
||||
short latency_meter_color(long milliseconds, real_argb_color *color);
|
||||
/* (the scoreboard, game_engine.c) a player's ping in milliseconds, NONE for
|
||||
not known: with the meter shown, as this machine times it where it does,
|
||||
else distributed_player_ping's */
|
||||
long latency_meter_player_ping(short player_index);
|
||||
/* (interface.c's overlays, over the whole screen) */
|
||||
void latency_meter_draw(void);
|
||||
|
||||
#endif
|
||||
@@ -82,6 +82,7 @@ hashing thread allocates what the game's thread frees) */
|
||||
network_server_manager.c's, cseries_windows.c's */
|
||||
int config_boolean(const char *name);
|
||||
long config_integer(const char *name);
|
||||
const char *config_string(const char *name);
|
||||
boolean network_distributed_client_send_reliably(void *message, word size);
|
||||
boolean network_distributed_server_send_to_machine_reliably(long machine_index, void *message, word size);
|
||||
unsigned long network_game_server_machine_address(long machine_index);
|
||||
@@ -1035,9 +1036,16 @@ static void connection_close(
|
||||
return;
|
||||
if (reason || connection->bytes_in || connection->bytes_out)
|
||||
{
|
||||
error(_error_silent, "map sharing: the connection with %d.%d.%d.%d closed: %s (%lu bytes in, %lu out)",
|
||||
(int)(connection->address >> 24), (int)(connection->address >> 16 & 255),
|
||||
(int)(connection->address >> 8 & 255), (int)(connection->address & 255), reason ? reason : "done",
|
||||
unsigned char bytes[4];
|
||||
char address[56];
|
||||
|
||||
/* (a public address as a tag: log_address.h) */
|
||||
bytes[0] = (unsigned char)(connection->address >> 24);
|
||||
bytes[1] = (unsigned char)(connection->address >> 16);
|
||||
bytes[2] = (unsigned char)(connection->address >> 8);
|
||||
bytes[3] = (unsigned char)connection->address;
|
||||
error(_error_silent, "map sharing: the connection with %s closed: %s (%lu bytes in, %lu out)",
|
||||
log_address(bytes, 4, -1, address, sizeof(address)), reason ? reason : "done",
|
||||
connection->bytes_in, connection->bytes_out);
|
||||
}
|
||||
if (connection->source != NONE && connection->source < download->source_count)
|
||||
@@ -1831,6 +1839,124 @@ static void download_unfinish(
|
||||
custom_edition_maps_look_again();
|
||||
}
|
||||
|
||||
/* ---------- downloaded maps
|
||||
|
||||
The maps map sharing downloaded are named, a file name a line, in
|
||||
DOWNLOADED_MAPS_FILE beside them in custom_maps: their scripts are held to
|
||||
tighter rules (hs.c's hs_scenario_functions_check) in this run and the ones
|
||||
after it. game.downloaded_maps names more, by the names the game loads maps
|
||||
by, or "*" for all. */
|
||||
|
||||
#define DOWNLOADED_MAPS_FILE "downloaded_maps.txt"
|
||||
|
||||
/* the list's path beside a map's file */
|
||||
static boolean downloaded_maps_list_path(
|
||||
char const *map_path,
|
||||
char *list_path,
|
||||
long size)
|
||||
{
|
||||
char const *slash = strrchr(map_path, '\\');
|
||||
char const *other = strrchr(map_path, '/');
|
||||
long folder_length;
|
||||
|
||||
if (other && (!slash || other > slash))
|
||||
slash = other;
|
||||
folder_length = slash ? (long)(slash - map_path) + 1 : 0;
|
||||
if (folder_length + (long)sizeof(DOWNLOADED_MAPS_FILE) > size)
|
||||
return FALSE;
|
||||
csmemcpy(list_path, map_path, folder_length);
|
||||
csstrncpy(list_path + folder_length, DOWNLOADED_MAPS_FILE, size - folder_length - 1);
|
||||
list_path[size - 1] = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* a map file's name (past its folder) */
|
||||
static char const *downloaded_maps_file_name(
|
||||
char const *map_path)
|
||||
{
|
||||
char const *slash = strrchr(map_path, '\\');
|
||||
char const *other = strrchr(map_path, '/');
|
||||
|
||||
if (other && (!slash || other > slash))
|
||||
slash = other;
|
||||
return slash ? slash + 1 : map_path;
|
||||
}
|
||||
|
||||
/* whether the list beside a map's file names it */
|
||||
static boolean downloaded_maps_listed(
|
||||
char const *map_path)
|
||||
{
|
||||
char list_path[MAP_SHARE_PATH_SIZE];
|
||||
char line[MAP_SHARE_PATH_SIZE];
|
||||
char const *name = downloaded_maps_file_name(map_path);
|
||||
boolean listed = FALSE;
|
||||
FILE *stream;
|
||||
|
||||
if (!downloaded_maps_list_path(map_path, list_path, sizeof(list_path)))
|
||||
return FALSE;
|
||||
stream = fopen(list_path, "rb");
|
||||
if (!stream)
|
||||
return FALSE;
|
||||
while (!listed && fgets(line, sizeof(line), stream))
|
||||
{
|
||||
line[strcspn(line, "\r\n")] = 0;
|
||||
listed = line[0] && !csstrcasecmp(line, name);
|
||||
}
|
||||
fclose(stream);
|
||||
return listed;
|
||||
}
|
||||
|
||||
/* a map file map sharing downloaded, named in the list beside it */
|
||||
static void downloaded_maps_mark(
|
||||
char const *map_path)
|
||||
{
|
||||
char list_path[MAP_SHARE_PATH_SIZE];
|
||||
FILE *stream;
|
||||
|
||||
if (downloaded_maps_listed(map_path) ||
|
||||
!downloaded_maps_list_path(map_path, list_path, sizeof(list_path)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
stream = fopen(list_path, "ab");
|
||||
if (!stream)
|
||||
{
|
||||
error(_error_silent, "map sharing: could not name %s in %s", downloaded_maps_file_name(map_path), list_path);
|
||||
return;
|
||||
}
|
||||
fprintf(stream, "%s\r\n", downloaded_maps_file_name(map_path));
|
||||
fclose(stream);
|
||||
}
|
||||
|
||||
/* (halo_linux_source_fixups.h) */
|
||||
int map_share_map_downloaded(
|
||||
char const *map_name)
|
||||
{
|
||||
char const *setting = config_string("game.downloaded_maps");
|
||||
char const *path = custom_edition_cache_loaded_path();
|
||||
char const *stripped;
|
||||
|
||||
if (path && downloaded_maps_listed(path))
|
||||
return TRUE;
|
||||
if (!map_name || !*map_name)
|
||||
return FALSE;
|
||||
stripped = tag_name_strip_path(map_name);
|
||||
/* (game.downloaded_maps: names separated by commas or spaces, or "*") */
|
||||
while (setting && *setting)
|
||||
{
|
||||
long length = (long)strcspn(setting, ", ");
|
||||
|
||||
if ((length == 1 && *setting == '*') ||
|
||||
(length > 0 && (long)strlen(stripped) == length && !_strnicmp(setting, stripped, length)))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
setting += length;
|
||||
setting += strspn(setting, ", ");
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* the download's files, all had: renamed, the map checked (each deleted
|
||||
again if it cannot be played) */
|
||||
static void download_finish(
|
||||
@@ -1869,6 +1995,12 @@ static void download_finish(
|
||||
return;
|
||||
}
|
||||
error(_error_silent, "map sharing: downloaded %s (%lu bytes)", download->level_name, download->done_bytes);
|
||||
/* (its scripts held to tighter rules: downloaded_maps_mark) */
|
||||
for (index = 0; index < download->file_count; index++)
|
||||
{
|
||||
if (download->files[index].kind == _map_share_file_map)
|
||||
downloaded_maps_mark(download->files[index].final_path);
|
||||
}
|
||||
download_report(_progress_done);
|
||||
/* (sent on to the others from here, without hashing them again) */
|
||||
for (index = 0; index < download->file_count; index++)
|
||||
|
||||
@@ -81,6 +81,7 @@ their handlers open opens.
|
||||
#include "halo_menus.h"
|
||||
#include "custom_edition_cache.h"
|
||||
#include "custom_edition_maps.h"
|
||||
#include "game_modes.h"
|
||||
#include "network_voice.h"
|
||||
#include "text/draw_string.h"
|
||||
/* (internet play's server browser: the platform layer's) */
|
||||
@@ -106,6 +107,7 @@ void platform_display_apply(void);
|
||||
void platform_binding_capture_begin(void);
|
||||
int platform_binding_capture_poll(int *input);
|
||||
void halo_input_name(int input, char *name, unsigned int size);
|
||||
void halo_input_shown_name(char const *binding, char *shown, unsigned int size);
|
||||
short pc_menu_string_index(long definition_index);
|
||||
/* cseries_windows.c's */
|
||||
unsigned long system_milliseconds(void);
|
||||
@@ -578,6 +580,7 @@ reached, and (map_data) a saved game on the level */
|
||||
#define ROW_TEXT_LENGTH 64
|
||||
#define MAXIMUM_PROFILES 32
|
||||
#define SOUND_ERROR 4
|
||||
#define SOUND_CURSOR 1
|
||||
#define SOUND_FORWARD 2
|
||||
#define SOUND_BACK 3
|
||||
|
||||
@@ -988,6 +991,8 @@ static short map_kind_first(short chosen, short count)
|
||||
return (short)PIN(chosen - MAP_KIND_ROWS / 2, 0, MAX(count - MAP_KIND_ROWS, 0));
|
||||
}
|
||||
|
||||
static boolean list_scrolls_at_end(void);
|
||||
|
||||
static void map_kind_focus(struct widget_instance *list, short first, short chosen)
|
||||
{
|
||||
focus_row(list, (short)(1 + chosen - first));
|
||||
@@ -1003,12 +1008,12 @@ static short map_kind_rows_update(struct widget_instance *list, short *first, sh
|
||||
short row = focused_row(list), index = 0;
|
||||
struct widget_instance *child;
|
||||
|
||||
if (row != NONE && row >= 1 && row == shown && *first + shown < count)
|
||||
if (row != NONE && row >= 1 && row == shown && *first + shown < count && list_scrolls_at_end())
|
||||
{
|
||||
(*first)++;
|
||||
focus_row(list, --row);
|
||||
}
|
||||
else if (row == 1 && *first > 0)
|
||||
else if (row == 1 && *first > 0 && list_scrolls_at_end())
|
||||
{
|
||||
(*first)--;
|
||||
focus_row(list, ++row);
|
||||
@@ -1213,11 +1218,17 @@ static void level_list_update(struct widget_instance *list)
|
||||
|
||||
/* "solo level set map": the level shown, if reached, or the Custom Edition
|
||||
campaign map, for the difficulty menu; or the multiplayer map, played at
|
||||
once (FALSE: no difficulty menu) */
|
||||
static boolean level_choose(short controller)
|
||||
once (FALSE: no difficulty menu). The list is read again first: a tap on
|
||||
the touchscreen focuses a row and activates it at once, before the list's
|
||||
update has read which row it is (it started the level shown before, Pillar
|
||||
of Autumn on a new profile). The map and gametype lists do the same. */
|
||||
static boolean level_choose(struct widget_instance *list, short controller)
|
||||
{
|
||||
short level = campaign.shown_level;
|
||||
short count = map_kind_count(level_list.kind, level_list.map_count);
|
||||
short level, count;
|
||||
|
||||
level_list_update(list);
|
||||
level = campaign.shown_level;
|
||||
count = map_kind_count(level_list.kind, level_list.map_count);
|
||||
|
||||
if (level_list.kind != MAP_KIND_SINGLEPLAYER && (level_list.chosen < 0 || level_list.chosen >= count))
|
||||
return campaign_fail();
|
||||
@@ -1590,6 +1601,7 @@ static boolean color_list_initialize(struct widget_instance *list)
|
||||
|
||||
/* (ui_widget.c) whether the pointer moved the menus' focus last */
|
||||
boolean ui_widget_port_pointer_focused(void);
|
||||
boolean ui_widget_port_hover_focused(void);
|
||||
|
||||
/* Whether a list whose focus is on its first or last row moves on: when the
|
||||
d-pad put it there. The pointer resting there would make it move every
|
||||
@@ -1657,20 +1669,23 @@ BITMAP_FRAMES): Gamepad Setup's row's, as the list numbers its rows
|
||||
the PC version's nine the Xbox's five of the button settings */
|
||||
#define PROFILE_GAMEPAD_FRAME 2
|
||||
#define PROFILE_FIRST_LAYOUT_FRAME 9
|
||||
#define PROFILE_LAYOUT_FRAMES (_button_preset_swap_b_and_right_thumb + 1)
|
||||
|
||||
/* "port gamepad layout preview" (the picture's own): on Gamepad Setup's
|
||||
row, the edited profile's button settings */
|
||||
row, the edited profile's button settings; the port's own (Bumper Jumper),
|
||||
of which the Xbox has no picture, keeps the row's */
|
||||
static void profile_gamepad_layout(struct widget_instance *picture)
|
||||
{
|
||||
struct player_profile *profile = player_ui_get_edit_player_profile();
|
||||
short frame = picture->animation.current_frame_index;
|
||||
|
||||
if (frame == PROFILE_GAMEPAD_FRAME ||
|
||||
(frame >= PROFILE_FIRST_LAYOUT_FRAME && frame < PROFILE_FIRST_LAYOUT_FRAME + NUMBER_OF_BUTTON_PRESETS))
|
||||
(frame >= PROFILE_FIRST_LAYOUT_FRAME && frame < PROFILE_FIRST_LAYOUT_FRAME + PROFILE_LAYOUT_FRAMES))
|
||||
{
|
||||
picture->animation.current_frame_index = (short)(PROFILE_FIRST_LAYOUT_FRAME +
|
||||
(profile && profile->controller_settings.button_preset < NUMBER_OF_BUTTON_PRESETS ?
|
||||
profile->controller_settings.button_preset : _button_preset_standard));
|
||||
byte preset = profile ? profile->controller_settings.button_preset : (byte)_button_preset_standard;
|
||||
|
||||
picture->animation.current_frame_index = preset < PROFILE_LAYOUT_FRAMES ?
|
||||
(short)(PROFILE_FIRST_LAYOUT_FRAME + preset) : PROFILE_GAMEPAD_FRAME;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2172,15 +2187,21 @@ static void controls_update(struct widget_instance *list)
|
||||
{
|
||||
char const *binding = controls_screen.bindings[control][slot];
|
||||
wchar_t text[ROW_TEXT_LENGTH];
|
||||
char name[CONTROL_NAME_LENGTH];
|
||||
char shown[64];
|
||||
short index;
|
||||
|
||||
/* (the key as the keyboard's layout labels it: xinput_sdl.c) */
|
||||
if (*binding)
|
||||
halo_input_shown_name(binding, name, sizeof(name));
|
||||
else
|
||||
snprintf(name, sizeof(name), "%s", "-");
|
||||
if (controls_screen.capturing_control == control && controls_screen.capturing_slot == slot)
|
||||
snprintf(shown, sizeof(shown), "%s", "PRESS A KEY");
|
||||
else if (row == focused_row && controls_screen.slot == slot)
|
||||
snprintf(shown, sizeof(shown), "> %s <", *binding ? binding : "-");
|
||||
snprintf(shown, sizeof(shown), "> %s <", name);
|
||||
else
|
||||
snprintf(shown, sizeof(shown), "%s", *binding ? binding : "-");
|
||||
snprintf(shown, sizeof(shown), "%s", name);
|
||||
for (index = 0; shown[index] && index < ROW_TEXT_LENGTH - 1; index++)
|
||||
text[index] = (wchar_t)(unsigned char)shown[index];
|
||||
text[index] = 0;
|
||||
@@ -2737,6 +2758,7 @@ boolean ui_widget_port_unjoin_player(struct widget_instance *widget, struct even
|
||||
void network_game_server_port_set_settings(wchar_t const *name, long maximum_players);
|
||||
void network_game_server_port_set_cooperative_friendly_fire(short friendly_fire);
|
||||
void network_game_server_port_set_cooperative_player_collisions(boolean player_collisions);
|
||||
void network_game_server_port_set_cooperative_ally_friendly_fire(boolean ally_friendly_fire);
|
||||
void *global_network_game_client_get(void);
|
||||
void *global_network_game_server_get(void);
|
||||
boolean network_game_is_splitscreen_local(void);
|
||||
@@ -2750,6 +2772,7 @@ short network_game_client_get_seconds_to_game_start(void *client);
|
||||
boolean network_player_is_valid(struct network_player *player);
|
||||
boolean playlist_profile_get(long index, struct game_variant *variant);
|
||||
boolean playlist_profile_get_display_name(long index, wchar_t *name);
|
||||
boolean playlist_profile_get_options(long index, struct game_variant_options *options);
|
||||
boolean input_get_key(struct key_stroke *key);
|
||||
boolean game_engine_running(void);
|
||||
void game_engine_end_game(void);
|
||||
@@ -2782,7 +2805,7 @@ static struct
|
||||
/* Create Game's gametype list */
|
||||
long gametypes[MAXIMUM_GAMETYPES];
|
||||
short gametype_count;
|
||||
/* (those of the bank the list's spinner shows: STANDARD, CUSTOM) */
|
||||
/* (those of the bank the list's spinner shows: STANDARD, OPENCE, CUSTOM) */
|
||||
short bank[MAXIMUM_GAMETYPES], bank_count, bank_shown;
|
||||
short gametype_first, gametype_chosen;
|
||||
/* the server settings */
|
||||
@@ -3163,7 +3186,10 @@ difficulties, or the level at the difficulty chosen. FALSE stays on the Map
|
||||
screen (the gametypes open on TRUE). */
|
||||
static boolean map_list_choose(struct widget_instance *list, boolean *widget_deleted)
|
||||
{
|
||||
short chosen = map_list.chosen;
|
||||
short chosen;
|
||||
|
||||
map_list_update(list);
|
||||
chosen = map_list.chosen;
|
||||
|
||||
if (chosen >= map_step_count())
|
||||
return campaign_fail();
|
||||
@@ -3210,8 +3236,33 @@ static void gametype_setup_end(void);
|
||||
static boolean gametype_setup_apply(void);
|
||||
static void gametype_setup_type(wchar_t *text);
|
||||
|
||||
/* ---- the gametype list: its spinner's bank (STANDARD: the built-in ones,
|
||||
CUSTOM: those saved) in its first row, then the bank's gametypes */
|
||||
/* ---- the gametype list: its spinner's bank (STANDARD: the Xbox's built-in
|
||||
ones, OPENCE: OpenCE's built-in ones, game_modes.c, CUSTOM: those saved) in
|
||||
its first row, then the bank's gametypes */
|
||||
|
||||
enum
|
||||
{
|
||||
GAMETYPE_BANK_STANDARD = 0,
|
||||
GAMETYPE_BANK_OPENCE,
|
||||
GAMETYPE_BANK_CUSTOM,
|
||||
NUMBER_OF_GAMETYPE_BANKS
|
||||
};
|
||||
|
||||
/* a gametype's bank */
|
||||
static short gametype_bank(long profile_index)
|
||||
{
|
||||
struct game_variant variant;
|
||||
struct game_variant_options options;
|
||||
|
||||
if (!((unsigned long)profile_index & PLAYLIST_READ_ONLY_BIT))
|
||||
return GAMETYPE_BANK_CUSTOM;
|
||||
if (playlist_profile_get(profile_index, &variant) && playlist_profile_get_options(profile_index, &options) &&
|
||||
game_modes_variant_is_opence(&variant, &options))
|
||||
{
|
||||
return GAMETYPE_BANK_OPENCE;
|
||||
}
|
||||
return GAMETYPE_BANK_STANDARD;
|
||||
}
|
||||
|
||||
static void gametype_bank_read(short bank)
|
||||
{
|
||||
@@ -3221,15 +3272,48 @@ static void gametype_bank_read(short bank)
|
||||
multiplayer.bank_count = 0;
|
||||
for (index = 0; index < multiplayer.gametype_count; index++)
|
||||
{
|
||||
boolean standard = ((unsigned long)multiplayer.gametypes[index] & PLAYLIST_READ_ONLY_BIT) != 0;
|
||||
|
||||
if (standard == (bank == 0))
|
||||
if (gametype_bank(multiplayer.gametypes[index]) == bank)
|
||||
multiplayer.bank[multiplayer.bank_count++] = index;
|
||||
}
|
||||
multiplayer.gametype_first = 0;
|
||||
multiplayer.gametype_chosen = 0;
|
||||
}
|
||||
|
||||
/* a gametype's kind and rules, for the description beside a list: its game
|
||||
engine's name (or its OpenCE gametype's), teams, and what wins */
|
||||
static void gametype_rules_text(long profile_index, wchar_t *text, short size)
|
||||
{
|
||||
struct game_variant variant;
|
||||
struct game_variant_options options;
|
||||
wchar_t const *kind;
|
||||
long engine;
|
||||
|
||||
text[0] = 0;
|
||||
if (!playlist_profile_get(profile_index, &variant))
|
||||
return;
|
||||
if (!playlist_profile_get_options(profile_index, &options))
|
||||
game_variant_options_default(&variant, &options);
|
||||
engine = PIN(variant.game_engine_index, 0, 5);
|
||||
kind = game_modes_variant_kind_name(&variant, &options);
|
||||
switch (game_modes_variant_mode(&variant, &options))
|
||||
{
|
||||
case _game_mode_infection:
|
||||
if (options.time_limit > 0)
|
||||
usnprintf(text, size - 1, L"%s\r\nTeams\r\nRound time: %d min", kind, options.time_limit);
|
||||
else
|
||||
usnprintf(text, size - 1, L"%s\r\nTeams\r\nUntil no human is left", kind);
|
||||
break;
|
||||
case _game_mode_gun_game:
|
||||
usnprintf(text, size - 1, L"%s\r\nFree for all\r\nA kill with each weapon", kind);
|
||||
break;
|
||||
default:
|
||||
usnprintf(text, size - 1, L"%s\r\n%s\r\nScore to win: %ld", kind ? kind : engine_names[engine],
|
||||
variant.universal_variant.teams ? L"Teams" : L"Free for all", variant.universal_variant.score_to_win);
|
||||
break;
|
||||
}
|
||||
text[size - 1] = 0;
|
||||
}
|
||||
|
||||
/* "mp profiles list initialize": on the gametype used last */
|
||||
static boolean gametype_list_initialize(struct widget_instance *list)
|
||||
{
|
||||
@@ -3237,8 +3321,7 @@ static boolean gametype_list_initialize(struct widget_instance *list)
|
||||
short last, index;
|
||||
|
||||
multiplayer.gametype_count = ui_widget_port_gametypes(multiplayer.gametypes, MAXIMUM_GAMETYPES, &last);
|
||||
gametype_bank_read(multiplayer.gametype_count && !((unsigned long)multiplayer.gametypes[last] &
|
||||
PLAYLIST_READ_ONLY_BIT) ? 1 : 0);
|
||||
gametype_bank_read(multiplayer.gametype_count ? gametype_bank(multiplayer.gametypes[last]) : GAMETYPE_BANK_STANDARD);
|
||||
for (index = 0; index < multiplayer.bank_count; index++)
|
||||
{
|
||||
if (multiplayer.bank[index] == last)
|
||||
@@ -3284,7 +3367,7 @@ static void gametype_list_update(struct widget_instance *list)
|
||||
short row_index = 0, focused = NONE, count;
|
||||
|
||||
if (spinner && spinner->parameters.list.selected_index != multiplayer.bank_shown)
|
||||
gametype_bank_read(spinner->parameters.list.selected_index);
|
||||
gametype_bank_read((short)PIN(spinner->parameters.list.selected_index, 0, NUMBER_OF_GAMETYPE_BANKS - 1));
|
||||
count = (short)MIN(multiplayer.bank_count, GAMETYPE_ROWS);
|
||||
/* (the rows after the spinner's: scrolled as list_scroll does) */
|
||||
for (row = list->child; row; row = row->next, row_index++)
|
||||
@@ -3337,9 +3420,8 @@ static void gametype_list_update(struct widget_instance *list)
|
||||
|
||||
if ((widget = named(description, "gametype_right_pic", 0)) != NULL)
|
||||
widget->animation.current_frame_index = (short)engine;
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"%s\r\n%s\r\nScore to win: %ld", engine_names[engine],
|
||||
variant.universal_variant.teams ? L"Teams" : L"Free for all", variant.universal_variant.score_to_win);
|
||||
text[NUMBEROF(text) - 1] = 0;
|
||||
gametype_rules_text(multiplayer.gametypes[multiplayer.bank[multiplayer.gametype_chosen]], text,
|
||||
NUMBEROF(text));
|
||||
text_set(named(description, "gametype_right_data", 0), text);
|
||||
}
|
||||
}
|
||||
@@ -3347,8 +3429,9 @@ static void gametype_list_update(struct widget_instance *list)
|
||||
}
|
||||
|
||||
/* "mp profile set for game" */
|
||||
static boolean gametype_choose(void)
|
||||
static boolean gametype_choose(struct widget_instance *list)
|
||||
{
|
||||
gametype_list_update(list);
|
||||
gametype_setup_end();
|
||||
if (multiplayer.gametype_chosen >= multiplayer.bank_count)
|
||||
return campaign_fail();
|
||||
@@ -3406,9 +3489,9 @@ gametype_options' coop_extra_enemies_spinner has them, in this order): its
|
||||
amount's row is the choice's */
|
||||
enum
|
||||
{
|
||||
_cooperative_enemies_none,
|
||||
_cooperative_enemies_per_player,
|
||||
_cooperative_enemies_multiplier,
|
||||
_cooperative_enemies_none,
|
||||
NUMBER_OF_COOPERATIVE_ENEMIES_MODES
|
||||
};
|
||||
|
||||
@@ -3548,7 +3631,8 @@ static void server_settings_update(struct widget_instance *list)
|
||||
browser, or PRIVATE, for this game. Its help is its choice's */
|
||||
visible_set(named(list, "op_listing", 0), multiplayer.mode == _multiplayer_mode_host_internet &&
|
||||
config_boolean("network.online") && config_boolean("network.public_lobby"));
|
||||
if ((spinner = named(list, "listing_spinner", 0)) != NULL && named(list, "op_listing", 0)->visible)
|
||||
if ((spinner = named(list, "listing_spinner", 0)) != NULL && named(list, "op_listing", 0) &&
|
||||
named(list, "op_listing", 0)->visible)
|
||||
{
|
||||
boolean public = spinner->parameters.list.selected_index == 0;
|
||||
struct widget_instance *help = list->parameters.list.extended_description;
|
||||
@@ -3637,8 +3721,8 @@ static boolean server_start(void)
|
||||
if (hosting_cooperative())
|
||||
{
|
||||
/* (as CO-OP OPTIONS left them: network.coop_friendly_fire, in
|
||||
cooperative_friendly_fire_modes' order, and
|
||||
network.coop_player_collisions) */
|
||||
cooperative_friendly_fire_modes' order, network.coop_player_collisions
|
||||
and network.coop_ally_friendly_fire) */
|
||||
static char const *const friendly_fire_names[] = { "off", "on", "shields_only", "explosives_only" };
|
||||
char const *friendly_fire = config_string("network.coop_friendly_fire");
|
||||
short index;
|
||||
@@ -3653,6 +3737,7 @@ static boolean server_start(void)
|
||||
multiplayer.cooperative_no_player_collisions = !config_boolean("network.coop_player_collisions");
|
||||
network_game_server_port_set_cooperative_friendly_fire(multiplayer.cooperative_friendly_fire);
|
||||
network_game_server_port_set_cooperative_player_collisions(!multiplayer.cooperative_no_player_collisions);
|
||||
network_game_server_port_set_cooperative_ally_friendly_fire(config_boolean("network.coop_ally_friendly_fire"));
|
||||
}
|
||||
else if (!gametype_setup_apply())
|
||||
return campaign_fail();
|
||||
@@ -3710,6 +3795,38 @@ static short browser_row_index(struct widget_instance *row)
|
||||
return row && !strncmp(row->name, "server_item_", 12) ? (short)(atoi(row->name + 12) - 1) : NONE;
|
||||
}
|
||||
|
||||
/* the ping each row shows (-1: none), coloured by pc_menu_text_color: green
|
||||
under PING_GOOD milliseconds, yellow under PING_FAIR, red above */
|
||||
static short browser_row_pings[BROWSER_ROWS];
|
||||
enum
|
||||
{
|
||||
PING_GOOD = 80,
|
||||
PING_FAIR = 160,
|
||||
};
|
||||
#define PING_COLOR_GOOD 0x5ED38CFFUL
|
||||
#define PING_COLOR_FAIR 0xE8C547FFUL
|
||||
#define PING_COLOR_POOR 0xE86A5AFFUL
|
||||
|
||||
/* ui_widget.c: a text's colour in place of its own (FALSE: its own): a
|
||||
server browser row's ping by how good it is */
|
||||
boolean pc_menu_text_color(struct widget_instance *widget, real_argb_color *color)
|
||||
{
|
||||
short row = widget->parent ? browser_row_index(widget->parent) : NONE;
|
||||
short ping;
|
||||
unsigned long rgba;
|
||||
|
||||
if (row < 0 || row >= BROWSER_ROWS || strcmp(widget->name, "server_item_ping"))
|
||||
return FALSE;
|
||||
ping = browser_row_pings[row];
|
||||
if (ping < 0)
|
||||
return FALSE;
|
||||
rgba = ping < PING_GOOD ? PING_COLOR_GOOD : ping < PING_FAIR ? PING_COLOR_FAIR : PING_COLOR_POOR;
|
||||
color->red = (real)((rgba >> 24) & 0xFF) / 255.0f;
|
||||
color->green = (real)((rgba >> 16) & 0xFF) / 255.0f;
|
||||
color->blue = (real)((rgba >> 8) & 0xFF) / 255.0f;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* a bar of buttons' focus, off one hidden: on its first one shown */
|
||||
static void focus_off_hidden(struct widget_instance *bar)
|
||||
{
|
||||
@@ -3735,21 +3852,25 @@ static boolean browser_item_usable(struct widget_instance *child)
|
||||
}
|
||||
|
||||
/* the browser's focus, off what cannot have it (at the start, or a row whose
|
||||
game went): the first game, else the buttons (off those hidden) */
|
||||
static void browser_focus(struct widget_instance *list)
|
||||
game went): the first game, else the buttons (off those hidden); the row of
|
||||
the game chosen is `chosen_row` (NONE: none shown) */
|
||||
static void browser_focus(struct widget_instance *list, short chosen_row)
|
||||
{
|
||||
char const *const choices[] = { "server_item_1", "join_game_button_bar" };
|
||||
struct widget_instance *focused = list->focused_child;
|
||||
struct widget_instance *row;
|
||||
short index;
|
||||
|
||||
/* (the rows' backgrounds: the focused one's outlined frame. The engine
|
||||
shows a list item's focus only on a bitmap of two frames, and theirs has
|
||||
three: normal, focused, selected) */
|
||||
/* (the rows' backgrounds, as Custom Edition's: the chosen game's
|
||||
outlined in yellow, the focused one's in blue. The engine shows a list
|
||||
item's focus only on a bitmap of two frames, and theirs has three:
|
||||
normal, focused, selected) */
|
||||
for (row = list->child; row; row = row->next)
|
||||
{
|
||||
if (browser_row_index(row) != NONE)
|
||||
row->animation.current_frame_index = row == focused ? 1 : 0;
|
||||
short row_index = browser_row_index(row);
|
||||
|
||||
if (row_index != NONE)
|
||||
row->animation.current_frame_index = row_index == chosen_row ? 2 : row == focused ? 1 : 0;
|
||||
}
|
||||
focus_off_hidden(named(list, "join_game_button_bar", 0));
|
||||
if (focused && focused->visible && !focused->disabled)
|
||||
@@ -3802,7 +3923,7 @@ static boolean browser_initialize(struct widget_instance *screen, struct event_r
|
||||
for (child = list ? list->child : NULL; child; child = child->next)
|
||||
child->disabled = !browser_item_usable(child);
|
||||
if (list)
|
||||
browser_focus(list);
|
||||
browser_focus(list, NONE);
|
||||
}
|
||||
visible_set(named(screen, "scroll_up_button", 0), FALSE);
|
||||
visible_set(named(screen, "scroll_down_button", 0), FALSE);
|
||||
@@ -3931,6 +4052,7 @@ static struct
|
||||
/* the last that failed, and when */
|
||||
char failed_name[P2P_LISTING_NAME_SIZE + 1];
|
||||
unsigned long failed_time;
|
||||
boolean failed_nat_strict;
|
||||
/* a game with a password chosen: the password screen's (its own copy:
|
||||
the rows' are read again each frame), and a join it began, which the
|
||||
browser takes up again as it comes back */
|
||||
@@ -3938,6 +4060,17 @@ static struct
|
||||
boolean password_joined;
|
||||
} lobby_browser;
|
||||
|
||||
/* the row of the browser's chosen game, NONE if it is not on the rows */
|
||||
static short browser_chosen_row(void)
|
||||
{
|
||||
boolean server_browser = multiplayer.mode == _multiplayer_mode_server_browser;
|
||||
short chosen = server_browser ? lobby_browser.chosen : multiplayer.game_chosen;
|
||||
short row = server_browser ? (short)(chosen - lobby_browser.first) : chosen;
|
||||
|
||||
return chosen < (server_browser ? lobby_browser.count : multiplayer.game_count) && row >= 0 &&
|
||||
row < BROWSER_ROWS ? row : NONE;
|
||||
}
|
||||
|
||||
static void lobby_browser_begin(void)
|
||||
{
|
||||
lobby_browser.count = 0;
|
||||
@@ -4070,9 +4203,10 @@ static void lobby_browser_update(struct widget_instance *list)
|
||||
first_row->visible = TRUE;
|
||||
lobby_browser_focus_row(list, 0);
|
||||
focused = 0;
|
||||
lobby_browser.chosen = lobby_browser.first;
|
||||
}
|
||||
}
|
||||
if (focused != NONE)
|
||||
if (focused != NONE && !ui_widget_port_hover_focused())
|
||||
lobby_browser.chosen = (short)(lobby_browser.first + focused);
|
||||
chosen = lobby_browser.chosen;
|
||||
for (row = list->child; row; row = row->next)
|
||||
@@ -4094,9 +4228,11 @@ static void lobby_browser_update(struct widget_instance *list)
|
||||
text_set(named(row, "server_item_type", 0), game_type_name(game->engine_type));
|
||||
usnprintf(text, ROW_TEXT_LENGTH - 1, L"%d/%d", game->player_count, game->maximum_player_count);
|
||||
text_set(named(row, "server_item_players", 0), text);
|
||||
/* (no ping yet: its host is reached only on joining) */
|
||||
text_set(named(row, "server_item_ping", 0), game->failed ? L"FAILED" : !game->open ? L"CLOSED" :
|
||||
game->in_progress ? L"LIVE" : L"-");
|
||||
/* (its host's ping, once probed: p2p_lobby.c) */
|
||||
browser_row_pings[index - lobby_browser.first] = game->failed ? -1 : game->ping;
|
||||
usnprintf(text, ROW_TEXT_LENGTH - 1, L"%d", game->ping);
|
||||
text_set(named(row, "server_item_ping", 0), game->failed ? L"FAILED" : game->ping >= 0 ? text :
|
||||
!game->open ? L"CLOSED" : game->in_progress ? L"LIVE" : L"-");
|
||||
/* (the lock: a game with a password. Its bitmap's first frame is
|
||||
empty, the PC version's for no lock; the next is the lock, in the
|
||||
menus' blue) */
|
||||
@@ -4147,6 +4283,7 @@ static void lobby_browser_update(struct widget_instance *list)
|
||||
p2p_lobby_mark_failed(lobby_browser.identifier);
|
||||
csmemcpy(lobby_browser.failed_name, lobby_browser.name, sizeof(lobby_browser.failed_name));
|
||||
lobby_browser.failed_time = now ? now : 1;
|
||||
lobby_browser.failed_nat_strict = p2p_nat_strict();
|
||||
lobby_browser.joining = FALSE;
|
||||
platform_log("menus: could not reach the server browser's game %s", lobby_browser.name);
|
||||
ui_play_audio_feedback_sound(SOUND_ERROR);
|
||||
@@ -4168,12 +4305,26 @@ static void lobby_browser_update(struct widget_instance *list)
|
||||
else if (lobby_browser.failed_time && now - lobby_browser.failed_time < LOBBY_BROWSER_FAILED_TIME)
|
||||
{
|
||||
text_to_wide(lobby_browser.failed_name, name, NUMBEROF(name));
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"Could not reach %s", name);
|
||||
/* (and why, when this network's NAT is what stops it: the router's
|
||||
UPnP, or a forwarded network.tunnel_port, lets it through) */
|
||||
usnprintf(text, NUMBEROF(text) - 1, lobby_browser.failed_nat_strict ?
|
||||
L"Strict NAT, turn on UPnP: could not reach %s" :
|
||||
L"Could not reach %s", name);
|
||||
}
|
||||
else if (!lobby_browser.count)
|
||||
{
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"%s", now - lobby_browser.begin_time < LOBBY_BROWSER_LOOK_TIME ?
|
||||
L"Looking for public games..." : L"No public games found");
|
||||
/* (an old build sees none of the games: it says why) */
|
||||
int newer = p2p_lobby_newer_games();
|
||||
|
||||
if (now - lobby_browser.begin_time < LOBBY_BROWSER_LOOK_TIME)
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"Looking for public games...");
|
||||
else if (newer)
|
||||
{
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"%d %s on a newer version: update the game to join", newer,
|
||||
newer == 1 ? L"game is" : L"games are");
|
||||
}
|
||||
else
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"No public games found");
|
||||
}
|
||||
else if (chosen < lobby_browser.count)
|
||||
{
|
||||
@@ -4211,7 +4362,7 @@ static void lobby_browser_update(struct widget_instance *list)
|
||||
usnprintf(text, ROW_TEXT_LENGTH - 1, L"%s %d", label, lobby_browser.count);
|
||||
text_set(named(stats, "server_count_label", 0), text);
|
||||
}
|
||||
browser_focus(list);
|
||||
browser_focus(list, browser_chosen_row());
|
||||
}
|
||||
|
||||
/* the game's host reached by its invite (joined, once it is reached:
|
||||
@@ -4409,13 +4560,14 @@ static void browser_update(struct widget_instance *list)
|
||||
return;
|
||||
}
|
||||
browser_games_read();
|
||||
if (focused != NONE && focused < multiplayer.game_count)
|
||||
if (focused != NONE && focused < multiplayer.game_count && !ui_widget_port_hover_focused())
|
||||
multiplayer.game_chosen = focused;
|
||||
for (row = list->child; row; row = row->next)
|
||||
{
|
||||
short index = browser_row_index(row);
|
||||
struct advertised_game *game;
|
||||
wchar_t text[ROW_TEXT_LENGTH];
|
||||
int ping;
|
||||
|
||||
if (index == NONE)
|
||||
continue;
|
||||
@@ -4431,7 +4583,11 @@ static void browser_update(struct widget_instance *list)
|
||||
text_set(named(row, "server_item_type", 0), game_type_name(game->engine_type));
|
||||
usnprintf(text, ROW_TEXT_LENGTH - 1, L"%d/%d", game->player_count, game->maximum_player_count);
|
||||
text_set(named(row, "server_item_players", 0), text);
|
||||
text_set(named(row, "server_item_ping", 0), advertised_in_progress(game) ? L"LIVE" : L"");
|
||||
/* (a Direct Link game's host: the tunnel's ping) */
|
||||
ping = multiplayer.mode == _multiplayer_mode_direct_link ? p2p_peer_ping(game->xnaddr + 2) : -1;
|
||||
browser_row_pings[index] = (short)ping;
|
||||
usnprintf(text, ROW_TEXT_LENGTH - 1, L"%d", ping);
|
||||
text_set(named(row, "server_item_ping", 0), ping >= 0 ? text : advertised_in_progress(game) ? L"LIVE" : L"");
|
||||
visible_set(named(row, "server_item_locked", 0), FALSE);
|
||||
visible_set(named(row, "server_item_dedicated", 0), FALSE);
|
||||
visible_set(named(row, "server_item_classic", 0), FALSE);
|
||||
@@ -4477,7 +4633,7 @@ static void browser_update(struct widget_instance *list)
|
||||
usnprintf(text, ROW_TEXT_LENGTH - 1, L"%s %d", label, multiplayer.game_count);
|
||||
text_set(named(stats, "server_count_label", 0), text);
|
||||
}
|
||||
browser_focus(list);
|
||||
browser_focus(list, browser_chosen_row());
|
||||
}
|
||||
|
||||
/* "direct ip connect go" (Direct Link's PASTE LINK): the invite
|
||||
@@ -4513,13 +4669,25 @@ static boolean browser_join(struct widget_instance *widget, short controller, bo
|
||||
return ui_widget_port_join(widget, multiplayer.games[multiplayer.game_chosen], LOBBY_NAME, widget_deleted);
|
||||
}
|
||||
|
||||
/* "gamespy select item" (a row: joins its game) and "gamespy select button"
|
||||
(Join) */
|
||||
/* "gamespy select item" (a row: chooses its game, or joins it once chosen)
|
||||
and "gamespy select button" (Join) */
|
||||
static boolean browser_select(struct widget_instance *widget, struct event_record *event, short controller,
|
||||
boolean *widget_deleted)
|
||||
{
|
||||
short row = browser_row_index(widget);
|
||||
|
||||
/* (a row not chosen, clicked after the pointer passed over it: chosen,
|
||||
as Custom Edition's; a click on it chosen, a double click, A or JOIN
|
||||
joins its game. Not the A press a join posts: lobby_browser_select) */
|
||||
if (row != NONE && row != browser_chosen_row() && !lobby_browser.ready)
|
||||
{
|
||||
if (multiplayer.mode == _multiplayer_mode_server_browser)
|
||||
lobby_browser.chosen = (short)(lobby_browser.first + row);
|
||||
else
|
||||
multiplayer.game_chosen = row;
|
||||
ui_play_audio_feedback_sound(SOUND_CURSOR);
|
||||
return TRUE;
|
||||
}
|
||||
if (multiplayer.mode == _multiplayer_mode_server_browser)
|
||||
return lobby_browser_select(widget, controller, row, widget_deleted);
|
||||
if (row != NONE)
|
||||
@@ -4597,6 +4765,24 @@ static boolean pause_end_game(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* "port coop friendly fire" (network co-op's pause menu's FRIENDLY FIRE,
|
||||
menu_tags.c): switches this machine's own friendly fire, from now on */
|
||||
static boolean coop_friendly_fire_change(void)
|
||||
{
|
||||
char const *choice = config_boolean("network.coop_own_friendly_fire") ? "false" : "true";
|
||||
|
||||
if (!config_write("network.coop_own_friendly_fire", choice))
|
||||
platform_log("menus: could not write network.coop_own_friendly_fire to config.toml");
|
||||
ui_play_audio_feedback_sound(SOUND_FORWARD);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* "port coop friendly fire text": the button's text, ON or OFF */
|
||||
static void coop_friendly_fire_text(struct widget_instance *button)
|
||||
{
|
||||
button->parameters.text_box.string_list_index = config_boolean("network.coop_own_friendly_fire") ? 0 : 1;
|
||||
}
|
||||
|
||||
/* ---- the lobby: the game's players (up to the port's 128), its map and
|
||||
gametype, the countdown */
|
||||
|
||||
@@ -4974,11 +5160,14 @@ static void lobby_update(struct widget_instance *list)
|
||||
short seconds = network_game_client_get_seconds_to_game_start(client);
|
||||
char link[TEXT_FIELD_LENGTH];
|
||||
wchar_t gametype[NUMBEROF(game->variant.human_readable_game_description) + 1];
|
||||
/* (an OpenCE gametype's kind: game_modes.c) */
|
||||
wchar_t const *kind = game_modes_variant_kind_name(&game->variant, &game->variant_options);
|
||||
|
||||
ustrncpy(gametype, game->variant.human_readable_game_description, NUMBEROF(gametype) - 1);
|
||||
gametype[NUMBEROF(gametype) - 1] = 0;
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"%s\r\n%s\r\n%d of %d players\r\n\r\n%s", gametype,
|
||||
engine_names[PIN(game->variant.game_engine_index, 0, 5)], lobby_player_count, game->maximum_players,
|
||||
kind ? kind : engine_names[PIN(game->variant.game_engine_index, 0, 5)], lobby_player_count,
|
||||
game->maximum_players,
|
||||
seconds > 0 ? L"Starting in:" : game->machine_count < 2 ? L"Waiting for players" : L"");
|
||||
text[NUMBEROF(text) - 1] = 0;
|
||||
if (seconds > 0)
|
||||
@@ -5216,6 +5405,20 @@ struct gametype_option
|
||||
|
||||
static struct gametype_option const gametype_options[] =
|
||||
{
|
||||
/* OPENCE OPTIONS (OpenCE's gametypes: game_modes.c) */
|
||||
{ "oce_mode_spinner", _option_option_byte, OPTIONS_FIELD(mode), 0, 4,
|
||||
{ _game_mode_none, _game_mode_swat, _game_mode_infection, _game_mode_gun_game } },
|
||||
{ "oce_hardcore_spinner", _option_option_byte, OPTIONS_FIELD(hardcore), 0, 2, { FALSE, TRUE } },
|
||||
{ "inf_zombies_spinner", _option_option_byte, OPTIONS_FIELD(infection_initial_zombies), 0, 6, { 1, 2, 3, 4, 8, 16 } },
|
||||
{ "inf_speed_spinner", _option_option_byte, OPTIONS_FIELD(infection_zombie_speed), 0, 6,
|
||||
{ 100, 110, 125, 150, 175, 200 } },
|
||||
{ "inf_damage_spinner", _option_option_byte, OPTIONS_FIELD(infection_skull_damage), 0, 4, { 100, 150, 200, 250 } },
|
||||
{ "inf_respawn_spinner", _option_option_byte, OPTIONS_FIELD(infection_respawn_time), 0, 6, { 1, 3, 5, 10, 15, 30 } },
|
||||
{ "inf_countdown_spinner", _option_option_byte, OPTIONS_FIELD(infection_countdown), 0, 5, { 0, 5, 10, 15, 30 } },
|
||||
{ "inf_shields_spinner", _option_option_byte, OPTIONS_FIELD(infection_zombie_shields), 0, 2, { FALSE, TRUE } },
|
||||
{ "gg_order_spinner", _option_option_byte, OPTIONS_FIELD(gun_game_order), 0, 3,
|
||||
{ _gun_game_order_strongest_first, _gun_game_order_weakest_first, _gun_game_order_random } },
|
||||
{ "gg_melee_spinner", _option_option_byte, OPTIONS_FIELD(gun_game_melee_demotes), 0, 2, { FALSE, TRUE } },
|
||||
/* player options */
|
||||
{ "number_of_lives_spinner", _option_long, VARIANT_FIELD(universal_variant.lives), 0, 4, { 0, 1, 3, 5 } },
|
||||
{ "maximum_health_spinner", _option_health, 0, 0, 6, { 5, 10, 15, 20, 30, 40 } },
|
||||
@@ -5312,18 +5515,28 @@ static struct gametype_option const gametype_options[] =
|
||||
{ "votekick_spinner", _option_setting, 0, 0, 2, { 0 }, "network.votekick", { "true", "false" } },
|
||||
/* (and the text chat: port/linux/game/network_chat.c) */
|
||||
{ "text_chat_spinner", _option_setting, 0, 0, 3, { 0 }, "network.text_chat", { "on", "links", "off" } },
|
||||
{ "aim_assist_spinner", _option_setting, 0, 0, 2, { 0 }, "network.block_mouse_aim_assist", { "false", "true" } },
|
||||
/* (the shield effects every machine draws: network_shield_effects.c) */
|
||||
{ "shield_effects_spinner", _option_setting, 0, 0, 6, { 0 }, "network.shield_effects",
|
||||
{ "stock", "glow", "light_show", "overshield", "glow_overshield", "light_show_overshield" } },
|
||||
/* co-op's options (Server Setup's CO-OP OPTIONS: tools/port_settings.py's
|
||||
COOP_SETUP_SCREENS; coop_enemies.c) */
|
||||
{ "coop_friendly_fire_spinner", _option_setting, 0, 0, 4, { 0 }, "network.coop_friendly_fire",
|
||||
{ "off", "on", "shields_only", "explosives_only" } },
|
||||
{ "coop_extra_enemies_spinner", _option_setting, 0, 0, 3, { 0 }, "network.coop_enemies_mode",
|
||||
{ "none", "per_player", "multiplier" } },
|
||||
{ "per_player", "multiplier", "none" } },
|
||||
{ "coop_extra_pickups_spinner", _option_setting, 0, 0, 3, { 0 }, "network.coop_pickups",
|
||||
{ "per_player", "multiplier", "none" } },
|
||||
{ "coop_extra_vehicles_spinner", _option_setting, 0, 0, 3, { 0 }, "network.coop_vehicles",
|
||||
{ "per_player", "multiplier", "none" } },
|
||||
{ "coop_enemies_per_player_spinner", _option_setting, 0, 0, 5, { 0 }, "network.coop_enemies",
|
||||
{ "25", "50", "100", "150", "200" } },
|
||||
{ "coop_enemies_multiplier_spinner", _option_setting, 0, 0, 5, { 0 }, "network.coop_enemies_multiplier",
|
||||
{ "2", "4", "8", "16", "32" } },
|
||||
{ "coop_player_collisions_spinner", _option_setting, 0, 0, 2, { 0 }, "network.coop_player_collisions",
|
||||
{ "true", "false" } },
|
||||
{ "coop_ally_friendly_fire_spinner", _option_setting, 0, 0, 2, { 0 }, "network.coop_ally_friendly_fire",
|
||||
{ "true", "false" } },
|
||||
/* map sharing's (Server Setup's MAP SHARING: tools/port_settings.py's
|
||||
MAP_SHARE_SETUP; map_share.c) */
|
||||
{ "map_share_spinner", _option_setting, 0, 0, 2, { 0 }, "network.map_share", { "true", "false" } },
|
||||
@@ -5679,6 +5892,15 @@ static boolean gametype_options_save(struct widget_instance *widget)
|
||||
if (named(list, "op_team", 0))
|
||||
vehicles_keep(list);
|
||||
gametype_options_each(list, TRUE);
|
||||
/* (OPENCE OPTIONS: Infection is played on teams, Gun Game free for all:
|
||||
game_modes_variant_mode) */
|
||||
if (named(list, "oce_mode_spinner", 0) && edit_variant()->game_engine_index == game_engine_slayer)
|
||||
{
|
||||
if (edit_options()->mode == _game_mode_infection)
|
||||
edit_variant()->universal_variant.teams = TRUE;
|
||||
else if (edit_options()->mode == _game_mode_gun_game)
|
||||
edit_variant()->universal_variant.teams = FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -5714,14 +5936,16 @@ static boolean gametype_setup_apply(void)
|
||||
static void gametype_setup_type(wchar_t *text)
|
||||
{
|
||||
wchar_t name[NUMBEROF(gametype_edit.setup_variant.human_readable_game_description) + 1];
|
||||
wchar_t const *kind;
|
||||
|
||||
text[0] = 0;
|
||||
if (!gametype_edit.setup)
|
||||
return;
|
||||
ustrncpy(name, gametype_edit.setup_variant.human_readable_game_description, NUMBEROF(name) - 1);
|
||||
name[NUMBEROF(name) - 1] = 0;
|
||||
kind = game_modes_variant_kind_name(&gametype_edit.setup_variant, &gametype_edit.setup_options);
|
||||
usnprintf(text, ROW_TEXT_LENGTH - 1, L"%s (%s%s)", name,
|
||||
engine_names[PIN(gametype_edit.setup_variant.game_engine_index, 0, 5)],
|
||||
kind ? kind : engine_names[PIN(gametype_edit.setup_variant.game_engine_index, 0, 5)],
|
||||
gametype_edit.setup_variant.universal_variant.teams ? L", TEAMS" : L"");
|
||||
text[ROW_TEXT_LENGTH - 1] = 0;
|
||||
}
|
||||
@@ -5794,15 +6018,34 @@ static void gametype_edit_list_update(struct widget_instance *list)
|
||||
|
||||
if ((widget = named(description, "gametype_right_pic", 0)) != NULL)
|
||||
widget->animation.current_frame_index = (short)engine;
|
||||
usnprintf(text, NUMBEROF(text) - 1, L"%s\r\n%s\r\nScore to win: %ld", engine_names[engine],
|
||||
variant.universal_variant.teams ? L"Teams" : L"Free for all", variant.universal_variant.score_to_win);
|
||||
text[NUMBEROF(text) - 1] = 0;
|
||||
gametype_rules_text(profile_index, text, NUMBEROF(text));
|
||||
text_set(named(description, "gametype_right_data", 0), text);
|
||||
}
|
||||
}
|
||||
profile_name_show(description);
|
||||
}
|
||||
|
||||
/* "port playlist edit desc" (after the PC version's "playlist settings menu
|
||||
update desc"): the gametype editor's OPENCE OPTIONS, its eighth row, has its
|
||||
own words (the list's ninth) over GAME OPTIONS' picture, and the buttons
|
||||
after it SAVE CHANGES' */
|
||||
#define PLAYLIST_EDIT_OPENCE_ROW 7
|
||||
#define PLAYLIST_EDIT_OPENCE_WORDS 8
|
||||
#define PLAYLIST_EDIT_GAME_OPTIONS_PICTURE 1
|
||||
|
||||
static void playlist_edit_description(struct widget_instance *list)
|
||||
{
|
||||
struct widget_instance *description = list->parameters.list.extended_description;
|
||||
short index = list->focused_child ? ui_widget_port_list_index(list) : NONE;
|
||||
|
||||
if (!description || !description->child || !description->child->next || index < PLAYLIST_EDIT_OPENCE_ROW)
|
||||
return;
|
||||
description->child->parameters.text_box.string_list_index =
|
||||
index == PLAYLIST_EDIT_OPENCE_ROW ? PLAYLIST_EDIT_OPENCE_WORDS : (short)(index - 1);
|
||||
description->child->next->animation.current_frame_index =
|
||||
index == PLAYLIST_EDIT_OPENCE_ROW ? PLAYLIST_EDIT_GAME_OPTIONS_PICTURE : (short)(index - 1);
|
||||
}
|
||||
|
||||
/* "mp profile begin editing" (the list's custom activation: OK, a row's A) */
|
||||
static boolean gametype_edit_begin(void)
|
||||
{
|
||||
@@ -5869,17 +6112,61 @@ static void gametype_option_help(struct widget_instance *list)
|
||||
visible_set(named(list, "op_primary_weapon", 0), custom);
|
||||
visible_set(named(list, "op_secondary_weapon", 0), custom);
|
||||
}
|
||||
/* (OPENCE OPTIONS: the mode's own rows, Infection's or Gun Game's, below
|
||||
MODE and HARDCORE) */
|
||||
if (named(list, "oce_mode_spinner", 0))
|
||||
{
|
||||
short mode = named(list, "oce_mode_spinner", 0)->parameters.list.selected_index;
|
||||
short place = 73 + 2 * 30;
|
||||
|
||||
for (row = list->child; row; row = row->next)
|
||||
{
|
||||
boolean infection = !strncmp(row->name, "op_inf_", 7);
|
||||
|
||||
if (!infection && strncmp(row->name, "op_gg_", 6))
|
||||
continue;
|
||||
row->visible = infection ? mode == _game_mode_infection : mode == _game_mode_gun_game;
|
||||
if (row->visible)
|
||||
{
|
||||
row->vertical_offset = place;
|
||||
place += 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* (TEXT CHAT held at OFF while the game is listed: text_chat_locked) */
|
||||
if (named(list, TEXT_CHAT_SPINNER, 0) && p2p_hosting_listed())
|
||||
named(list, TEXT_CHAT_SPINNER, 0)->parameters.list.selected_index = TEXT_CHAT_OFF;
|
||||
/* (CO-OP OPTIONS: the row of the amount of the extra enemies chosen,
|
||||
PER PLAYER's or MULTIPLIER's, in the one place) */
|
||||
/* CO-OP OPTIONS: enemies, pickups and vehicles share the amount rows.
|
||||
Mixed modes may need both rows at once. */
|
||||
if (named(list, "coop_extra_enemies_spinner", 0))
|
||||
{
|
||||
short mode = named(list, "coop_extra_enemies_spinner", 0)->parameters.list.selected_index;
|
||||
|
||||
visible_set(named(list, "op_coop_enemies_per_player", 0), mode == _cooperative_enemies_per_player);
|
||||
visible_set(named(list, "op_coop_enemies_multiplier", 0), mode == _cooperative_enemies_multiplier);
|
||||
struct widget_instance *pickups = named(list, "coop_extra_pickups_spinner", 0);
|
||||
struct widget_instance *vehicles = named(list, "coop_extra_vehicles_spinner", 0);
|
||||
boolean per_player = mode == _cooperative_enemies_per_player ||
|
||||
(pickups && pickups->parameters.list.selected_index == _cooperative_enemies_per_player) ||
|
||||
(vehicles && vehicles->parameters.list.selected_index == _cooperative_enemies_per_player);
|
||||
boolean multiplier = mode == _cooperative_enemies_multiplier ||
|
||||
(pickups && pickups->parameters.list.selected_index == _cooperative_enemies_multiplier) ||
|
||||
(vehicles && vehicles->parameters.list.selected_index == _cooperative_enemies_multiplier);
|
||||
|
||||
visible_set(named(list, "op_coop_enemies_per_player", 0), per_player);
|
||||
visible_set(named(list, "op_coop_enemies_multiplier", 0), multiplier);
|
||||
|
||||
/* Hidden amounts must not reserve a blank row. Offsets are relative
|
||||
to the parent: moving only the row carries its labels and spinners
|
||||
with it when widget_instance_render_recursive draws and notes targets. */
|
||||
{
|
||||
short y = 73;
|
||||
|
||||
for (row = list->child; row; row = row->next)
|
||||
if (row->visible && !strncmp(row->name, "op_coop_", 8))
|
||||
{
|
||||
row->vertical_offset = y;
|
||||
y += 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* (the server browser's filters, hidden: their helps are fewer than
|
||||
their values) */
|
||||
@@ -6111,6 +6398,10 @@ boolean pc_menu_event_function_invoke(
|
||||
{
|
||||
return pause_end_game();
|
||||
}
|
||||
else if (!strcmp(name, "port coop friendly fire"))
|
||||
{
|
||||
return coop_friendly_fire_change();
|
||||
}
|
||||
else if (!strcmp(name, "player profile save changes"))
|
||||
{
|
||||
return profile_save_changes(widget, widget_deleted);
|
||||
@@ -6147,7 +6438,7 @@ boolean pc_menu_event_function_invoke(
|
||||
}
|
||||
else if (!strcmp(name, "mp profile set for game"))
|
||||
{
|
||||
return gametype_choose();
|
||||
return gametype_choose(widget);
|
||||
}
|
||||
else if (!strcmp(name, "server settings init"))
|
||||
{
|
||||
@@ -6312,7 +6603,7 @@ boolean pc_menu_event_function_invoke(
|
||||
}
|
||||
else if (!strcmp(name, "solo level set map"))
|
||||
{
|
||||
return level_choose(controller);
|
||||
return level_choose(widget, controller);
|
||||
}
|
||||
else if (!strcmp(name, "difficulty item select"))
|
||||
{
|
||||
@@ -6408,4 +6699,8 @@ void pc_menu_game_data_function_invoke(
|
||||
saved_game_list_update(widget);
|
||||
else if (!strcmp(name, "port gamepad layout preview"))
|
||||
profile_gamepad_layout(widget);
|
||||
else if (!strcmp(name, "port coop friendly fire text"))
|
||||
coop_friendly_fire_text(widget);
|
||||
else if (!strcmp(name, "port playlist edit desc"))
|
||||
playlist_edit_description(widget);
|
||||
}
|
||||
@@ -30,7 +30,8 @@ pictures, sounds and screens) are none, a missing picture drawn blank, and
|
||||
no screen pauses the game (a network game's clock runs on).
|
||||
|
||||
So does a single-player campaign's map (pause_campaign_patch), whose screens
|
||||
pause it as its pause menu does.
|
||||
pause it as its pause menu does, and a network co-op game's, whose pause
|
||||
menu gets FRIENDLY FIRE too.
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
@@ -42,6 +43,7 @@ pause it as its pause menu does.
|
||||
|
||||
#include "halo_menus.h"
|
||||
#include "halo_vr.h"
|
||||
#include "custom_edition_cache.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -82,7 +84,8 @@ adds to */
|
||||
#define MULTIPLAYER_COLLECTION "ui\\shell\\multiplayer"
|
||||
/* the campaign's full screen pause screen, which pause_campaign_patch adds to */
|
||||
#define CAMPAIGN_PAUSE_SCREEN "ui\\shell\\solo_game\\pause_game\\pause_game"
|
||||
/* the tags pause_patch adds: two buttons and their texts */
|
||||
/* the tags pause_patch or pause_campaign_patch adds: two buttons and their
|
||||
texts (SETTINGS, and END GAME or FRIENDLY FIRE) */
|
||||
#define PAUSE_PATCH_TAGS 4
|
||||
/* what a frame of ui.map's is drawn as in a game map, which has not got it */
|
||||
#define BLANK_PNG "ce/port/blank__0.png"
|
||||
@@ -364,7 +367,7 @@ static char const *const port_function_names[] =
|
||||
"port setup edit",
|
||||
"port setup options init", "port setup options save",
|
||||
"port map list back",
|
||||
"port pause end game",
|
||||
"port pause end game", "port coop friendly fire",
|
||||
"port coop begin", "port coop player 2 list initialize", "port coop player 2",
|
||||
"port lobby open", "port lobby add player", "port lobby join", "port lobby leave",
|
||||
"port lobby player list initialize", "port lobby player choose",
|
||||
@@ -378,6 +381,8 @@ static char const *const port_function_names[] =
|
||||
"mp profile init indicator opts", "mp profile set ctf rules", "mp profile set koth rules",
|
||||
"mp profile set slayer rules", "mp profile set oddball rules", "mp profile set racing rules",
|
||||
"mp profile set player options", "mp profile set item options", "mp profile set indicator opts",
|
||||
/* (the gametype editor's OPENCE OPTIONS: OpenCE's gametypes, game_modes.c) */
|
||||
"mp profile init opence options", "mp profile set opence options",
|
||||
/* (Settings' OK: the Xbox's fails when the profile has no changes, the
|
||||
settings' screens having written theirs to config.toml) */
|
||||
"player profile save changes",
|
||||
@@ -414,6 +419,10 @@ static char const *const port_game_data_input_names[] =
|
||||
"port gamepad layout preview",
|
||||
/* (the main menu's Mods) */
|
||||
"port mods update",
|
||||
/* (network co-op's pause menu's FRIENDLY FIRE: its text, ON or OFF) */
|
||||
"port coop friendly fire text",
|
||||
/* (the gametype editor's description, with OPENCE OPTIONS' row) */
|
||||
"port playlist edit desc",
|
||||
};
|
||||
|
||||
static struct
|
||||
@@ -453,6 +462,10 @@ static struct
|
||||
boolean game_map;
|
||||
/* a single-player campaign's map's, whose screens pause the game */
|
||||
boolean campaign;
|
||||
/* the strings taken from the Custom Edition's loc.map */
|
||||
long map_strings;
|
||||
/* a network co-op game's map's: its pause menu gets FRIENDLY FIRE too */
|
||||
boolean coop;
|
||||
} build;
|
||||
|
||||
/* ---------- private code */
|
||||
@@ -707,8 +720,11 @@ static void parse_bounds(char const *text, rectangle2d *bounds, char const *file
|
||||
}
|
||||
}
|
||||
|
||||
/* a 'ustr' of the strings */
|
||||
static void *string_list_build(char const *const *strings, long count)
|
||||
/* a 'ustr' of the strings; each with an index in the list `map` (the
|
||||
Custom Edition's in its language, or NULL) given by maps is its string
|
||||
there */
|
||||
static void *string_list_build(char const *const *strings, long const *maps, long count,
|
||||
struct custom_edition_string_list const *map)
|
||||
{
|
||||
struct string_list *list = allocate(sizeof(struct string_list));
|
||||
struct string_list_entry *entries = allocate(count * sizeof(struct string_list_entry));
|
||||
@@ -721,9 +737,22 @@ static void *string_list_build(char const *const *strings, long count)
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
long length = (long)strlen(strings[index]);
|
||||
unsigned short *characters = allocate((length * 2 + 2) * sizeof(unsigned short));
|
||||
unsigned short *characters;
|
||||
long written;
|
||||
|
||||
if (map && maps[index] != HALO_MENU_NONE && maps[index] < map->count)
|
||||
{
|
||||
length = map->lengths[maps[index]];
|
||||
characters = allocate(length * sizeof(unsigned short));
|
||||
if (!characters)
|
||||
return list;
|
||||
memcpy(characters, map->strings[maps[index]], length * sizeof(unsigned short));
|
||||
entries[index].string.size = length * (long)sizeof(unsigned short);
|
||||
entries[index].string.address = characters;
|
||||
build.map_strings++;
|
||||
continue;
|
||||
}
|
||||
characters = allocate((length * 2 + 2) * sizeof(unsigned short));
|
||||
if (!characters)
|
||||
return list;
|
||||
written = halo_menus_utf16(strings[index], characters, length * 2 + 2);
|
||||
@@ -1532,23 +1561,38 @@ static long pause_quit_button(struct ui_widget_definition const *list, long quit
|
||||
|
||||
/* a button like the model (its look), its own text, each of the model's
|
||||
events (its A and Start) running the function and opening the widget (if
|
||||
not NONE) */
|
||||
not NONE); with other_text, a second text, which the game data input (input)
|
||||
chooses between */
|
||||
static void *pause_button(struct cache_file_tag_instance *instances, struct ui_widget_definition const *model,
|
||||
char const *name, char const *text, long function, long widget_tag)
|
||||
char const *name, char const *text, long function, long widget_tag, char const *other_text, long input)
|
||||
{
|
||||
struct ui_widget_definition *button = allocate(sizeof(*button));
|
||||
struct ui_widget_event_handler_reference *handlers =
|
||||
allocate(model->event_handlers.count * sizeof(struct ui_widget_event_handler_reference));
|
||||
long text_tag = next_tag(), handler;
|
||||
char const *texts[2];
|
||||
|
||||
if (!button || !handlers)
|
||||
return NULL;
|
||||
memcpy(button, model, sizeof(*button));
|
||||
instance_set(instances, UNICODE_STRING_LIST_TAG, text_tag, name, " text", string_list_build(&text, 1));
|
||||
texts[0] = text;
|
||||
texts[1] = other_text;
|
||||
instance_set(instances, UNICODE_STRING_LIST_TAG, text_tag, name, " text",
|
||||
string_list_build(texts, NULL, other_text ? 2 : 1, NULL));
|
||||
reference_set(&button->text_label_string_list, UNICODE_STRING_LIST_TAG, text_tag);
|
||||
button->string_list_index = 0;
|
||||
button->game_data_inputs.count = 0;
|
||||
button->game_data_inputs.address = NULL;
|
||||
if (other_text)
|
||||
{
|
||||
struct ui_widget_game_data_input_reference *inputs = allocate(sizeof(*inputs));
|
||||
|
||||
if (!inputs)
|
||||
return NULL;
|
||||
inputs->function = (short)input;
|
||||
button->game_data_inputs.count = 1;
|
||||
button->game_data_inputs.address = inputs;
|
||||
}
|
||||
/* (the game's memcpy asserts on a NULL source, even for nothing) */
|
||||
if (model->event_handlers.count)
|
||||
memcpy(handlers, model->event_handlers.address, model->event_handlers.count * sizeof(*handlers));
|
||||
@@ -1568,37 +1612,42 @@ static void *pause_button(struct cache_file_tag_instance *instances, struct ui_w
|
||||
return button;
|
||||
}
|
||||
|
||||
/* the list's buttons: SETTINGS (and the host's END GAME) put before LEAVE
|
||||
GAME (quit); returns how many were added, and how much taller the list
|
||||
grew for them (growth) */
|
||||
/* the list's buttons: SETTINGS, and the host's END GAME or network co-op's
|
||||
FRIENDLY FIRE (whose text says the machine's choice: menu_functions.c), put
|
||||
before LEAVE GAME or REVERT TO SAVED (quit); returns how many were added, and
|
||||
how much taller the list grew for them (growth) */
|
||||
static long pause_list_patch(struct cache_file_tag_instance *instances, struct ui_widget_definition *list, long quit,
|
||||
boolean host, short *growth)
|
||||
{
|
||||
struct ui_widget_child_reference *children = list->child_widgets.address;
|
||||
long count = list->child_widgets.count, added = host ? 2 : 1, child;
|
||||
long count = list->child_widgets.count, added = host || build.coop ? 2 : 1, child;
|
||||
struct ui_widget_child_reference *grown = allocate((count + added) * sizeof(struct ui_widget_child_reference));
|
||||
struct ui_widget_definition const *model = tag_get(UI_WIDGET_DEFINITION_TAG, children[quit].widget_tag.index);
|
||||
long settings_widget = widget_named(PAUSE_SETTINGS_SCREEN);
|
||||
short spacing = count >= 2 ? (short)(children[count - 1].vertical_offset - children[count - 2].vertical_offset) :
|
||||
PAUSE_BUTTON_SPACING;
|
||||
char const *names[2];
|
||||
void *buttons[2];
|
||||
long tags[2];
|
||||
|
||||
if (!grown || settings_widget == NONE || spacing <= 0)
|
||||
return 0;
|
||||
names[0] = "pause/settings_button";
|
||||
tags[0] = next_tag();
|
||||
buttons[0] = pause_button(instances, model, "pause/settings_button", "SETTINGS",
|
||||
function_index("profile set edit begin", "pause", 0), build.widget_tags[settings_widget]);
|
||||
tags[1] = host ? next_tag() : NONE;
|
||||
buttons[1] = host ? pause_button(instances, model, "pause/end_game_button", "END GAME",
|
||||
function_index("port pause end game", "pause", 0), NONE) : NULL;
|
||||
if (!buttons[0] || (host && !buttons[1]))
|
||||
buttons[0] = pause_button(instances, model, names[0], "SETTINGS",
|
||||
function_index("profile set edit begin", "pause", 0), build.widget_tags[settings_widget], NULL, NONE);
|
||||
names[1] = build.coop ? "pause/friendly_fire_button" : "pause/end_game_button";
|
||||
tags[1] = added > 1 ? next_tag() : NONE;
|
||||
buttons[1] = build.coop ?
|
||||
pause_button(instances, model, names[1], "FRIENDLY FIRE ON",
|
||||
function_index("port coop friendly fire", "pause", 0), NONE, "FRIENDLY FIRE OFF",
|
||||
game_data_input_index("port coop friendly fire text", "pause", 0)) :
|
||||
host ? pause_button(instances, model, names[1], "END GAME",
|
||||
function_index("port pause end game", "pause", 0), NONE, NULL, NONE) : NULL;
|
||||
if (!buttons[0] || (added > 1 && !buttons[1]))
|
||||
return 0;
|
||||
for (child = 0; child < added; child++)
|
||||
{
|
||||
instance_set(instances, UI_WIDGET_DEFINITION_TAG, tags[child],
|
||||
child ? "pause/end_game_button" : "pause/settings_button", "", buttons[child]);
|
||||
}
|
||||
instance_set(instances, UI_WIDGET_DEFINITION_TAG, tags[child], names[child], "", buttons[child]);
|
||||
if (quit)
|
||||
memcpy(grown, children, quit * sizeof(*grown));
|
||||
for (child = 0; child < added; child++)
|
||||
@@ -1755,15 +1804,15 @@ static void pause_patch(struct cache_file_tag_instance *instances)
|
||||
platform_log("menus: the pause menu has SETTINGS%s", host ? " and END GAME" : "");
|
||||
}
|
||||
|
||||
/* ---------- the single-player campaign's pause menu
|
||||
/* ---------- the campaign's pause menu
|
||||
|
||||
Its list gets the same SETTINGS (pause_list_patch) before REVERT TO SAVED, a
|
||||
copy of it. The rows use the PC version's pause menu's pitch, so a
|
||||
highlight sits clear of the next label. The prompts (B and A) stay that same
|
||||
gap under the last row, and the box beside the mission objectives grows with
|
||||
them. Settings there has only the items
|
||||
that work in a game (pause_settings_patch), and Gamepads' OK saves the
|
||||
profile itself. */
|
||||
copy of it, and in network co-op FRIENDLY FIRE after SETTINGS. The rows use
|
||||
the PC version's pause menu's pitch, so a highlight sits clear of the next
|
||||
label. The prompts (B and A) stay that same gap under the last row, and the
|
||||
box beside the mission objectives grows with them. Settings there has only
|
||||
the items that work in a game (pause_settings_patch), and Gamepads' OK saves
|
||||
the profile itself. */
|
||||
|
||||
#define PAUSE_SETTINGS_LIST "main_menu/settings_select/player_setup/player_profile_edit/profile_edit_select_list"
|
||||
#define PAUSE_SETTINGS_GAMEPADS_OK "main_menu/settings_select/player_setup/player_profile_edit/gamepad_setup/button_ok"
|
||||
@@ -1782,12 +1831,13 @@ static char const *const pause_settings_hidden_items[] =
|
||||
"main_menu/settings_select/player_setup/player_profile_edit/about_item",
|
||||
};
|
||||
|
||||
/* the PC version's pause menu's row pitch (30 apart). The third pause box
|
||||
frame is the stock 159 grown by the 36 that five rows at this pitch add
|
||||
(tools/port_settings.py) */
|
||||
/* the PC version's pause menu's row pitch (30 apart). The pause box's frames
|
||||
from the third, and the mission objectives' box's, are the stock 159 grown by
|
||||
the 36 that five rows at this pitch add (SETTINGS), then by the 66 that six
|
||||
add (network co-op's FRIENDLY FIRE too: tools/port_settings.py) */
|
||||
#define PAUSE_CAMPAIGN_ROW_PITCH 30
|
||||
#define PAUSE_CAMPAIGN_BOX_FRAME 2
|
||||
#define PAUSE_CAMPAIGN_BOX_HEIGHT 195
|
||||
static short const pause_campaign_box_heights[] = { 195, 225 };
|
||||
|
||||
/* the port box piece for one of the map's pause box pieces, else NULL */
|
||||
static char const *pause_campaign_box_bitmap(long tag_index)
|
||||
@@ -1877,9 +1927,14 @@ static void pause_campaign_grow_box(struct ui_widget_definition *widget, short s
|
||||
/* (bitmap_name is the lookup, not piece_bitmap: find calls it) */
|
||||
long bitmap = find(piece_bitmap, build.menus->bitmap_count, bitmap_name);
|
||||
short height = (short)(child_widget->bounds.y1 - child_widget->bounds.y0);
|
||||
short frame = strstr(piece_bitmap, "objectives_") ? 0 : PAUSE_CAMPAIGN_BOX_FRAME;
|
||||
short frame = NONE, size;
|
||||
|
||||
if (bitmap != NONE && (short)(height + shift) == PAUSE_CAMPAIGN_BOX_HEIGHT)
|
||||
for (size = 0; size < (short)NUMBEROF(pause_campaign_box_heights); size++)
|
||||
{
|
||||
if ((short)(height + shift) == pause_campaign_box_heights[size])
|
||||
frame = (short)((strstr(piece_bitmap, "objectives_") ? 0 : PAUSE_CAMPAIGN_BOX_FRAME) + size);
|
||||
}
|
||||
if (bitmap != NONE && frame != NONE)
|
||||
{
|
||||
struct bitmap_group *group = bitmap_group_get(build.bitmap_tags[bitmap]);
|
||||
struct bitmap_group_sequence *sequence = group ? group->sequences.address : NULL;
|
||||
@@ -1889,7 +1944,7 @@ static void pause_campaign_grow_box(struct ui_widget_definition *widget, short s
|
||||
sequence->first_bitmap_index = frame;
|
||||
sequence->bitmap_count = 1;
|
||||
reference_set(&child_widget->background_bitmap, BITMAP_GROUP_TAG, build.bitmap_tags[bitmap]);
|
||||
child_widget->bounds.y1 = (short)(child_widget->bounds.y0 + PAUSE_CAMPAIGN_BOX_HEIGHT);
|
||||
child_widget->bounds.y1 = (short)(child_widget->bounds.y0 + height + shift);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2068,7 +2123,7 @@ static void pause_campaign_patch(struct cache_file_tag_instance *instances)
|
||||
pause_campaign_grow_box(definition, need);
|
||||
}
|
||||
pause_settings_patch();
|
||||
platform_log("menus: the pause menu has SETTINGS");
|
||||
platform_log("menus: the pause menu has SETTINGS%s", build.coop ? " and FRIENDLY FIRE" : "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2083,6 +2138,13 @@ static boolean full_screen_campaign_map(void)
|
||||
(game_connection() != _game_connection_local || network_game_is_active() || !game_is_cooperative());
|
||||
}
|
||||
|
||||
/* of those, a network game's: network co-op, whose pause menu gets FRIENDLY
|
||||
FIRE too */
|
||||
static boolean network_coop_campaign_map(void)
|
||||
{
|
||||
return full_screen_campaign_map() && game_connection() != _game_connection_local && network_game_is_active();
|
||||
}
|
||||
|
||||
/* whether display.menus asks for the PC version's menus: "pc" in any case
|
||||
(a value neither "pc" nor "xbox" is said once in the log, and is the Xbox's) */
|
||||
static boolean menus_pc_chosen(void)
|
||||
@@ -2100,18 +2162,38 @@ static boolean menus_pc_chosen(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* whether the PC menus' text is the language of the maps' Custom Edition
|
||||
(display.menu_language), else English */
|
||||
static boolean menus_language_maps(void)
|
||||
{
|
||||
static boolean said;
|
||||
char const *value = config_string("display.menu_language");
|
||||
|
||||
if (!csstrcasecmp(value, "maps"))
|
||||
return TRUE;
|
||||
if (csstrcasecmp(value, "english") && !said)
|
||||
{
|
||||
platform_log("menus: display.menu_language \"%s\" is not \"maps\" or \"english\": English", value);
|
||||
said = TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void menu_tags_loaded(
|
||||
char const *map_name)
|
||||
{
|
||||
struct halo_menus const *menus;
|
||||
struct cache_file_tag_instance *instances;
|
||||
long widget_count, own_lists = 0, total, index;
|
||||
boolean locale;
|
||||
|
||||
boolean game_map = strcmp(map_name, "ui") != 0;
|
||||
boolean campaign = game_map && full_screen_campaign_map();
|
||||
boolean coop = game_map && network_coop_campaign_map();
|
||||
|
||||
/* (ui.map, and a multiplayer map: its pause menu's SETTINGS; a
|
||||
single-player campaign's too) */
|
||||
campaign's too, single player's or network co-op's, which also gets
|
||||
FRIENDLY FIRE) */
|
||||
if ((game_map && tag_loaded('Soul', MULTIPLAYER_COLLECTION) == NONE && !campaign) ||
|
||||
!menus_pc_chosen())
|
||||
{
|
||||
@@ -2129,6 +2211,7 @@ void menu_tags_loaded(
|
||||
/* Settings must not pause the simulation in a network campaign. */
|
||||
build.campaign = campaign && game_connection() == _game_connection_local &&
|
||||
!network_game_is_active() && !game_is_cooperative();
|
||||
build.coop = coop;
|
||||
widget_count = menus->widget_count;
|
||||
build.widget_tags = malloc((widget_count + 1) * sizeof(long));
|
||||
build.text_tags = malloc((widget_count + 1) * sizeof(long));
|
||||
@@ -2168,12 +2251,24 @@ void menu_tags_loaded(
|
||||
instance_set(instances, BITMAP_GROUP_TAG, build.bitmap_tags[index], menus->bitmaps[index].name, "",
|
||||
bitmap_build(&menus->bitmaps[index], build.bitmap_tags[index]));
|
||||
}
|
||||
/* (the PC version's strings in the language of the Custom Edition the
|
||||
maps come from, its loc.map's, unless English is chosen) */
|
||||
locale = menus_language_maps() && custom_edition_locale_open();
|
||||
for (index = 0; index < menus->string_list_count && !build.failed; index++)
|
||||
{
|
||||
struct halo_menu_strings const *list = &menus->string_lists[index];
|
||||
struct custom_edition_string_list *map = locale && list->map ? custom_edition_locale_strings(list->map) : NULL;
|
||||
|
||||
instance_set(instances, UNICODE_STRING_LIST_TAG, build.strings_tags[index], list->name, "",
|
||||
string_list_build(menus->strings + list->first, list->count));
|
||||
string_list_build(menus->strings + list->first, menus->string_maps + list->first, list->count, map));
|
||||
if (map)
|
||||
free(map);
|
||||
}
|
||||
if (locale)
|
||||
{
|
||||
custom_edition_locale_close();
|
||||
if (!game_map)
|
||||
platform_log("menus: %ld strings from the Custom Edition's loc.map", build.map_strings);
|
||||
}
|
||||
for (index = 0; index < widget_count && !build.failed; index++)
|
||||
{
|
||||
@@ -2182,7 +2277,7 @@ void menu_tags_loaded(
|
||||
if (widget->text)
|
||||
{
|
||||
instance_set(instances, UNICODE_STRING_LIST_TAG, build.text_tags[index], widget->name, " text",
|
||||
string_list_build(&widget->text, 1));
|
||||
string_list_build(&widget->text, NULL, 1, NULL));
|
||||
}
|
||||
if (widget->strings)
|
||||
{
|
||||
@@ -2190,7 +2285,7 @@ void menu_tags_loaded(
|
||||
long count = spinner_split(widget, FALSE, pieces);
|
||||
|
||||
instance_set(instances, UNICODE_STRING_LIST_TAG, build.spinner_tags[index], widget->name, " strings",
|
||||
string_list_build(pieces, count));
|
||||
string_list_build(pieces, NULL, count, NULL));
|
||||
}
|
||||
instance_set(instances, UI_WIDGET_DEFINITION_TAG, build.widget_tags[index], widget->name, "", NULL);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
MODEL_DETAIL.C
|
||||
|
||||
The geometry each of a model's permutations draws when display.model_detail
|
||||
is "native" or "highest" (halo_model_detail_scale, port/linux/src/d3d8_gl.c),
|
||||
which choose the model's level of detail at sizes the Xbox's 480 lines
|
||||
rarely or never reached (render_model, source/models/models.c). "stock"
|
||||
draws each permutation at the model's level, as the Xbox did.
|
||||
|
||||
Two kinds of a map's levels are not made for those sizes:
|
||||
- a permutation may have no geometry at a level, and draw nothing there:
|
||||
"highest" would leave the part out at every distance, so it draws its
|
||||
most detailed level below that has some;
|
||||
- a level whose cutoff is over 1000 pixels is the model's inside, made for
|
||||
a camera within it (a10's cryotube's top level, at 3000, is the inside of
|
||||
the tube without its outside), so it is drawn only while the camera is
|
||||
inside the model's bounding sphere, and the level below otherwise.
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "model_detail.h"
|
||||
#include "models/model_definitions.h"
|
||||
#include "rasterizer/rasterizer_console_vars.h"
|
||||
#include "render/render.h"
|
||||
#include "render/render_cameras.h"
|
||||
|
||||
/* ---------- constants */
|
||||
|
||||
enum
|
||||
{
|
||||
/* the cutoff over which a level is a model's inside */
|
||||
MODEL_DETAIL_INTERIOR_CUTOFF_PIXELS = 1000,
|
||||
};
|
||||
|
||||
/* ---------- public code */
|
||||
|
||||
short model_detail_rules(struct model const *model, real_point3d const *centroid, real radius)
|
||||
{
|
||||
if (halo_model_detail_stock() || rasterizer_debug_options.debug_model_lod!=NONE)
|
||||
{
|
||||
return _model_detail_rules_stock;
|
||||
}
|
||||
return model_detail_camera_inside(model, &render.camera.position, centroid, radius) ?
|
||||
_model_detail_rules_inside :
|
||||
_model_detail_rules_outside;
|
||||
}
|
||||
|
||||
boolean model_detail_camera_inside(struct model const *model, real_point3d const *camera,
|
||||
real_point3d const *centroid, real radius)
|
||||
{
|
||||
short level;
|
||||
|
||||
for (level = 0; level<(short)NUMBEROF(model->detail_cutoff_pixels); level++)
|
||||
{
|
||||
if (model->detail_cutoff_pixels[level]>MODEL_DETAIL_INTERIOR_CUTOFF_PIXELS)
|
||||
{
|
||||
real x, y, z;
|
||||
|
||||
/* (a sphere of no size, infinite or not a number holds nothing) */
|
||||
if (!(radius>0.f && radius<=REAL_MAX))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
x = camera->x-centroid->x;
|
||||
y = camera->y-centroid->y;
|
||||
z = camera->z-centroid->z;
|
||||
return x*x+y*y+z*z<radius*radius;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
short model_detail_geometry_index(struct model const *model,
|
||||
struct model_region_permutation const *permutation, short level, short rules)
|
||||
{
|
||||
if (rules==_model_detail_rules_stock)
|
||||
{
|
||||
return permutation->geometry_indices[level];
|
||||
}
|
||||
for (; level>=0; level--)
|
||||
{
|
||||
if (permutation->geometry_indices[level]!=NONE &&
|
||||
(rules==_model_detail_rules_inside ||
|
||||
model->detail_cutoff_pixels[level]<=MODEL_DETAIL_INTERIOR_CUTOFF_PIXELS))
|
||||
{
|
||||
return permutation->geometry_indices[level];
|
||||
}
|
||||
}
|
||||
return NONE;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
MODEL_DETAIL.H
|
||||
|
||||
The geometry each of a model's permutations draws at the level of detail
|
||||
display.model_detail chose for the model (model_detail.c).
|
||||
*/
|
||||
|
||||
#ifndef MODEL_DETAIL_H
|
||||
#define MODEL_DETAIL_H
|
||||
|
||||
#include "math/real_math.h"
|
||||
|
||||
struct model;
|
||||
struct model_region_permutation;
|
||||
|
||||
/* how a model's permutations take its level (model_detail_rules) */
|
||||
enum
|
||||
{
|
||||
/* each the model's level, as the Xbox did ("stock", or rasterizer_debug_model_lod) */
|
||||
_model_detail_rules_stock,
|
||||
/* each its most detailed level at or below the model's that has geometry,
|
||||
not one of the model's inside */
|
||||
_model_detail_rules_outside,
|
||||
/* the same, the camera being inside the model, whose inside it sees */
|
||||
_model_detail_rules_inside,
|
||||
};
|
||||
|
||||
/* the rules for a model drawn this frame, its bounding sphere in the world */
|
||||
short model_detail_rules(struct model const *model, real_point3d const *centroid, real radius);
|
||||
/* whether the camera is inside a model that has levels of its inside only:
|
||||
FALSE for any other model, and for a sphere that is not one */
|
||||
boolean model_detail_camera_inside(struct model const *model, real_point3d const *camera,
|
||||
real_point3d const *centroid, real radius);
|
||||
/* the geometry a permutation draws for the model's level, NONE for none */
|
||||
short model_detail_geometry_index(struct model const *model,
|
||||
struct model_region_permutation const *permutation, short level, short rules);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
/* Host policy for the mouse's optional magnetism. The user's preference
|
||||
stays intact; a controller or touch aiming takes its usual path. */
|
||||
#include "cseries.h"
|
||||
#include "game/game.h"
|
||||
#include "interface/ui_widget.h"
|
||||
#include "main/main.h"
|
||||
#include "networking/network_game_globals.h"
|
||||
#include "network_distributed.h"
|
||||
#include "network_aim_assist.h"
|
||||
#include <string.h>
|
||||
|
||||
int config_boolean(char const *name);
|
||||
static boolean client_blocks_mouse = TRUE;
|
||||
static short sent_policy = NONE;
|
||||
struct aim_assist_policy_message
|
||||
{
|
||||
struct distributed_message_header header;
|
||||
word block_mouse;
|
||||
word reserved;
|
||||
};
|
||||
|
||||
void network_aim_assist_reset(void)
|
||||
{
|
||||
/* Until the host's reliable policy arrives, a client cannot opt in. */
|
||||
client_blocks_mouse = TRUE;
|
||||
sent_policy = NONE;
|
||||
}
|
||||
|
||||
boolean network_aim_assist_block_mouse(void)
|
||||
{
|
||||
if (!game_in_progress() || main_menu_is_active()) return FALSE;
|
||||
if (game_connection() == _game_connection_network_server)
|
||||
return config_boolean("network.block_mouse_aim_assist") != 0;
|
||||
return game_connection() == _game_connection_network_client && client_blocks_mouse;
|
||||
}
|
||||
|
||||
void network_aim_assist_send_policy(long machine_index)
|
||||
{
|
||||
struct aim_assist_policy_message message;
|
||||
if (game_connection() != _game_connection_network_server) return;
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.block_mouse = config_boolean("network.block_mouse_aim_assist") != 0;
|
||||
distributed_send_to_machine_reliably(machine_index, &message,
|
||||
_distributed_message_aim_assist_policy, 1, sizeof(message));
|
||||
}
|
||||
|
||||
void network_aim_assist_update(void)
|
||||
{
|
||||
struct aim_assist_policy_message message;
|
||||
short policy;
|
||||
if (!game_in_progress() || main_menu_is_active() ||
|
||||
game_connection() != _game_connection_network_server) return;
|
||||
policy = config_boolean("network.block_mouse_aim_assist") != 0;
|
||||
if (sent_policy == policy) return;
|
||||
sent_policy = policy;
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.block_mouse = policy;
|
||||
distributed_send(&message, _distributed_message_aim_assist_policy, 1,
|
||||
sizeof(message), _distributed_to_clients_reliably);
|
||||
}
|
||||
|
||||
boolean network_aim_assist_handles_message(word const *message, word size)
|
||||
{
|
||||
struct distributed_message_header header;
|
||||
if (size < sizeof(header)) return FALSE;
|
||||
memcpy(&header, message, sizeof(header));
|
||||
return header.type == _distributed_message_aim_assist_policy;
|
||||
}
|
||||
|
||||
void network_aim_assist_handle_message(long machine_index, word const *data, word size)
|
||||
{
|
||||
struct aim_assist_policy_message message;
|
||||
if (machine_index != NONE || game_connection() != _game_connection_network_client ||
|
||||
!game_in_progress() || main_menu_is_active() || network_connection_last_read_was_unreliable() || size != sizeof(message)) return;
|
||||
memcpy(&message, data, sizeof(message));
|
||||
if (GET_MESSAGE_TYPE(message.header.header) != 2 ||
|
||||
message.header.type != _distributed_message_aim_assist_policy ||
|
||||
message.header.count != 1 || message.block_mouse > 1 || message.reserved != 0) return;
|
||||
client_blocks_mouse = message.block_mouse != 0;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef NETWORK_AIM_ASSIST_H
|
||||
#define NETWORK_AIM_ASSIST_H
|
||||
#include "cseries.h"
|
||||
void network_aim_assist_reset(void);
|
||||
void network_aim_assist_update(void);
|
||||
void network_aim_assist_send_policy(long machine_index);
|
||||
boolean network_aim_assist_block_mouse(void);
|
||||
boolean network_aim_assist_handles_message(word const *message, word size);
|
||||
void network_aim_assist_handle_message(long machine_index, word const *message, word size);
|
||||
#endif
|
||||
@@ -49,6 +49,12 @@ The host also makes up for scripts written for one player: vitality they
|
||||
set on player0 is set on every player (a10's shields), and a Pelican's
|
||||
Warthog drop brings more Warthogs in a larger game.
|
||||
|
||||
Friendly fire between two players is also each player's own choice
|
||||
(network.coop_own_friendly_fire): both must play with it. A client's input
|
||||
says its choice, and the host, which alone deals damage, keeps everyone's.
|
||||
A player away from the controls for over 70 seconds is hurt by every
|
||||
player, whatever either chose, until their next input.
|
||||
|
||||
Skipping a cutscene is a vote. Pressing the skip key during a skippable
|
||||
cutscene votes (a client sends its vote to the host every tick), and the
|
||||
host skips once more than half the machines have voted. The skip itself is
|
||||
@@ -111,6 +117,8 @@ index and tag, since the map placed them at the same index everywhere.
|
||||
#include "sound/sound_definitions.h"
|
||||
#include "units/units.h"
|
||||
#include "coop_enemies.h"
|
||||
#include "coop_pickups.h"
|
||||
#include "coop_vehicles.h"
|
||||
#include "coop_spectate.h"
|
||||
#include "network_coop.h"
|
||||
#include "network_distributed.h"
|
||||
@@ -168,6 +176,9 @@ enum
|
||||
/* the types network_objects.c syncs; the object names sync skips them */
|
||||
NETWORKED_OBJECT_TYPES = _object_mask_biped | _object_mask_vehicle | _object_mask_weapon | _object_mask_equipment,
|
||||
|
||||
/* a player with no input for longer than this is away from the controls:
|
||||
every player's fire hurts them */
|
||||
FRIENDLY_FIRE_AWAY_TICKS = 70 * TICKS_PER_SECOND,
|
||||
/* the host forgets a client's skip vote it hasn't heard again for this long */
|
||||
SKIP_VOTE_HELD_TICKS = TICKS_PER_SECOND,
|
||||
/* After a skip the cutscene stays skippable until the script reaches
|
||||
@@ -563,6 +574,8 @@ static struct
|
||||
static void client_play_presentation(void);
|
||||
/* unit_scripting_commands.c */
|
||||
void unit_scripting_set_current_vitality_of(long unit_index, real body_vitality, real shield_vitality);
|
||||
/* port_config.c */
|
||||
int config_boolean(char const *name);
|
||||
|
||||
/* ---------- private code */
|
||||
|
||||
@@ -970,6 +983,17 @@ static struct
|
||||
NONE before its first input */
|
||||
static short host_player_structure_bsps[MAXIMUM_TRACKED_PLAYERS];
|
||||
|
||||
/* host: each player's friendly fire, by the player's absolute index: whether
|
||||
they chose to play without it, the buttons of their last input, and the ticks
|
||||
since an input showed them at the controls */
|
||||
static struct friendly_fire_player
|
||||
{
|
||||
long player_index;
|
||||
boolean declined;
|
||||
unsigned long control_flags;
|
||||
long idle_ticks;
|
||||
} host_friendly_fire[MAXIMUM_TRACKED_PLAYERS];
|
||||
|
||||
/* host, each tick: the devices that moved or changed power (and, with the
|
||||
resent state, all that ever have) */
|
||||
static void host_send_device_states(
|
||||
@@ -1894,6 +1918,66 @@ static short coop_player_count(
|
||||
return count;
|
||||
}
|
||||
|
||||
/* host: the player's friendly fire, begun again for a new player in the place
|
||||
of one who left (NULL: no such player) */
|
||||
static struct friendly_fire_player *host_friendly_fire_player(
|
||||
long player_index)
|
||||
{
|
||||
long absolute_index = DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index);
|
||||
struct friendly_fire_player *entry;
|
||||
|
||||
if (player_index == NONE || absolute_index >= MAXIMUM_TRACKED_PLAYERS)
|
||||
return NULL;
|
||||
entry = &host_friendly_fire[absolute_index];
|
||||
if (entry->player_index != player_index)
|
||||
{
|
||||
csmemset(entry, 0, sizeof(*entry));
|
||||
entry->player_index = player_index;
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
/* host, each tick: the host's own players' choice, and how long each player
|
||||
has been away from the controls. The input the tick ran for them shows them
|
||||
there if a button was pressed or let go, or a stick or the trigger is held
|
||||
(the game itself turns a player's view and chooses their weapon). */
|
||||
static void host_friendly_fire_update(
|
||||
void)
|
||||
{
|
||||
long update_number = update_server_ticked_update_number();
|
||||
short action_count = 0;
|
||||
struct player_action const *actions =
|
||||
update_number != NONE ? update_server_update_actions(update_number, &action_count) : NULL;
|
||||
struct data_iterator iterator;
|
||||
struct player_datum *player;
|
||||
|
||||
data_iterator_new(&iterator, player_data);
|
||||
while ((player = data_iterator_next(&iterator)) != NULL)
|
||||
{
|
||||
short absolute_index = (short)DATUM_INDEX_TO_ABSOLUTE_INDEX(iterator.datum_index);
|
||||
struct friendly_fire_player *entry = host_friendly_fire_player(iterator.datum_index);
|
||||
struct player_action const *action;
|
||||
|
||||
if (!entry)
|
||||
continue;
|
||||
if (player->local_player_index != NONE)
|
||||
entry->declined = !network_coop_own_friendly_fire();
|
||||
if (!actions || absolute_index >= action_count)
|
||||
continue;
|
||||
action = &actions[absolute_index];
|
||||
if (action->control_flags != entry->control_flags || action->throttle.i != 0.0f ||
|
||||
action->throttle.j != 0.0f || action->primary_trigger != 0.0f)
|
||||
{
|
||||
entry->idle_ticks = 0;
|
||||
}
|
||||
else if (entry->idle_ticks <= FRIENDLY_FIRE_AWAY_TICKS)
|
||||
{
|
||||
entry->idle_ticks++;
|
||||
}
|
||||
entry->control_flags = action->control_flags;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean tag_name_has(
|
||||
long definition_index,
|
||||
char const *text)
|
||||
@@ -1947,6 +2031,7 @@ void network_coop_new_game(
|
||||
csmemset(host_sent_looks, 0, sizeof(host_sent_looks));
|
||||
csmemset(host_sent_devices, 0, sizeof(host_sent_devices));
|
||||
csmemset(host_player_structure_bsps, NONE, sizeof(host_player_structure_bsps));
|
||||
csmemset(host_friendly_fire, 0, sizeof(host_friendly_fire));
|
||||
csmemset(&host_sent_screen_effect, 0, sizeof(host_sent_screen_effect));
|
||||
csmemset(&host_resend, 0, sizeof(host_resend));
|
||||
csmemset(&players_vitality, 0, sizeof(players_vitality));
|
||||
@@ -1960,6 +2045,8 @@ void network_coop_new_game(
|
||||
skip_vote.cooldown_until = 0;
|
||||
skip_vote.skip_save_written = FALSE;
|
||||
coop_enemies_new_game();
|
||||
coop_pickups_new_game();
|
||||
coop_vehicles_new_game();
|
||||
}
|
||||
|
||||
/* A network game on a campaign scenario with no game engine. Checking the
|
||||
@@ -1984,6 +2071,50 @@ boolean network_coop_player_collisions(
|
||||
return !TEST_FLAG(game->cooperative_flags, _network_game_cooperative_no_player_collisions_bit);
|
||||
}
|
||||
|
||||
boolean network_coop_ally_friendly_fire(
|
||||
void)
|
||||
{
|
||||
struct network_game *game;
|
||||
|
||||
if (!network_coop_active() || !(game = network_game_get_game()))
|
||||
return TRUE;
|
||||
return !TEST_FLAG(game->cooperative_flags, _network_game_cooperative_no_ally_friendly_fire_bit);
|
||||
}
|
||||
|
||||
boolean network_coop_own_friendly_fire(
|
||||
void)
|
||||
{
|
||||
return config_boolean("network.coop_own_friendly_fire") != 0;
|
||||
}
|
||||
|
||||
void network_coop_note_player_friendly_fire(
|
||||
long player_index,
|
||||
boolean friendly_fire)
|
||||
{
|
||||
struct friendly_fire_player *entry = coop_host() ? host_friendly_fire_player(player_index) : NULL;
|
||||
|
||||
if (entry)
|
||||
entry->declined = !friendly_fire;
|
||||
}
|
||||
|
||||
boolean network_coop_players_friendly_fire(
|
||||
long attacker_player_index,
|
||||
long victim_player_index)
|
||||
{
|
||||
struct friendly_fire_player *attacker, *victim;
|
||||
|
||||
/* (a client deals no damage, and a player's own fire is the game's) */
|
||||
if (!coop_host() || attacker_player_index == victim_player_index)
|
||||
return TRUE;
|
||||
attacker = host_friendly_fire_player(attacker_player_index);
|
||||
victim = host_friendly_fire_player(victim_player_index);
|
||||
if (!attacker || !victim)
|
||||
return TRUE;
|
||||
/* one who is away is hurt whatever either chose; else both must play
|
||||
with it */
|
||||
return victim->idle_ticks > FRIENDLY_FIRE_AWAY_TICKS || (!attacker->declined && !victim->declined);
|
||||
}
|
||||
|
||||
boolean network_coop_devices_remote(
|
||||
void)
|
||||
{
|
||||
@@ -2624,7 +2755,10 @@ void network_coop_host_tick(
|
||||
return;
|
||||
host_resend_update();
|
||||
players_vitality_keep();
|
||||
host_friendly_fire_update();
|
||||
coop_enemies_update();
|
||||
coop_pickups_update();
|
||||
coop_vehicles_update();
|
||||
host_count_skip_votes();
|
||||
host_presentation(&message.presentation);
|
||||
send_to_clients(&message, _distributed_message_coop_presentation, 1, sizeof(message.presentation));
|
||||
@@ -3013,8 +3147,9 @@ static void client_presentation_apply(
|
||||
a dead camera at the world origin. */
|
||||
client_host_camera_set((coop_presentation.cinematic_started && presentation->camera_scripted &&
|
||||
!coop_spectate_watching_rider(0)) || coop_spectate_nothing_to_watch(0));
|
||||
if (coop_presentation.cinematic_started)
|
||||
cinematic_show_letterbox(TEST_FLAG(presentation->flags, _presentation_letterbox_bit));
|
||||
/* (also outside a cinematic: a cutscene that leaves the players their
|
||||
controls shows the bars too) */
|
||||
cinematic_show_letterbox(TEST_FLAG(presentation->flags, _presentation_letterbox_bit));
|
||||
objects_port_set_activating_cluster((short)(presentation->activating_cluster - 1));
|
||||
if (coop_presentation.host_camera)
|
||||
{
|
||||
|
||||
@@ -48,6 +48,18 @@ boolean network_coop_active(void);
|
||||
/* whether the players collide with each other: FALSE in a co-op game whose
|
||||
host set Server Setup's PLAYER COLLISIONS off (bipeds.c, collisions.c) */
|
||||
boolean network_coop_player_collisions(void);
|
||||
/* whether the players hurt their AI allies: FALSE in a co-op game whose host
|
||||
set Server Setup's ALLY FRIENDLY FIRE off (game_engine.c's
|
||||
game_engine_friendly_damage) */
|
||||
boolean network_coop_ally_friendly_fire(void);
|
||||
/* whether this machine's players play with friendly fire between players
|
||||
(network.coop_own_friendly_fire: the pause menu's FRIENDLY FIRE) */
|
||||
boolean network_coop_own_friendly_fire(void);
|
||||
/* host: the choice a client's player's input says is theirs */
|
||||
void network_coop_note_player_friendly_fire(long player_index, boolean friendly_fire);
|
||||
/* host: whether one player's hit may hurt another: both chose friendly fire,
|
||||
or the one hit has been away from the controls for over 70 seconds */
|
||||
boolean network_coop_players_friendly_fire(long attacker_player_index, long victim_player_index);
|
||||
/* whether this machine is a co-op client, whose devices only the host moves */
|
||||
boolean network_coop_devices_remote(void);
|
||||
/* devices.c: a group's devices were set straight to its value */
|
||||
|
||||
@@ -34,13 +34,23 @@ being hit looks and feels like on the clients).
|
||||
- The damage to a unit goes to the machines of the players it concerns
|
||||
(the unit's, its riders', the damage's owner's) and those sent the
|
||||
unit's player this tick, which see it; a killing blow to all.
|
||||
- Scenery and devices that can be destroyed (lights, panels) are the
|
||||
map's, at the same index on every machine. A client reports its hits on
|
||||
them like any other, and every client deals the host's damage to its own
|
||||
copy, which breaks and plays its effects as the host's did.
|
||||
- Scenery and devices that can be destroyed (lights, panels), or whose
|
||||
shields can be broken (energy shields, a map's tripmines), are the map's,
|
||||
at the same index on every machine. A client reports its hits on them like
|
||||
any other, and every client deals the host's damage to its own copy, which
|
||||
breaks and plays its effects as the host's did. Their shields' stun and
|
||||
recharge each machine runs itself (damage.c's objects_update_shields), as
|
||||
the host sends no state of them: the same damage, and the same recharge.
|
||||
What one of them deals itself, its shield or body breaking (a tripmine
|
||||
going off), the host deals whoever owns it, and no client reports: a
|
||||
client's player's tripmine is set off where the host has it. One made in
|
||||
the game (a tripmine a grenade's effect places) is at an index of its own
|
||||
on each machine: a machine given another's index of one takes its own
|
||||
nearest where the other had it (static_target_near).
|
||||
*/
|
||||
|
||||
#include "cseries.h"
|
||||
#include "infection.h"
|
||||
#include "cseries/errors.h"
|
||||
#include "game/game.h"
|
||||
#include "game/game_globals.h"
|
||||
@@ -216,6 +226,10 @@ from the target */
|
||||
#define REPORT_TARGET_TOLERANCE 3.0f
|
||||
#define REPORT_TARGET_LEAD_TICKS 15.0f
|
||||
#define REPORT_IMPACT_TOLERANCE 2.0f
|
||||
/* ... and how far beyond its size a static target made in the game may be
|
||||
from where another machine had its own copy (a tripmine: the same grenade's
|
||||
landing on each machine, static_target_near) */
|
||||
#define STATIC_TARGET_MATCH_TOLERANCE 1.0f
|
||||
/* ... and from where the host had a player's unit or vehicle then (with how
|
||||
far it moves in a few ticks: a client's copy runs a little ahead of the
|
||||
host's word on it), and further for a vehicle's (its size, and as far as a
|
||||
@@ -499,12 +513,31 @@ static boolean distributed_damage_to_data(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* whether the object is scenery or a device that damage can destroy */
|
||||
/* whether the object is scenery or a device that damage can destroy, or
|
||||
whose shield it can break (a shield that is all the object is: Rat Race's
|
||||
energy shields, a map's tripmines) */
|
||||
static boolean static_target(
|
||||
long object_index)
|
||||
{
|
||||
return object_try_and_get_and_verify_type(object_index, STATIC_TARGET_TYPES) &&
|
||||
object_get_maximum_body_vitality(object_index, TRUE) > 0.0f;
|
||||
(object_get_maximum_body_vitality(object_index, TRUE) > 0.0f ||
|
||||
object_get_maximum_shield_vitality(object_index, TRUE) > 0.0f);
|
||||
}
|
||||
|
||||
boolean network_damage_static_target(
|
||||
long object_index)
|
||||
{
|
||||
return static_target(object_index);
|
||||
}
|
||||
|
||||
/* whether the damage is a static target's own (an effect of its shield or
|
||||
body breaking: a map's tripmine going off), which the host deals whoever its
|
||||
owner is: a client's player's tripmine is set off where the host has it (a
|
||||
vehicle running over it), so their machine has no hit of it to report */
|
||||
static boolean static_target_damage(
|
||||
struct damage_data const *damage)
|
||||
{
|
||||
return damage->owner_object_index != NONE && static_target(damage->owner_object_index);
|
||||
}
|
||||
|
||||
/* ---------- object_cause_damage (damage.c) */
|
||||
@@ -652,8 +685,9 @@ boolean network_damage_deals(
|
||||
|
||||
damage_replay_player_effect(unit->unit.player_index, &effect, 0.0f);
|
||||
}
|
||||
/* a hit of this machine's own player's, on the host's object */
|
||||
if (distributed_player_is_local(damage->owner_player_index) &&
|
||||
/* a hit of this machine's own player's, on the host's object (not a
|
||||
static target's own damage, which the host deals: static_target_damage) */
|
||||
if (distributed_player_is_local(damage->owner_player_index) && !static_target_damage(damage) &&
|
||||
(network_objects_client_has(object_index) || static_target(object_index)) &&
|
||||
damage_report_count < MAXIMUM_HIT_REPORTS_PER_TICK)
|
||||
{
|
||||
@@ -678,9 +712,11 @@ boolean network_damage_deals(
|
||||
return FALSE;
|
||||
}
|
||||
/* (a client's player's, whose machine reports it; but one whose machine
|
||||
has left deals it here: their grenades and rockets still in flight) */
|
||||
has left deals it here: their grenades and rockets still in flight; and
|
||||
a static target's own, which no machine reports: static_target_damage) */
|
||||
if (game_connection() == _game_connection_network_server && !damage_dealing_report &&
|
||||
damage->owner_player_index != NONE && !distributed_player_is_local(damage->owner_player_index))
|
||||
damage->owner_player_index != NONE && !distributed_player_is_local(damage->owner_player_index) &&
|
||||
!static_target_damage(damage))
|
||||
{
|
||||
struct player_datum *owner = player_try_and_get(damage->owner_player_index);
|
||||
|
||||
@@ -1301,6 +1337,41 @@ static real distributed_distance_squared(
|
||||
return dx * dx + dy * dy + dz * dz;
|
||||
}
|
||||
|
||||
/* this machine's static target nearest the point where another machine had
|
||||
one, within its size and the reach of the point, else NONE. A static target
|
||||
made in the game (a tripmine a grenade's effect places) is at an index of
|
||||
its own on each machine, as the map's are not, so another machine's index of
|
||||
it names no such object here */
|
||||
static long static_target_near(
|
||||
real_point3d const *point,
|
||||
real reach)
|
||||
{
|
||||
struct object_iterator iterator;
|
||||
long nearest = NONE;
|
||||
real nearest_distance = 0.0f;
|
||||
|
||||
object_iterator_new(&iterator, STATIC_TARGET_TYPES, 0);
|
||||
while (object_iterator_next(&iterator))
|
||||
{
|
||||
real_point3d origin;
|
||||
real distance;
|
||||
real limit;
|
||||
|
||||
if (!static_target(iterator.index))
|
||||
continue;
|
||||
object_get_origin(iterator.index, &origin);
|
||||
distance = distributed_distance_squared(point, &origin);
|
||||
limit = object_get(iterator.index)->object.bounding_sphere_radius + reach;
|
||||
if (distance <= limit * limit && (nearest == NONE || distance < nearest_distance))
|
||||
{
|
||||
nearest = iterator.index;
|
||||
nearest_distance = distance;
|
||||
}
|
||||
}
|
||||
|
||||
return nearest;
|
||||
}
|
||||
|
||||
/* where each player's unit and vehicle are this tick (and whether they
|
||||
drive it), noted; and every few ticks where their unit is */
|
||||
static void distributed_note_targets(
|
||||
@@ -1870,6 +1941,14 @@ static boolean distributed_report_valid(
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
/* an Infection zombie's blow at a rider (not the vehicle, as the game's
|
||||
melee has it) only past the host's own line to them (infection.c) */
|
||||
if (melee && infection_unit_is_zombie(distributed_living_unit(player)) && target->object.type == _object_type_biped &&
|
||||
target->object.parent_object_index != NONE &&
|
||||
!infection_melee_rider_visible(distributed_living_unit(player), report->object_index, &report->damage.direction))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (collision && !distributed_player_drove_into(player_index, &report->damage.epicenter, &report->target_position,
|
||||
target->object.bounding_sphere_radius, ticks))
|
||||
{
|
||||
@@ -1941,7 +2020,8 @@ static boolean distributed_report_valid(
|
||||
{
|
||||
normalize3d(&damage->direction);
|
||||
}
|
||||
damage->multiplier = 1.0f;
|
||||
/* (an Infection zombie's skull's blow: its multiplier the host's own) */
|
||||
damage->multiplier = melee ? infection_melee_multiplier(distributed_living_unit(player)) : 1.0f;
|
||||
damage->owner_player_index = DATUM_INDEX_NEW(player_index, player->identifier);
|
||||
damage->owner_team_index = (short)player->team_index;
|
||||
/* (the players' traits' multipliers go by the object) */
|
||||
@@ -1962,8 +2042,26 @@ void network_damage_handle_reports(
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
struct distributed_hit_report const *report = &reports[index];
|
||||
struct distributed_hit_report found;
|
||||
struct damage_data damage;
|
||||
|
||||
/* (a hit on the client's copy of a static target made in the game,
|
||||
at an index of its own there: the host's where the client had it) */
|
||||
if (distributed_object_index_valid(report->object_index) &&
|
||||
distributed_point_valid(&report->target_position, REPORT_WORLD_BOUND) &&
|
||||
!object_try_and_get_and_verify_type(report->object_index,
|
||||
_object_mask_biped | _object_mask_vehicle | _object_mask_weapon | _object_mask_equipment) &&
|
||||
!static_target(report->object_index))
|
||||
{
|
||||
long object_index = static_target_near(&report->target_position, STATIC_TARGET_MATCH_TOLERANCE);
|
||||
|
||||
if (object_index != NONE)
|
||||
{
|
||||
found = *report;
|
||||
found.object_index = object_index;
|
||||
report = &found;
|
||||
}
|
||||
}
|
||||
if (!distributed_report_valid(machine_index, report, &damage))
|
||||
{
|
||||
damage_rejected_reports++;
|
||||
@@ -2255,15 +2353,33 @@ void network_damage_handle_events(
|
||||
}
|
||||
break;
|
||||
case _damage_event_static:
|
||||
if (distributed_object_index_valid(event->object_index) && static_target(event->object_index) &&
|
||||
distributed_damage_indices_valid(event->object_index, event->node_index, event->region_index,
|
||||
{
|
||||
long object_index = event->object_index;
|
||||
|
||||
/* (one made in the game, at an index of its own here: this machine's
|
||||
copy at the damage, within its reach, an explosion's its radius) */
|
||||
if (distributed_object_index_valid(object_index) && !static_target(object_index) &&
|
||||
!object_try_and_get_and_verify_type(object_index, _object_mask_all))
|
||||
{
|
||||
real reach = REPORT_IMPACT_TOLERANCE;
|
||||
|
||||
if (TEST_FLAG(damage.flags, _damage_area_of_effect_bit) &&
|
||||
tag_index_is_group(damage.definition_index, DAMAGE_EFFECT_DEFINITION_TAG))
|
||||
{
|
||||
reach += damage_effect_definition_get(damage.definition_index)->cutoff_radius;
|
||||
}
|
||||
object_index = static_target_near(&damage.origin, reach);
|
||||
}
|
||||
if (distributed_object_index_valid(object_index) && static_target(object_index) &&
|
||||
distributed_damage_indices_valid(object_index, event->node_index, event->region_index,
|
||||
event->material_index))
|
||||
{
|
||||
damage_replay_static(event->object_index, &damage, event->node_index, event->region_index,
|
||||
damage_replay_static(object_index, &damage, event->node_index, event->region_index,
|
||||
event->material_index);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,9 @@ rest as the host has it:
|
||||
(player_queues_new.c).
|
||||
- Every tick, a client sends the host where its own players' units are (it
|
||||
predicts them from its own input); the host takes that as they are,
|
||||
within a tolerance, as later Halo engines do, at its next tick (on a
|
||||
moving elevator, only across: its own elevator takes them up and down).
|
||||
within a tolerance, as later Halo engines do, at its next tick (riding
|
||||
an elevator, moving or underfoot at rest, only across: its own elevator
|
||||
takes them up and down).
|
||||
- Every tick, the host sends every client every player's unit: which unit
|
||||
the player has, alive or not, the seat it rides, its shields and health
|
||||
(down, recharging, the damage they show), and where it is (dead: who
|
||||
@@ -76,7 +77,10 @@ machine (their datum identifiers need not be).
|
||||
#include "network_coop.h"
|
||||
#include "network_distributed.h"
|
||||
#include "network_voice.h"
|
||||
#include "network_aim_assist.h"
|
||||
#include "network_shield_effects.h"
|
||||
#include "map_share.h"
|
||||
#include "latency_meter.h"
|
||||
#include "profile_sections.h"
|
||||
|
||||
#include <limits.h>
|
||||
@@ -108,7 +112,10 @@ void p2p_hardware_id_sanitize(char *destination, int size, const char *source);
|
||||
void p2p_discord_sanitize(char *destination, int size, const char *source, int name);
|
||||
void p2p_discord_identity(char *id, int id_size, char *name, int name_size);
|
||||
unsigned long p2p_peer_endpoint_address(unsigned long virtual_address);
|
||||
/* network_connection.c's */
|
||||
boolean network_connection_last_read_was_unreliable(void);
|
||||
unsigned long system_milliseconds(void);
|
||||
void platform_log(char const *format, ...);
|
||||
void console_warning(const char *format, ...);
|
||||
|
||||
/* the host: a client's game run faster than its clock (a speed hack, which
|
||||
@@ -128,6 +135,10 @@ host's copies go as its own ticks have them) ... */
|
||||
#define CLIENT_CLOCK_FAST_WINDOWS 5
|
||||
/* the longest notice's text (_distributed_message_notice) */
|
||||
#define MAXIMUM_NOTICE_LENGTH 160
|
||||
/* how far a datagram's tick may be from the latest a message from its
|
||||
sender had, either way (distributed_sender_times): as long as a machine may
|
||||
go silent before it is dropped */
|
||||
#define DISTRIBUTED_TIME_WINDOW_TICKS (15 * TICKS_PER_SECOND)
|
||||
/* a Discord user's id and name as kept, with their ends (p2p.h's
|
||||
P2P_DISCORD_ID_SIZE and P2P_DISCORD_NAME_SIZE) */
|
||||
#define DISCORD_ID_SIZE 24
|
||||
@@ -182,6 +193,15 @@ enum
|
||||
/* ... and beyond it, the ticks a client's own player may ride otherwise
|
||||
than the host has it */
|
||||
SEAT_DISAGREEMENT_SLACK_TICKS = 6,
|
||||
/* the latency meter (latency_meter.c): the same round trips timed in
|
||||
milliseconds, by when each of the last ticks was sent (a power of two,
|
||||
more than the longest round trip); the longest shown; how often what is
|
||||
shown is refreshed; and how long the host (to a client) or a client (to
|
||||
the host) says nothing before it is said to have a connection problem */
|
||||
TICK_SENT_TIMES = 64,
|
||||
MAXIMUM_PING_MILLISECONDS = 9999,
|
||||
PING_REFRESH_TICKS = TICKS_PER_SECOND / 2,
|
||||
CONNECTION_PROBLEM_MILLISECONDS = 2000,
|
||||
/* a client: where its own players' units were, the last ticks (a power
|
||||
of two, more than the longest round trip) */
|
||||
OWN_POSITION_TICKS = 64,
|
||||
@@ -249,12 +269,24 @@ enum
|
||||
_distributed_unit_part_killer_bit,
|
||||
};
|
||||
|
||||
/* world units: how far apart the host's run of a client's player and the
|
||||
client's may be, a tick from the same place, and agree (distributed_divergence:
|
||||
well past the last bits' rounding, well short of a player running 1% faster) */
|
||||
#define DIVERGENCE_APART_DISTANCE 0.0001f
|
||||
|
||||
/* world units: how far a client's own player's unit may be from the host's
|
||||
before the host takes it no longer, and before the client is put where the
|
||||
host has it (no further than that: between the two they would disagree for
|
||||
good, the host's player somewhere its own is not) */
|
||||
#define HOST_ACCEPT_TOLERANCE 3.5f
|
||||
#define LOCAL_CORRECTION_TOLERANCE 3.0f
|
||||
/* world units: how far below or above the host's echo of its prediction a
|
||||
client's own player standing on the same elevator may be and keep its own
|
||||
floor's height (distributed_correct_own_unit). The two machines' elevators
|
||||
are apart by what the platform travels in a round trip (the history below
|
||||
holds 64 ticks, two seconds); a greater difference is not that lag but a
|
||||
teleport, a fall or a platform out of step, and is corrected. */
|
||||
#define ELEVATOR_PHASE_TOLERANCE 4.0f
|
||||
/* how fast a client's own player's unit moves at most (world units a tick) */
|
||||
#define MAXIMUM_PREDICTED_SPEED 2.0f
|
||||
/* ... on foot: this many times as fast as a player runs and jumps, or as
|
||||
@@ -332,7 +364,9 @@ struct distributed_player_input
|
||||
byte player_index;
|
||||
/* co-op: the structure BSP the client has loaded */
|
||||
byte structure_bsp_index;
|
||||
byte pad[2];
|
||||
/* co-op: the player chose to play without friendly fire */
|
||||
byte coop_no_friendly_fire;
|
||||
byte pad;
|
||||
/* the client's tick */
|
||||
long tick;
|
||||
/* the latest host tick the client has had a message of (the host
|
||||
@@ -564,6 +598,8 @@ static struct distributed_own_position
|
||||
long time;
|
||||
long unit_index;
|
||||
real_point3d position;
|
||||
/* local history only: NONE after jumping or walking off the platform */
|
||||
long elevator_index;
|
||||
} distributed_own_positions[MAXIMUM_LOCAL_PLAYERS][OWN_POSITION_TICKS];
|
||||
static real distributed_own_round_trip;
|
||||
/* the host: the players each machine had when it last told the host that it
|
||||
@@ -621,6 +657,14 @@ static long distributed_game_state_time;
|
||||
/* the latest tick of each kind of unreliable message had from each sender
|
||||
(a machine, or the host), NONE for none */
|
||||
static long distributed_received_times[MAXIMUM_SENDERS][NUMBER_OF_DISTRIBUTED_MESSAGES];
|
||||
/* the latest tick of any message had from each sender, NONE for none: a
|
||||
datagram, which anyone can send as from another machine, is dropped when
|
||||
its tick is further from it than DISTRIBUTED_TIME_WINDOW_TICKS (one stamped
|
||||
far ahead would have every newer one of the sender's taken for stale, and
|
||||
its clock for fast); a message over the sender's stream, which only it can
|
||||
send, is taken whatever its tick, and moves it
|
||||
(distributed_message_time_bounded) */
|
||||
static long distributed_sender_times[MAXIMUM_SENDERS];
|
||||
/* the host: each client machine's clock, measured (CLIENT_CLOCK_WINDOW_MILLISECONDS):
|
||||
its latest tick, and its tick and the host's time as the window began
|
||||
(NONE: none begun); how many windows in a row it went fast, and whether
|
||||
@@ -648,15 +692,45 @@ static struct distributed_client_clock
|
||||
/* the host: whether the message being handled came over its machine's
|
||||
stream (network_distributed_handle_stream_message) */
|
||||
static boolean distributed_handling_stream_message;
|
||||
/* a client: the host's latest tick it has had a message of */
|
||||
/* a client: the host's latest tick it has had a message of, and when that
|
||||
message came (system_milliseconds) */
|
||||
static long distributed_host_time = NONE;
|
||||
/* the host: each client's round trip, in ticks, and its jitter */
|
||||
static unsigned long distributed_host_time_received;
|
||||
/* the host: each client's round trip, in ticks, and its jitter; the same
|
||||
in milliseconds (the latency meter's); and when the client was last heard
|
||||
from (system_milliseconds) */
|
||||
static struct
|
||||
{
|
||||
boolean valid;
|
||||
real average;
|
||||
real deviation;
|
||||
boolean milliseconds_valid;
|
||||
real milliseconds;
|
||||
unsigned long heard;
|
||||
/* (logged: silent since when it was heard, 0 for not silent) */
|
||||
unsigned long silent_since;
|
||||
} distributed_round_trips[HALO_PORT_MAXIMUM_NETWORK_MACHINES];
|
||||
/* the latency meter: when each of this machine's last ticks was sent
|
||||
(system_milliseconds), by tick; a round trip coming back naming one of
|
||||
them is timed by it */
|
||||
static struct
|
||||
{
|
||||
long time;
|
||||
unsigned long milliseconds;
|
||||
} distributed_tick_sent_times[TICK_SENT_TIMES];
|
||||
/* ... a client: its own round trip in milliseconds, as the host has its
|
||||
players and tells it back, and whether it is measured; and since when the
|
||||
host has been silent (logged), 0 for not silent */
|
||||
static boolean distributed_own_ping_valid;
|
||||
static real distributed_own_ping_milliseconds;
|
||||
static unsigned long distributed_host_silent_since;
|
||||
/* ... what is shown (refreshed in the tick every PING_REFRESH_TICKS, so
|
||||
the render reads it whole): each player's round trip as this machine times
|
||||
it (the host: each client's, its own players' 0; a client: its own
|
||||
players'), a client's own, and the host's slowest client's; NONE for none */
|
||||
static long distributed_shown_pings[MAXIMUM_TRACKED_PLAYERS];
|
||||
static long distributed_shown_own_ping = NONE;
|
||||
static long distributed_shown_slowest_ping = NONE;
|
||||
/* a client: each player's ping as the host last told it (UNKNOWN_PING: not
|
||||
told) */
|
||||
static word distributed_player_pings[MAXIMUM_TRACKED_PLAYERS];
|
||||
@@ -683,6 +757,35 @@ static struct
|
||||
long received;
|
||||
long corrections;
|
||||
} distributed_statistics;
|
||||
/* ... and (the host) how far apart a client's player moved in a tick on the
|
||||
client and on the host, where the host took the client's last prediction
|
||||
the tick before, that was of the client's tick before, and the host's tick
|
||||
ran the player with the client's input of that tick: both machines then
|
||||
moved the player one tick with the same input from much the same place, so
|
||||
builds that simulate alike move it alike to the last bit (but where the
|
||||
player touched something the two have in different places), and a build
|
||||
that moves a player otherwise moves it otherwise, every tick the player
|
||||
moves (tools/net_compare.py). The move, not where it ends: the host's
|
||||
copy is put only halfway to a prediction a little off, and would be as far
|
||||
off the next for ticks after. Since network_distributed_divergence last
|
||||
read them: how many such ticks, how many of them further apart than
|
||||
DIVERGENCE_APART_DISTANCE, and the mean and the largest distance. */
|
||||
static struct
|
||||
{
|
||||
long samples;
|
||||
long apart;
|
||||
real total;
|
||||
real largest;
|
||||
/* the tick of the client's and of the host's last prediction taken */
|
||||
long taken_time[MAXIMUM_TRACKED_PLAYERS];
|
||||
long taken_host_time[MAXIMUM_TRACKED_PLAYERS];
|
||||
/* where that prediction had the player, and where it left the host's */
|
||||
real_point3d taken_position[MAXIMUM_TRACKED_PLAYERS];
|
||||
real_point3d taken_host_position[MAXIMUM_TRACKED_PLAYERS];
|
||||
/* the client's tick of the latest input the host has of each player
|
||||
(what the host's tick ran it with) */
|
||||
long input_time[MAXIMUM_TRACKED_PLAYERS];
|
||||
} distributed_divergence;
|
||||
|
||||
/* ---------- shared (network_distributed.h) */
|
||||
|
||||
@@ -702,6 +805,22 @@ void distributed_count_correction(
|
||||
distributed_statistics.corrections++;
|
||||
}
|
||||
|
||||
void network_distributed_divergence(
|
||||
long *samples,
|
||||
long *apart,
|
||||
real *mean,
|
||||
real *largest)
|
||||
{
|
||||
*samples = distributed_divergence.samples;
|
||||
*apart = distributed_divergence.apart;
|
||||
*mean = distributed_divergence.samples ? distributed_divergence.total / (real)distributed_divergence.samples : 0.0f;
|
||||
*largest = distributed_divergence.largest;
|
||||
distributed_divergence.samples = 0;
|
||||
distributed_divergence.apart = 0;
|
||||
distributed_divergence.total = 0.0f;
|
||||
distributed_divergence.largest = 0.0f;
|
||||
}
|
||||
|
||||
boolean distributed_real_valid(
|
||||
real value)
|
||||
{
|
||||
@@ -1275,6 +1394,7 @@ static boolean distributed_machine_loaded(
|
||||
sizeof(distributed_machine_players[machine_index]));
|
||||
for (type = 0; type < NUMBER_OF_DISTRIBUTED_MESSAGES; type++)
|
||||
distributed_received_times[machine_index][type] = NONE;
|
||||
distributed_sender_times[machine_index] = NONE;
|
||||
csmemset(&distributed_round_trips[machine_index], 0, sizeof(distributed_round_trips[machine_index]));
|
||||
csmemset(distributed_viewers[machine_index], 0, sizeof(distributed_viewers[machine_index]));
|
||||
csmemset(&distributed_client_clocks[machine_index], 0, sizeof(distributed_client_clocks[machine_index]));
|
||||
@@ -1347,6 +1467,210 @@ real distributed_machine_round_trip_ticks(
|
||||
return distributed_round_trips[machine_index].average + 2.0f * distributed_round_trips[machine_index].deviation;
|
||||
}
|
||||
|
||||
/* ---------- the latency meter's round trips */
|
||||
|
||||
/* the milliseconds since this machine sent the messages of its tick (at
|
||||
most MAXIMUM_PING_MILLISECONDS), NONE if that tick is not one of the last
|
||||
TICK_SENT_TIMES */
|
||||
static long distributed_milliseconds_since_tick(
|
||||
long time)
|
||||
{
|
||||
unsigned long elapsed;
|
||||
|
||||
if (time == NONE || distributed_tick_sent_times[time & (TICK_SENT_TIMES - 1)].time != time)
|
||||
return NONE;
|
||||
elapsed = system_milliseconds() - distributed_tick_sent_times[time & (TICK_SENT_TIMES - 1)].milliseconds;
|
||||
return elapsed > (unsigned long)MAXIMUM_PING_MILLISECONDS ? MAXIMUM_PING_MILLISECONDS : (long)elapsed;
|
||||
}
|
||||
|
||||
/* a round trip in milliseconds into a smoothed one (as TCP smooths its own,
|
||||
an eighth), the first as it is */
|
||||
static void distributed_smooth_ping(
|
||||
boolean *valid,
|
||||
real *milliseconds,
|
||||
long sample)
|
||||
{
|
||||
if (!*valid)
|
||||
{
|
||||
*valid = TRUE;
|
||||
*milliseconds = (real)sample;
|
||||
}
|
||||
else
|
||||
{
|
||||
*milliseconds += ((real)sample - *milliseconds) / 8.0f;
|
||||
}
|
||||
}
|
||||
|
||||
/* (a client) the milliseconds since the host's latest message came, NONE
|
||||
before the first */
|
||||
static long distributed_host_silence(
|
||||
void)
|
||||
{
|
||||
return distributed_host_time == NONE ? NONE : (long)(system_milliseconds() - distributed_host_time_received);
|
||||
}
|
||||
|
||||
/* (the host) whether the client machine has said nothing for a while */
|
||||
static boolean distributed_machine_silent(
|
||||
long machine_index)
|
||||
{
|
||||
return game_engine_in_play() && machine_index >= 0 && machine_index < HALO_PORT_MAXIMUM_NETWORK_MACHINES &&
|
||||
distributed_round_trips[machine_index].heard &&
|
||||
system_milliseconds() - distributed_round_trips[machine_index].heard > CONNECTION_PROBLEM_MILLISECONDS;
|
||||
}
|
||||
|
||||
/* (a client) the host has its players (or its vehicle) at that tick of this
|
||||
machine's, as told now: its own round trip timed */
|
||||
void distributed_note_own_round_trip(
|
||||
long time)
|
||||
{
|
||||
long sample = distributed_milliseconds_since_tick(time);
|
||||
|
||||
if (sample != NONE && game_connection() == _game_connection_network_client)
|
||||
distributed_smooth_ping(&distributed_own_ping_valid, &distributed_own_ping_milliseconds, sample);
|
||||
}
|
||||
|
||||
/* what the latency meter shows, refreshed in the tick (with Latency meter
|
||||
On): a client's own round trip, the host's slowest client's (one silent
|
||||
for a while as long as it has been); and in the log, each connection
|
||||
problem as it starts and ends, and the round trips every ten seconds */
|
||||
static void distributed_refresh_pings(
|
||||
void)
|
||||
{
|
||||
short connection = game_connection();
|
||||
short player_index;
|
||||
|
||||
distributed_shown_own_ping = NONE;
|
||||
distributed_shown_slowest_ping = NONE;
|
||||
if (connection == _game_connection_network_client && distributed_own_ping_valid)
|
||||
distributed_shown_own_ping = (long)(distributed_own_ping_milliseconds + 0.5f);
|
||||
for (player_index = 0; player_index < MAXIMUM_TRACKED_PLAYERS; player_index++)
|
||||
{
|
||||
long ping = NONE;
|
||||
|
||||
if (!distributed_player(player_index))
|
||||
;
|
||||
else if (connection == _game_connection_network_server)
|
||||
{
|
||||
long machine_index = distributed_player_machines[player_index];
|
||||
|
||||
if (machine_index == NONE)
|
||||
ping = 0;
|
||||
else if (machine_index >= 0 && machine_index < HALO_PORT_MAXIMUM_NETWORK_MACHINES &&
|
||||
distributed_round_trips[machine_index].milliseconds_valid)
|
||||
{
|
||||
ping = (long)(distributed_round_trips[machine_index].milliseconds + 0.5f);
|
||||
}
|
||||
}
|
||||
else if (distributed_player_is_local(player_index))
|
||||
{
|
||||
ping = distributed_shown_own_ping;
|
||||
}
|
||||
distributed_shown_pings[player_index] = ping;
|
||||
}
|
||||
if (connection == _game_connection_network_server)
|
||||
{
|
||||
long machine_indices[HALO_PORT_MAXIMUM_NETWORK_MACHINES];
|
||||
short count = distributed_client_machines(machine_indices, HALO_PORT_MAXIMUM_NETWORK_MACHINES);
|
||||
boolean log_round_trips = game_time_get() % (10 * TICKS_PER_SECOND) == 0;
|
||||
char line[512];
|
||||
int length = 0;
|
||||
short index;
|
||||
|
||||
line[0] = 0;
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
long machine_index = machine_indices[index];
|
||||
boolean silent;
|
||||
long ping;
|
||||
|
||||
if (machine_index < 0 || machine_index >= HALO_PORT_MAXIMUM_NETWORK_MACHINES)
|
||||
continue;
|
||||
silent = distributed_machine_silent(machine_index);
|
||||
if (silent && !distributed_round_trips[machine_index].silent_since)
|
||||
{
|
||||
distributed_round_trips[machine_index].silent_since = distributed_round_trips[machine_index].heard;
|
||||
platform_log("latency: machine %ld silent for %lu ms: connection problem", machine_index,
|
||||
system_milliseconds() - distributed_round_trips[machine_index].heard);
|
||||
}
|
||||
else if (!silent && distributed_round_trips[machine_index].silent_since)
|
||||
{
|
||||
platform_log("latency: machine %ld heard again after %lu ms", machine_index,
|
||||
distributed_round_trips[machine_index].heard - distributed_round_trips[machine_index].silent_since);
|
||||
distributed_round_trips[machine_index].silent_since = 0;
|
||||
}
|
||||
if (!distributed_round_trips[machine_index].milliseconds_valid)
|
||||
continue;
|
||||
ping = (long)(distributed_round_trips[machine_index].milliseconds + 0.5f);
|
||||
if (silent)
|
||||
{
|
||||
ping = MAX(ping, (long)MIN(system_milliseconds() - distributed_round_trips[machine_index].heard,
|
||||
(unsigned long)MAXIMUM_PING_MILLISECONDS));
|
||||
}
|
||||
distributed_shown_slowest_ping = MAX(distributed_shown_slowest_ping, ping);
|
||||
if (log_round_trips && length < (int)sizeof(line) - 64)
|
||||
{
|
||||
length += snprintf(line + length, sizeof(line) - length, "%s machine %ld %ld ms (%.1f ticks)%s",
|
||||
length ? "," : "", machine_index, ping, distributed_round_trips[machine_index].average,
|
||||
silent ? " silent" : "");
|
||||
}
|
||||
}
|
||||
if (length)
|
||||
platform_log("latency: the clients' round trips:%s", line);
|
||||
}
|
||||
else if (connection == _game_connection_network_client)
|
||||
{
|
||||
boolean problem = distributed_connection_problem();
|
||||
|
||||
if (problem && !distributed_host_silent_since)
|
||||
{
|
||||
distributed_host_silent_since = distributed_host_time_received ? distributed_host_time_received : 1;
|
||||
platform_log("latency: the host silent for %ld ms: connection problem", distributed_host_silence());
|
||||
}
|
||||
else if (!problem && distributed_host_silent_since)
|
||||
{
|
||||
platform_log("latency: the host heard again after %lu ms",
|
||||
distributed_host_time_received - distributed_host_silent_since);
|
||||
distributed_host_silent_since = 0;
|
||||
}
|
||||
if (game_time_get() % (10 * TICKS_PER_SECOND) == 0 && distributed_own_ping_valid)
|
||||
{
|
||||
platform_log("latency: round trip to the host %ld ms (%.1f ticks)%s", distributed_shown_own_ping,
|
||||
distributed_own_round_trip, problem ? ", connection problem" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
long distributed_player_measured_ping(
|
||||
short player_index)
|
||||
{
|
||||
return player_index >= 0 && player_index < MAXIMUM_TRACKED_PLAYERS ? distributed_shown_pings[player_index] : NONE;
|
||||
}
|
||||
|
||||
long distributed_own_ping(
|
||||
void)
|
||||
{
|
||||
return game_connection() == _game_connection_network_client ? distributed_shown_own_ping : NONE;
|
||||
}
|
||||
|
||||
long distributed_slowest_client_ping(
|
||||
void)
|
||||
{
|
||||
return game_connection() == _game_connection_network_server ? distributed_shown_slowest_ping : NONE;
|
||||
}
|
||||
|
||||
boolean distributed_connection_problem(
|
||||
void)
|
||||
{
|
||||
/* (a game over: the host sends nothing of it) */
|
||||
if (game_connection() == _game_connection_network_client && game_engine_in_play())
|
||||
{
|
||||
long silence = distributed_host_silence();
|
||||
|
||||
return silence != NONE && silence > CONNECTION_PROBLEM_MILLISECONDS;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ---------- units */
|
||||
|
||||
static void distributed_state_from_player(
|
||||
@@ -1630,6 +1954,26 @@ static boolean distributed_apply_state(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* the elevator a unit stands on this tick, or NONE. A remembered elevator
|
||||
lasts after a jump. Only a current floor contact allows ignoring a height
|
||||
difference caused by the platforms' different phases. biped_update_moving
|
||||
(bipeds.c) sets elevator_ticks to 60 each tick the biped's physics finds it
|
||||
on an elevator, and counts it down from then on. */
|
||||
static long distributed_supported_elevator(
|
||||
long unit_index)
|
||||
{
|
||||
struct biped_datum *biped = (struct biped_datum *)object_try_and_get_and_verify_type(unit_index,
|
||||
_object_mask_biped);
|
||||
struct device_datum *elevator;
|
||||
|
||||
if (!biped || TEST_FLAG(biped->biped.flags, _biped_airborne_bit) ||
|
||||
biped->biped.support_surface_index == NONE || biped->biped.elevator_ticks != 60)
|
||||
return NONE;
|
||||
elevator = (struct device_datum *)object_try_and_get_and_verify_type(biped->biped.elevator_object_index,
|
||||
_object_mask_machine);
|
||||
return elevator ? biped->biped.elevator_object_index : NONE;
|
||||
}
|
||||
|
||||
/* (a client) where its own players' units are this tick, noted */
|
||||
static void distributed_note_own_positions(
|
||||
void)
|
||||
@@ -1649,6 +1993,7 @@ static void distributed_note_own_positions(
|
||||
unit_index = NONE;
|
||||
own->time = game_time_get();
|
||||
own->unit_index = unit_index;
|
||||
own->elevator_index = unit_index != NONE ? distributed_supported_elevator(unit_index) : NONE;
|
||||
if (unit_index != NONE)
|
||||
own->position = object_get(unit_index)->object.position;
|
||||
}
|
||||
@@ -1669,11 +2014,22 @@ static void distributed_correct_own_unit(
|
||||
|
||||
/* (co-op: the host has its player in a BSP this machine hasn't loaded
|
||||
yet, the switch still on its way. Moved there, it would fall with no
|
||||
floor under it, so it stays on the floor it has until the BSP loads.) */
|
||||
if (network_coop_active() && scenario_leaf_index_from_point(&state->position) == NONE &&
|
||||
scenario_leaf_index_from_point(&object_get(unit_index)->object.position) != NONE)
|
||||
floor under it, so it stays on the floor it has until the BSP loads.
|
||||
Tested at the unit's middle, not its feet: a teleport can leave the feet
|
||||
a hair below the floor's plane, which is outside the BSP.) */
|
||||
if (network_coop_active())
|
||||
{
|
||||
return;
|
||||
struct object_datum *object = object_get(unit_index);
|
||||
real_point3d host_middle;
|
||||
|
||||
host_middle.x = state->position.x + object->object.bounding_sphere_center.x - object->object.position.x;
|
||||
host_middle.y = state->position.y + object->object.bounding_sphere_center.y - object->object.position.y;
|
||||
host_middle.z = state->position.z + object->object.bounding_sphere_center.z - object->object.position.z;
|
||||
if (scenario_leaf_index_from_point(&host_middle) == NONE &&
|
||||
scenario_leaf_index_from_point(&object->object.bounding_sphere_center) != NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (TEST_FLAG(state->flags, _distributed_unit_predicted_bit) &&
|
||||
local_player_index >= 0 && local_player_index < MAXIMUM_LOCAL_PLAYERS)
|
||||
@@ -1695,9 +2051,21 @@ static void distributed_correct_own_unit(
|
||||
distributed_own_round_trip = (real)(now - time);
|
||||
else
|
||||
distributed_own_round_trip += ((real)(now - time) - distributed_own_round_trip) / 8.0f;
|
||||
distributed_note_own_round_trip(time);
|
||||
error.i = state->position.x - own->position.x;
|
||||
error.j = state->position.y - own->position.y;
|
||||
error.k = state->position.z - own->position.z;
|
||||
/* The host echoes our prediction on its own elevator's floor. If
|
||||
we still stand on that platform, a small height error is its phase
|
||||
lag, not player motion. Keep local floor contact; teleports across,
|
||||
a height error past the lag, a jump, a different platform and
|
||||
unpredicted states correct normally. */
|
||||
if (own->elevator_index != NONE &&
|
||||
own->elevator_index == distributed_supported_elevator(unit_index) &&
|
||||
error.i * error.i + error.j * error.j <=
|
||||
LOCAL_CORRECTION_TOLERANCE * LOCAL_CORRECTION_TOLERANCE &&
|
||||
error.k >= -ELEVATOR_PHASE_TOLERANCE && error.k <= ELEVATOR_PHASE_TOLERANCE)
|
||||
error.k = 0.0f;
|
||||
if (!(error.i * error.i + error.j * error.j + error.k * error.k >
|
||||
LOCAL_CORRECTION_TOLERANCE * LOCAL_CORRECTION_TOLERANCE))
|
||||
{
|
||||
@@ -2028,9 +2396,12 @@ static boolean distributed_on_foot_move_valid(
|
||||
return dx * dx + dy * dy + rise * rise <= reach * reach && -dz <= fall_reach;
|
||||
}
|
||||
|
||||
/* (the host) whether a unit rides an elevator that is moving (bipeds.c's
|
||||
elevator, kept a moment after the unit leaves its floor, as in a jump) */
|
||||
static boolean distributed_riding_moving_elevator(
|
||||
/* (the host) whether a unit rides an elevator: one that is moving (bipeds.c's
|
||||
elevator, kept a moment after the unit leaves its floor, as in a jump), or
|
||||
one at rest whose floor it stands on, since a stop or reversal must not
|
||||
admit a delayed height under the floor. The remembered elevator alone, after
|
||||
leaving a stopped one, is not riding it. */
|
||||
static boolean distributed_riding_elevator(
|
||||
long unit_index)
|
||||
{
|
||||
struct biped_datum *biped = (struct biped_datum *)object_try_and_get_and_verify_type(unit_index,
|
||||
@@ -2040,19 +2411,21 @@ static boolean distributed_riding_moving_elevator(
|
||||
if (!biped || biped->biped.elevator_object_index == NONE)
|
||||
return FALSE;
|
||||
elevator = (struct device_datum *)object_try_and_get_and_verify_type(biped->biped.elevator_object_index,
|
||||
_object_mask_device);
|
||||
return elevator && elevator->device.position_velocity != 0.0f;
|
||||
_object_mask_machine);
|
||||
return elevator && (elevator->device.position_velocity != 0.0f ||
|
||||
distributed_supported_elevator(unit_index) != NONE);
|
||||
}
|
||||
|
||||
/* (the host) a client's player's prediction of its unit on foot, taken
|
||||
where it says within a tolerance (distributed_apply_predictions). Riding a
|
||||
moving elevator, only across: a client's elevator follows the host's
|
||||
(network_coop.c), behind it by the time the host's word takes to come, and
|
||||
the client's prediction a round trip behind the host's elevator when it
|
||||
comes. Taken up and down too, it would put the host's unit under its own
|
||||
elevator's floor going up, to fall through it, and the client's after it
|
||||
(distributed_correct_own_unit); each machine's elevator carries its own
|
||||
unit up and down as it moves, and they meet where it stops. */
|
||||
where it says within a tolerance (distributed_apply_predictions). Riding an
|
||||
elevator (distributed_riding_elevator), only across: a client's elevator
|
||||
follows the host's (network_coop.c), behind it by the time the host's word
|
||||
takes to come, and the client's prediction a round trip behind the host's
|
||||
elevator when it comes. Taken up and down too, it would put the host's unit
|
||||
under its own elevator's floor going up, to fall through it, and the
|
||||
client's after it (distributed_correct_own_unit); each machine's elevator
|
||||
carries its own unit up and down as it moves, and they meet where it
|
||||
stops. */
|
||||
static void distributed_take_prediction(
|
||||
short player_index,
|
||||
long unit_index,
|
||||
@@ -2064,11 +2437,35 @@ static void distributed_take_prediction(
|
||||
real_point3d position = state->position;
|
||||
real dx, dy, dz;
|
||||
|
||||
if (distributed_riding_moving_elevator(unit_index))
|
||||
if (distributed_riding_elevator(unit_index))
|
||||
position.z = object->object.position.z;
|
||||
dx = position.x - object->object.position.x;
|
||||
dy = position.y - object->object.position.y;
|
||||
dz = position.z - object->object.position.z;
|
||||
/* (for the tests' reports: a tick on from the last taken, on both, with
|
||||
the input the client's tick ran: an input's tick is the client's time
|
||||
before it ran, a prediction's after; the prediction's time is the
|
||||
client's word, kept from overflowing) */
|
||||
if (distributed_divergence.taken_host_time[player_index] == now - 1 &&
|
||||
distributed_predictions[player_index].time != LONG_MIN &&
|
||||
distributed_divergence.taken_time[player_index] == distributed_predictions[player_index].time - 1 &&
|
||||
distributed_divergence.input_time[player_index] == distributed_predictions[player_index].time - 1)
|
||||
{
|
||||
real_point3d const *client_from = &distributed_divergence.taken_position[player_index];
|
||||
real_point3d const *host_from = &distributed_divergence.taken_host_position[player_index];
|
||||
real mx = (position.x - client_from->x) - (object->object.position.x - host_from->x);
|
||||
real my = (position.y - client_from->y) - (object->object.position.y - host_from->y);
|
||||
real mz = (position.z - client_from->z) - (object->object.position.z - host_from->z);
|
||||
real distance = (real)sqrt(mx * mx + my * my + mz * mz);
|
||||
|
||||
distributed_divergence.samples++;
|
||||
if (distance > DIVERGENCE_APART_DISTANCE)
|
||||
distributed_divergence.apart++;
|
||||
distributed_divergence.total += distance;
|
||||
if (distance > distributed_divergence.largest)
|
||||
distributed_divergence.largest = distance;
|
||||
}
|
||||
distributed_divergence.taken_host_time[player_index] = NONE;
|
||||
if (!(dx * dx + dy * dy + dz * dz <= HOST_ACCEPT_TOLERANCE * HOST_ACCEPT_TOLERANCE))
|
||||
return;
|
||||
if (distributed_accepted[player_index].valid)
|
||||
@@ -2107,6 +2504,10 @@ static void distributed_take_prediction(
|
||||
{
|
||||
distributed_predictions[player_index].taken_time = distributed_predictions[player_index].time;
|
||||
distributed_predictions[player_index].taken_host_time = now;
|
||||
distributed_divergence.taken_time[player_index] = distributed_predictions[player_index].time;
|
||||
distributed_divergence.taken_host_time[player_index] = now;
|
||||
distributed_divergence.taken_position[player_index] = position;
|
||||
distributed_divergence.taken_host_position[player_index] = object->object.position;
|
||||
/* (a new anchor: the first, one a second on, or after a jump) */
|
||||
if (!distributed_accepted[player_index].valid ||
|
||||
now - distributed_accepted[player_index].host_time >= PREDICTION_ANCHOR_TICKS)
|
||||
@@ -2369,6 +2770,7 @@ static void distributed_client_send_inputs(
|
||||
continue;
|
||||
input->player_index = distributed_player_to_byte(player_index);
|
||||
input->structure_bsp_index = (byte)global_structure_bsp_index_get();
|
||||
input->coop_no_friendly_fire = network_coop_active() && !network_coop_own_friendly_fire();
|
||||
input->host_time = distributed_host_time;
|
||||
count++;
|
||||
}
|
||||
@@ -2443,8 +2845,22 @@ static void distributed_handle_inputs(
|
||||
if (network_coop_active() && player->unit_index != NONE)
|
||||
distributed_note_input_actions(input->player_index, &action);
|
||||
network_coop_note_player_structure_bsp(input->player_index, input->structure_bsp_index);
|
||||
network_coop_note_player_friendly_fire(DATUM_INDEX_NEW(input->player_index, player->identifier),
|
||||
!input->coop_no_friendly_fire);
|
||||
update_server_handle_distributed_input(DATUM_INDEX_NEW(input->player_index, player->identifier), input->tick,
|
||||
&action, input->control_flags, DISTRIBUTED_INPUT_HISTORY);
|
||||
/* (for the tests' reports: the newest, as the input taken is, or one
|
||||
a second or more older, the client's clock set back; the subtraction
|
||||
kept from overflowing, as the tick is the client's word) */
|
||||
{
|
||||
long newest = distributed_divergence.input_time[input->player_index];
|
||||
|
||||
if (newest == NONE || input->tick > newest ||
|
||||
(newest >= LONG_MIN + TICKS_PER_SECOND && input->tick < newest - TICKS_PER_SECOND))
|
||||
{
|
||||
distributed_divergence.input_time[input->player_index] = input->tick;
|
||||
}
|
||||
}
|
||||
if (input->host_time != NONE && (host_time == NONE || input->host_time > host_time))
|
||||
host_time = input->host_time;
|
||||
}
|
||||
@@ -2472,6 +2888,17 @@ static void distributed_handle_inputs(
|
||||
((real)fabs(difference) - distributed_round_trips[machine_index].deviation) / 4.0f;
|
||||
}
|
||||
}
|
||||
/* (the same timed in milliseconds, for the latency meter: by when
|
||||
this machine sent that tick) */
|
||||
{
|
||||
long milliseconds = distributed_milliseconds_since_tick(host_time);
|
||||
|
||||
if (milliseconds != NONE)
|
||||
{
|
||||
distributed_smooth_ping(&distributed_round_trips[machine_index].milliseconds_valid,
|
||||
&distributed_round_trips[machine_index].milliseconds, milliseconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3337,6 +3764,7 @@ void network_distributed_new_game(
|
||||
distributed_batches[sender].size = 0;
|
||||
for (type = 0; type < NUMBER_OF_DISTRIBUTED_MESSAGES; type++)
|
||||
distributed_received_times[sender][type] = NONE;
|
||||
distributed_sender_times[sender] = NONE;
|
||||
}
|
||||
for (player_index = 0; player_index < MAXIMUM_TRACKED_PLAYERS; player_index++)
|
||||
{
|
||||
@@ -3354,12 +3782,29 @@ void network_distributed_new_game(
|
||||
}
|
||||
distributed_own_round_trip = 0.0f;
|
||||
csmemset(distributed_player_pings, 0xFF, sizeof(distributed_player_pings));
|
||||
distributed_own_ping_valid = FALSE;
|
||||
distributed_own_ping_milliseconds = 0.0f;
|
||||
distributed_host_silent_since = 0;
|
||||
distributed_shown_own_ping = NONE;
|
||||
distributed_shown_slowest_ping = NONE;
|
||||
for (player_index = 0; player_index < MAXIMUM_TRACKED_PLAYERS; player_index++)
|
||||
distributed_shown_pings[player_index] = NONE;
|
||||
for (type = 0; type < TICK_SENT_TIMES; type++)
|
||||
distributed_tick_sent_times[type].time = NONE;
|
||||
csmemset(distributed_machine_players, 0xFF, sizeof(distributed_machine_players));
|
||||
distributed_machines.in_tick = FALSE;
|
||||
distributed_machines.valid = FALSE;
|
||||
distributed_host_time = NONE;
|
||||
distributed_statistics_due = FALSE;
|
||||
distributed_pickup_count = 0;
|
||||
/* (the tests' drift figures: none taken, no input had, of this game) */
|
||||
csmemset(&distributed_divergence, 0, sizeof(distributed_divergence));
|
||||
for (player_index = 0; player_index < MAXIMUM_TRACKED_PLAYERS; player_index++)
|
||||
{
|
||||
distributed_divergence.taken_time[player_index] = NONE;
|
||||
distributed_divergence.taken_host_time[player_index] = NONE;
|
||||
distributed_divergence.input_time[player_index] = NONE;
|
||||
}
|
||||
/* (each player's latest input: player_queues_new.c) */
|
||||
update_queues_distributed_reset();
|
||||
network_objects_new_game();
|
||||
@@ -3368,6 +3813,8 @@ void network_distributed_new_game(
|
||||
bots_new_game();
|
||||
network_actors_new_game();
|
||||
network_coop_new_game();
|
||||
network_aim_assist_reset();
|
||||
network_shield_effects_reset();
|
||||
network_votekick_new_game();
|
||||
}
|
||||
|
||||
@@ -3412,6 +3859,8 @@ void network_distributed_tick(
|
||||
distributed_statistics_due = FALSE;
|
||||
if (game_time_get() % PING_INTERVAL_TICKS == 0)
|
||||
profile_scope(distributed_tick_send_pings_section, distributed_send_pings();)
|
||||
if (game_time_get() % PING_REFRESH_TICKS == 0 && latency_meter_enabled())
|
||||
distributed_refresh_pings();
|
||||
/* (before the players, so clients load a new BSP before they hear
|
||||
where the host moved everyone into it) */
|
||||
if (network_coop_active() && (global_structure_bsp_index_get() != distributed_sent_structure_bsp_index ||
|
||||
@@ -3432,6 +3881,8 @@ void network_distributed_tick(
|
||||
else if (connection == _game_connection_network_client)
|
||||
{
|
||||
profile_scope(distributed_tick_note_own_positions_section, distributed_note_own_positions();)
|
||||
if (game_time_get() % PING_REFRESH_TICKS == 0 && latency_meter_enabled())
|
||||
distributed_refresh_pings();
|
||||
profile_scope(distributed_tick_send_inputs_section, distributed_client_send_inputs();)
|
||||
network_vr_tick();
|
||||
profile_scope(distributed_tick_send_predictions_section, distributed_client_send_predictions();)
|
||||
@@ -3439,11 +3890,70 @@ void network_distributed_tick(
|
||||
profile_scope(distributed_tick_damage_client_tick_section, network_damage_client_tick();)
|
||||
profile_scope(distributed_tick_coop_client_tick_section, network_coop_client_tick();)
|
||||
}
|
||||
/* (when this tick's messages were sent: the round trips that name it
|
||||
are timed by it) */
|
||||
distributed_tick_sent_times[game_time_get() & (TICK_SENT_TIMES - 1)].time = game_time_get();
|
||||
distributed_tick_sent_times[game_time_get() & (TICK_SENT_TIMES - 1)].milliseconds = system_milliseconds();
|
||||
profile_scope(distributed_tick_batches_flush_section, distributed_batches_flush();)
|
||||
distributed_machines.in_tick = FALSE;
|
||||
distributed_machines.valid = FALSE;
|
||||
}
|
||||
|
||||
/* whether a message's tick is near enough the latest had from its sender
|
||||
to be taken (distributed_sender_times); from_stream: it came over the
|
||||
sender's stream (or a client's connection to the host), not in a datagram */
|
||||
static boolean distributed_message_time_bounded(
|
||||
long machine_index,
|
||||
long game_time,
|
||||
boolean from_stream)
|
||||
{
|
||||
short sender = machine_index == NONE ? HOST_SENDER : (short)machine_index;
|
||||
long *latest;
|
||||
unsigned long distance;
|
||||
short type;
|
||||
|
||||
if (sender < 0 || sender >= MAXIMUM_SENDERS)
|
||||
return FALSE;
|
||||
latest = &distributed_sender_times[sender];
|
||||
if (*latest == NONE)
|
||||
{
|
||||
*latest = game_time;
|
||||
return TRUE;
|
||||
}
|
||||
/* (unsigned: no tick, however far, overflows it) */
|
||||
distance = game_time > *latest ?
|
||||
(unsigned long)game_time - (unsigned long)*latest :
|
||||
(unsigned long)*latest - (unsigned long)game_time;
|
||||
if (distance > DISTRIBUTED_TIME_WINDOW_TICKS)
|
||||
{
|
||||
static unsigned long last_logged_time;
|
||||
static boolean logged;
|
||||
|
||||
if (!from_stream)
|
||||
{
|
||||
unsigned long now = system_milliseconds();
|
||||
|
||||
if (!logged || now - last_logged_time >= 1000)
|
||||
{
|
||||
error(_error_silent, "distributed message stamped %ld ticks from its sender's latest in a datagram; dropped",
|
||||
game_time > *latest ? (long)distance : -(long)distance);
|
||||
last_logged_time = now;
|
||||
logged = TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
/* (the sender's own word: what a datagram sent as from it had moved
|
||||
its latest to is forgotten) */
|
||||
*latest = game_time;
|
||||
for (type = 0; type < NUMBER_OF_DISTRIBUTED_MESSAGES; type++)
|
||||
distributed_received_times[sender][type] = NONE;
|
||||
return TRUE;
|
||||
}
|
||||
if (game_time > *latest)
|
||||
*latest = game_time;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* whether an unreliable message of the kind is older than one had already
|
||||
(then it is dropped: the newer has overtaken it) */
|
||||
static boolean distributed_message_stale(
|
||||
@@ -3628,7 +4138,8 @@ unsigned long distributed_machine_real_address(
|
||||
}
|
||||
|
||||
/* (the host) a client machine's address as text: its real one, for an
|
||||
internet play peer's stand-in (p2p.c) */
|
||||
internet play peer's stand-in (p2p.c). Whole, for the host's own CHEATERS_FILE
|
||||
and BANS_FILE, which match on it: never for the log (log_address.h) */
|
||||
static void distributed_address_text(
|
||||
unsigned long address,
|
||||
char *text,
|
||||
@@ -3979,6 +4490,16 @@ void network_distributed_handle_message(
|
||||
word entry_size;
|
||||
|
||||
/* (voice chat's, in the lobby too: network_voice.c) */
|
||||
if (network_aim_assist_handles_message(message, size))
|
||||
{
|
||||
network_aim_assist_handle_message(machine_index, message, size);
|
||||
return;
|
||||
}
|
||||
if (network_shield_effects_handles_message(message, size))
|
||||
{
|
||||
network_shield_effects_handle_message(machine_index, message, size);
|
||||
return;
|
||||
}
|
||||
if (network_voice_handles_message(message, size))
|
||||
{
|
||||
network_voice_handle_message(machine_index, message, size);
|
||||
@@ -4090,6 +4611,15 @@ void network_distributed_handle_message(
|
||||
}
|
||||
distributed_statistics.received++;
|
||||
|
||||
/* (the kinds a client sends only over its stream: in a datagram, which
|
||||
anyone can send as from it, they are not its) */
|
||||
if ((header.type == _distributed_message_client_ready ||
|
||||
header.type == _distributed_message_client_identity ||
|
||||
header.type == _distributed_message_hit_reports) &&
|
||||
!distributed_handling_stream_message)
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* (each kind from the host, or from a client; a VR player's hands
|
||||
both ways) */
|
||||
if (header.type == _distributed_message_vr_poses)
|
||||
@@ -4116,16 +4646,28 @@ void network_distributed_handle_message(
|
||||
case _distributed_message_chat_up:
|
||||
if (machine_index == NONE || game_connection() != _game_connection_network_server)
|
||||
return;
|
||||
/* (heard from: the latency meter's connection problem) */
|
||||
if (machine_index >= 0 && machine_index < HALO_PORT_MAXIMUM_NETWORK_MACHINES)
|
||||
distributed_round_trips[machine_index].heard = system_milliseconds();
|
||||
break;
|
||||
default:
|
||||
if (game_connection() != _game_connection_network_client)
|
||||
return;
|
||||
/* (the host's latest tick, which this client's input messages tell
|
||||
it back) */
|
||||
if (distributed_host_time == NONE || header.game_time > distributed_host_time)
|
||||
distributed_host_time = header.game_time;
|
||||
break;
|
||||
}
|
||||
if (!distributed_message_time_bounded(machine_index, header.game_time,
|
||||
machine_index == NONE ? !network_connection_last_read_was_unreliable() : distributed_handling_stream_message))
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* (a client: the host's latest tick, which its input messages tell it
|
||||
back; and when it came, the latency meter's) */
|
||||
if (machine_index == NONE &&
|
||||
(distributed_host_time == NONE || header.game_time > distributed_host_time))
|
||||
{
|
||||
distributed_host_time = header.game_time;
|
||||
distributed_host_time_received = system_milliseconds();
|
||||
}
|
||||
if ((distributed_handling_batch || header.type != _distributed_message_damage_events) &&
|
||||
distributed_message_stale(machine_index, &header))
|
||||
{
|
||||
@@ -4293,6 +4835,8 @@ void network_distributed_handle_message(
|
||||
|
||||
/* (its count 1: the client asks again, having failed to make one of
|
||||
the host's objects) */
|
||||
network_aim_assist_send_policy(machine_index);
|
||||
network_shield_effects_send(machine_index);
|
||||
network_objects_client_asked(machine_index, header.count != 0);
|
||||
/* (a machine new at its index, which may have joined the game in
|
||||
progress: every player's statistics and the game type's state, after
|
||||
|
||||