Commit Graph

3685 Commits

Author SHA1 Message Date
Ludovic Marie 98dc7b17b7 Merge pull request #608 from rdbtCVS/perf/versioned-behaviours-cache
Cache resolved block behaviours in versioned binary snapshots
2026-10-17 11:33:47 +02:00
Ludovic Marie cf00d588c2 Merge pull request #660 from ludovic111/perf/pathfinder-caches
Pathfinder: Fx-hashed nodes, and each path type worked out once per query
2026-10-17 11:33:06 +02:00
Ludovic Marie b859b22111 Keep usercache.json and find console players through it, as vanilla
Port CachedUserNameToIdResolver to the dedicated server, in place of the
in-memory name cache: usercache.json in the universe folder is loaded at
startup (bad entries skipped, a bad date warned about), players are added
when they join and kept for a month, and the file keeps the 1000 most
recently used, newest first, as Gson writes it.

The console's op, deop, ban, pardon and whitelist find players by name
through it, in any case. A name it doesn't hold is asked of the profile
service (profiles::find_by_name) on offline servers too, as vanilla does;
one the service doesn't know is the offline player of the lower-case name
on an offline server, and "That player does not exist" on an online one.

tools/test_user_cache_parity.py runs vanilla's server and Horizon's with a
mock profile service and compares the replies, the names looked up and the
files; the dedicated-server harness now compares usercache.json too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:33:02 +02:00
Ludovic Marie c2a82d4618 Merge pull request #658 from ludovic111/fix/sculk-scan-palette
Sculk: find a loaded chunk's sensors from its palettes, not every block (#489)
2026-10-17 11:33:01 +02:00
Ludovic Marie af0cfa9d3f Merge pull request #657 from ludovic111/fix/structure-starts-on-load
Build a saved chunk's structure starts when it loads, not on the game thread (#489)
2026-10-17 11:32:55 +02:00
Ludovic Marie 22bb18d67a Carry: the oracle's facts only for the mods it loaded
With oracle/facts.json, a mod the oracle did not load (a library it
needs is missing) lost every block: none of its ids were in the facts.
It now keeps the guesses from its blockstates, as without an oracle.
ATM10: Regions Unexplored (TerraBlender is CurseForge-only) gets its
805 blocks back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:24:31 +02:00
Cosmic e0364da4eb Avoid hurt animation for fully blocked shield hits 2026-10-17 05:11:42 -04:00
Ludovic Marie 814b70b8c2 Keep terrain in system memory when video memory is full instead of crashing (#600)
At render distance 32 the section arena holds about 1.5 GB of vertices
(2.1 GB of GPU memory in all while flying). Vulkan drivers fail an
allocation once video memory is full instead of paging like OpenGL
drivers, and wgpu's default error handler turns that into a panic: a
4 GB laptop GPU that also drives the desktop crashed a few seconds into
an RD32 world.

Arena pages are now created inside an out-of-memory error scope. A page
that doesn't fit in video memory is created mappable, which the
allocator places in host-visible system memory, so the terrain still
draws (more slowly) as OpenGL drivers do. A page that can't grow keeps
its contents and a smaller new page is tried; with no memory left at
all, the section is skipped rather than the game ending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:56:26 +02:00
Ludovic Marie 1f1d5a5aa4 Carry: leave out the files the content loader would refuse
Vanilla skips a resource with an invalid path, a data file that does not
parse, one at a time; Horizon's content loader refuses the whole mod
set. carry now keeps them in outside/ with the reason (report
`unreadable`): upper-case paths, JSON that does not parse, shared
tags with "replace": true. A byte-order mark is dropped.

ATM10's 42 carried mods: 19 such files in 7 mods (Mekanism Tools'
ry_UA lang, CTOV's empty tag, Towns and Towers' replacing tags, broken
template pools, recipes and a lang file), and the 42 load as carried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:53:46 +02:00
Ludovic Marie 3d21289df7 Merge main into perf/server-chunk-encoding
lan/chunks.rs: keep the per-section encode cache and the cached
heightmaps, applied to the level's section range from #668. Heightmaps
use client_heightmaps_in with the level's min_y and height, and
set_dimension drops cached heightmaps. The light layers go over the
level's sections and drop sky light where the level has none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:44:07 +02:00
Ludovic Marie ed9a25ad49 Measure where content mods' memory goes; drop the registry's second copy
- perf_bench.py samples the physical footprint on macOS as well as
  RSS. RSS counts the pages the allocator freed and marked reusable,
  so the six mods' "+1.1 GB" is about 0.5 GB of footprint.
- examples/resource_memory.rs: live heap, peak, RSS and footprint after
  each resource loader, for a prepared or a content-mod root.
- BlockRegistry indexes ids by a hash of the state, checked against
  the states, instead of keeping every state twice: -22 MB live for
  vanilla, -124 MB for ATM10's 42 mods (193,762 states).
- docs/modpacks.md: the per-loader breakdown and the next cut (the
  per-state tables parsed whole at startup).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:44:05 +02:00
Cosmic 394bc68702 Merge remote-tracking branch 'origin/main' into fix/sleeping-player-state 2026-10-17 04:41:31 -04:00
Cosmic 516661592f Keep sleeping input camera and HUD in bed state 2026-10-17 04:41:31 -04:00
Ludovic Marie 1af78463eb Merge pull request #677 from Online5277/fix/sweep-attack-particles
Show sweep particles on charged sword hits
2026-10-17 10:36:11 +02:00
Ludovic Marie d5837931aa Merge pull request #675 from Online5277/fix/respawn-after-save
Use the configured respawn point after saving
2026-10-17 10:32:35 +02:00
Ludovic Marie fda706d17f Merge pull request #668 from ludovic111/feat/server-dimensions
Server: the level follows its lone player through Nether and End portals
2026-10-17 10:31:04 +02:00
Ludovic Marie 51db0894bf Merge pull request #662 from ludovic111/feat/network-player-progress
Network players keep advancements, statistics and a recipe book on the server
2026-10-17 10:31:01 +02:00
Ludovic Marie 5b922172ac Merge pull request #664 from ludovic111/feat/client-advancements
Network client: show the server's advancements and statistics
2026-10-17 10:30:57 +02:00
Ludovic Marie 46c7daad92 Merge pull request #655 from ludovic111/fix/client-server-packets
Network client: apply block entity data, difficulty, spawn, chunk centre, tick rate and animations from the server
2026-10-17 10:30:53 +02:00
Cosmic 74860c0312 Emit sweep particles for eligible sword hits 2026-10-17 04:28:04 -04:00
Ludovic Marie 171fbeb8ac Send vanilla clients the locator bar on dedicated and LAN servers
Port 26.3's ServerWaypointManager for the players of a served world: each
player who receives waypoints gets ClientboundTrackedWaypointPacket for
every other player who transmits one, as a block (in view), a chunk (one
chunk out) or an azimuth (really far), with the update thresholds,
breaking rules and team colours vanilla uses. Crouching, invisibility and
a carved pumpkin or mob head hide a player; spectators see everyone and
are seen by no one; the locator_bar game rule turns it all off and on.

tools/test_locator_bar_parity.py runs vanilla's server and Horizon's with
two vanilla-codec players and compares every waypoint packet each receives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:14:34 +02:00
Cosmic b47f565849 Reclaim unused terrain GPU arena pages 2026-10-17 04:04:25 -04:00
Ludovic Marie 69a0d13eda Raise the trident over the shoulder while charging a throw
AvatarRenderer.getArmPose gives THROW_TRIDENT to the hand using a
trident: HumanoidModel lifts that arm over the head (xRot * 0.5 - pi)
and leaves the other arm's pose alone (affectsOffhandPose). Horizon
used the plain item pose, so the held trident, drawn with its throwing
model, pointed down through the body. An aggressive drowned raises its
trident the same way (DrownedRenderer), and zombie arms leave that arm
alone (AnimationUtils.animateZombieArms).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 09:45:18 +02:00
Ludovic Marie 62f96e9d65 Mobs float in water instead of bouncing
FloatGoal's constructor lets the navigation float, so Mob.jumpInLiquid
adds 0.04F a tick; Horizon set that flag only for a few species, and
every other FloatGoal user (pigs, cows, wolves, cats, horses, witches,
illagers...) got the non-floater 0.3 and bounced out of the water.
Register it from the goal (and from the constructors that set it:
allay, armadillo, camel, goat, parrot, wither), and add 0.04 as the
float vanilla adds.

Mobs that drop back into water now splash (Entity.doWaterSplashEffect
from updateFluidInteraction, skipped on the first tick), with their
swim splash sound. The new mob_ai deep_water scenarios also caught:
horses register addBehaviourGoals last (none for the skeleton horse, no
mount panic for the zombie horse), RandomStandGoal waits the horse
ambient interval (400 for every AbstractHorse), and the cat's sit-on-
block goal draws its delay only for tame cats once the last ran out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 09:42:46 +02:00
Cosmic e87e5f0cd2 Discard saved login position when respawning after death 2026-10-17 03:41:55 -04:00
Ludovic Marie 5d027877ec Merge pull request #672 from Online5277/fix/audio-output-limiter
Avoid hard clipping when explosion sounds overlap
2026-10-17 09:32:44 +02:00
Ludovic Marie 09c039c423 Merge remote-tracking branch 'origin/main' into HEAD 2026-10-17 09:14:21 +02:00
Ludovic Marie bc69b88c5d Merge pull request #587 from ludovic111/feat/server-online-mode
Dedicated server: online mode, and refused logins in the log
2026-10-17 09:14:16 +02:00
Ludovic Marie 4d1596fe3b Load ATM10's 42 carried mods: room past 8,192 textures and tags
With the wide state ids, ATM10's 42 data-tier mods (193,762 states)
reach the world once these loaders stop refusing them:

- Block sprites: eight texture arrays of 2048 layers instead of four
  (9,790 block textures for the 42).
- Per-state tables read as NBT: the table limits cover 2^20 states, and
  the collision table in level data uses them.
- Worldgen block tags: 2^20 blocks instead of 8,192 (mineable/pickaxe
  holds every stone block of a pack).
- As vanilla's loaders do, a blockstate definition that does not bind,
  a missing or broken block model of a mod, and a recipe that does not
  parse are logged and skipped instead of dropping every mod (or
  stopping the game).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 09:12:41 +02:00
Ludovic Marie f48a54da09 Block state ids past 16 bits
Chunk sections keep block states as u32 and size the global palette
to the registry: 16 bits for vanilla's 35,723 states, wider when
content mods take the registry past 65,536. The content-mod limit
goes from 2^16 to 2^20 states.

The LAN host writes chunks at the registry's width, so with vanilla
(or mods within 16 bits) the wire is unchanged. Remote chunks are read
at the server's width, 16 from a vanilla server, and widened to ours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 09:12:41 +02:00
Ludovic Marie 03de0e8e13 Merge branch 'feat/network-player-progress' into feat/server-dimensions 2026-10-17 08:58:12 +02:00
Ludovic Marie f58a9bdf29 Merge remote-tracking branch 'origin/main' into feat/network-player-progress 2026-10-17 08:58:06 +02:00
Ludovic Marie ee0f382bdf Merge branch 'fix/client-server-packets' into feat/client-advancements 2026-10-17 08:58:06 +02:00
Ludovic Marie aea0dc4c93 Network client: keep #656's ChangeDifficulty handler
#656 handles ClientboundChangeDifficultyPacket and refreshes the World
Options screen too; this branch's own arm became unreachable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 08:58:03 +02:00
Cosmic 310047c225 Allow render distances up to 64 chunks in settings and saved options 2026-10-17 02:55:27 -04:00
Cosmic b771c0b48e Limit overlapping audio without hard-clipping the mixed waveform 2026-10-17 02:51:56 -04:00
Ludovic Marie cc8249d2ce Merge remote-tracking branch 'origin/main' into fix/client-server-packets 2026-10-17 08:50:15 +02:00
Ludovic Marie c7ad9b861f Swimming pose and stroke on the player model
The player's model never read the swimming pose: sprint-swimming and
crawling drew it upright and walking. Add LivingEntity.swimAmount
(eased 0.09 a tick toward isVisuallySwimming), AvatarRenderer's swim
rotation (tipped by the pitch in water, -90 out of it, laid along the
swimming box) and HumanoidModel.setupSwimAnimation (the 26-unit arm
stroke, head down, flutter kick). The avatar rotations now follow
LivingEntityRenderer.setupRotations' death and upside-down turns, as in
vanilla.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 08:45:23 +02:00
Cosmic 78e05bdc95 Merge latest main into fix/classic-menu-default 2026-10-17 02:41:52 -04:00
Ludovic Marie 4410c3ba44 Merge pull request #656 from LookImEcho-Rick/codex/fix-multiplayer-world-options
Fix multiplayer pause menu and World Options permissions
2026-10-17 08:39:44 +02:00
Cosmic a195b4849e Merge main into fix/classic-menu-default 2026-10-17 02:39:42 -04:00
Ludovic Marie d85a16daf8 Merge main into feat/server-online-mode
lan/conn.rs imports: keep this branch's AtomicU32 and main's Mutex/PoisonError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 08:34:34 +02:00
Ludovic Marie 94209a32fc Merge main into perf/versioned-behaviours-cache
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 08:25:56 +02:00
Ludovic Marie 123987c459 Merge pull request #649 from ludovic111/perf/server-batched-sends
LAN hub: hand a tick's packets to each connection together
2026-10-17 08:24:51 +02:00
Ludovic Marie 4d4e5ebe75 Merge pull request #590 from ludovic111/feat/server-prepare-reports
horizon-prepare: keep the registry and command reports with the prepared files
2026-10-17 08:24:47 +02:00
Ludovic Marie 1e7517dc3d Merge pull request #667 from Online5277/fix/chest-breaking-effects
Draw breaking cracks on chest models
2026-10-17 08:23:51 +02:00
Ludovic Marie 48cee5f6d4 Merge pull request #665 from Online5277/fix/player-death-experience
Reset experience on respawn and drop capped XP on death
2026-10-17 08:23:47 +02:00
Ludovic Marie ef3cd64475 Merge pull request #607 from rdbtCVS/perf/shared-block-json-20261017
perf: reuse decoded gameplay and behaviour facts at startup
2026-10-17 08:16:01 +02:00
Ludovic Marie 0a69d6b7bc Merge main and #607 into perf/versioned-behaviours-cache
level/data.rs, level/mod.rs: load, load_with_behaviour_json and
load_with_gameplay all go through one cached() helper (try the snapshot,
build and store on a miss), so #607's client path keeps this cache.
Resolution from contrib-review-1's validated integration, without #601.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 08:15:49 +02:00
Ludovic Marie f0295c1671 Merge remote-tracking branch 'pr/607' into HEAD 2026-10-17 08:01:45 +02:00