Commit Graph

4750 Commits

Author SHA1 Message Date
Ludovic Marie 03ff05c317 Merge pull request #652 from ludovic111/fix/launcher-complete-reports
Launcher: complete prepared versions that lack the run-time reports
2026-10-17 06:09:25 +02:00
Ludovic Marie 6a19e40092 Merge pull request #519 from Online5277/fix/equipment-attribute-tooltips
Show equipment attributes in inventory and Creative tooltips
2026-10-17 06:05:13 +02:00
Ludovic Marie b4481e9aad Merge pull request #627 from ludovic111/fix/offhand-on-server
Swap and sync the off hand on a server
2026-10-17 06:04:38 +02:00
Ludovic Marie 16721b0ab5 Merge pull request #651 from Online5277/fix/horizon-pause-hud
Hide survival bars consistently behind the Horizon pause menu
2026-10-17 06:04:16 +02:00
Ludovic Marie 543d04ba44 Merge pull request #650 from Online5277/fix/language-search-hint
Keep the language search hint clear of the caret
2026-10-17 06:04:12 +02:00
Ludovic Marie 2aba405281 Merge pull request #646 from Online5277/fix/resource-pack-reload-errors
Fix resource pack reload failures and broken Horizon menus
2026-10-17 06:04:07 +02:00
Ludovic Marie ed09e757ba Pathfinder: hash nodes with the Fx hasher, and work out each path type once
Path searches (vanilla's PathFinder with WalkNodeEvaluator) were 14 % of
the world tick with 80 villagers. Two costs vanilla doesn't have:

- the node index and the per-query path type and collision caches used the
  standard SipHash; vanilla keys them by packed position in fastutil maps.
  They use the Fx hasher now (nothing iterates them, so no order changes);
- a position's static path type (its block, the one below and up to 24
  neighbours, `getPathTypeStatic`) was worked out again for every mob box
  that covered it. Vanilla caches the block part level-wide
  (`PathTypeCache`); the finder now remembers each position's type for the
  query, during which the world doesn't change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:57:47 +02:00
Ludovic Marie cceda07476 Sculk: find a loaded chunk's sensors from its palettes, not every block
When chunks arrive, the sculk index looks through them for sensors,
shriekers and catalysts. It unpacked and tested all 4,096 blocks of every
section that wasn't uniform: 10 to 18 ms in a tick after a world loaded,
more over a larger render distance (#489).

A section whose palette holds no sculk state has no sculk block, so it is
passed over without reading its blocks; the others are scanned as before,
and the same blocks are found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:57:42 +02:00
Ludovic Marie 1efc7f83d1 Entity portal checks: skip the sweep where no section holds a portal
Every tick, each item and mob that can use a portal sweeps the blocks its
box passed through since the last tick, looking for a nether portal block
(`Entity.checkInsideBlocks` reaching `NetherPortalBlock.entityInside`).
Each sweep allocated a visited set and read every block of the path.

Every block a sweep visits lies in the box covering the entity's box at
both ends. When no section that box touches has a nether portal state in
its palette, no visited block is a portal: the sweep is skipped. Sections
are checked once per tick, and a box over more than 64 sections (an
entity teleported far) is swept as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:55:41 +02:00
Ludovic Marie a3bf174ddb Collision scans: a counting cursor, and fewer lookups and allocations per block
Block collision scans (vanilla's BlockCollisions) are most of every mob's
move, and moves were the largest share of the world tick with 600 mobs.
Per cell and per hit, the scan did work vanilla's JIT makes cheap:

- the cursor divided its index by the box width and height for every cell;
  it now counts x, then y, then z, as Cursor3D does (same cells, same order,
  same budget);
- the unit cube test cloned the shared unit cube to compare identities
  (`VoxelShape::is_block` compares with it in place), and built a
  normalised box to test it against the entity box (`intersects_corners`);
- every non-empty block looked its state up in the contextual rule map
  (scaffolding, liquids, powder snow); a flag in the scan table now says
  which states have one;
- a moved shape decomposed its occupancy into boxes again; the moved
  shape's boxes are its own boxes moved, the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:55:21 +02:00
Ludovic Marie 51703fdf3b Merge remote-tracking branch 'pr/626' into HEAD
# Conflicts:
#	crates/horizon-client/src/lan/guest.rs
2026-10-17 05:42:28 +02:00
Ludovic Marie c5851e77aa horizon-bots: --explore-speed, for an explore pass with equal work
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:42:27 +02:00
Ludovic Marie 75ee9a3299 Build a saved chunk's structure starts when it loads, not on the game thread
A loaded world had none of its structure starts in the generator's cache.
The first time natural spawning (or anything else) asked which structures
hold a position in a chunk referencing a village, the game thread built the
village start: 60 to 120 ms in one tick, once right after the world opened
and again a few ticks later for the next start (#489).

Vanilla reads the starts with the chunk. The streaming worker that loads a
saved chunk now builds the starts it references into the same cache, so the
game thread finds them there. The starts are the same: the same function
builds them from the same seed and chunk, only earlier and on a worker.

The cache now keeps the first starts built for a chunk when two threads
build them at once, so every user shares one start and its pieces'
placement state, as vanilla's single StructureStart does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:35:24 +02:00
Ludovic Marie 1a68d8ddf0 Merge main into fix/furnace-on-server
lan_actions.rs: clear the old body's potions (main), then respawn with
the tick context (this branch). hub.rs: keep main's effect and chunk
tracking reset before this branch's vanilla respawn sequence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:35:16 +02:00
Ludovic Marie 591e6f9161 Merge main into fix/equipment-attribute-tooltips
Picks up #572, the fix for main's broken build that this branch's last
main merge caught.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:30:34 +02:00
Cosmic 36ea3a4140 Hide the gameplay HUD consistently behind Horizon pause menus 2026-10-16 23:21:07 -04:00
Cosmic 8f4eda4d12 Hide the language search hint while the field has focus 2026-10-16 23:19:47 -04:00
Ludovic Marie 3cd26c6d0b server_bench: --gamerule, more game rules for both servers
Horizon has no locator bar yet, so equal-work runs turn vanilla's off
(--gamerule locator_bar=false): its waypoint updates cost every move
a pass over every other player.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:17:33 +02:00
Ludovic Marie c8003301bc horizon-bots: vanilla's chunk batch sizing, chunk-gated movement and chunk accounting
The bots acknowledge chunk batches with ChunkBatchSizeCalculator's
desired chunks per tick, from how long each batch takes to arrive,
instead of a fixed 25. A bot moves only while it holds the chunk it
stands in, as vanilla's client stops ticking its player in a chunk it
hasn't received, so no bot outruns a server's chunk sending. Each bot
keeps the chunks it holds, so the report separates chunks that entered
its view from chunks sent again while it still held them, and counts
the moves the server refused and the ticks it waited for its chunk.

server_bench.py runs one pass per behaviour (walk, explore), spawns
every bot on the world spawn itself (respawn_radius 0) so both servers
see the same paths, can run the bots on another machine (--bots-via,
--bots-bin, --connect) and the servers under nice, and reports new,
dropped and re-sent chunks per second, pull-backs and the server's
"moved too quickly" lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:17:33 +02:00
Ludovic Marie b347ceb195 Dedicated server: vanilla's chunk pacing and movement checks
PlayerChunkSender: one unacknowledged batch until the client's first
acknowledgement and ten after it, batches capped at the client's
desired chunks per tick (not twice that), and the quota reset to one
chunk whenever every batch is acknowledged.

ServerGamePacketListenerImpl.handleMovePlayer: a move further from
where the tick began (firstGood) than 100 blocks squared per move
packet (300 while gliding; the count falls back to 1 past 5 packets)
logs "<name> moved too quickly!" and pulls the player back, as the
player_movement_check and elytra_movement_check game rules allow.
NaN coordinates or non-finite angles and two position moves in one
client tick disconnect with invalid_player_movement, positions are
clamped to the world's limits, an unanswered teleport is sent again
after 20 ticks, and accepting a teleport runs the move it carries.

The move is then replayed against the blocks: a survival or adventure
player who ends more than 0.25 blocks short of the target (horizontally;
vanilla drops the vertical part) logs "<name> moved wrongly!" and is
sent back unless they were already stuck, and any move into a block
the old box did not touch (isEntityCollidingWithAnythingNew) is sent
back silently. Spectators and sleepers skip both. Angles wrap as
Mth.wrapDegrees does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:16:08 +02:00
Ludovic Marie 5725ee0efa Give the shared-JSON profiler its own name
Every PR of the startup batch adds a different tools/profile_client_startup.py,
so any two of them conflict. This one becomes tools/profile_shared_json.py; its
guide and tools/profile_gameplay_decode.py follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:13:10 +02:00
Ludovic Marie bf851bfea1 Merge pull request #648 from ludovic111/feat/modpack-bench
Content mods: refuse more block states than chunks hold; the pack against NeoForge, measured
2026-10-17 05:01:42 +02:00
Ludovic Marie ead46669a5 Merge pull request #641 from Online5277/fix/container-mouse-hotkeys
Honor mouse-bound hotbar swaps in inventories
2026-10-17 04:58:55 +02:00
Ludovic Marie 02dce1093b Give the behaviour profiler its own name
Every PR of the startup batch adds a different tools/profile_client_startup.py,
so any two of them conflict. This one measures only Behaviours::load, so it
becomes tools/profile_behaviour_cache.py, and --cache-dir passes the snapshot
folder to the example so warm loads can be measured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:58:28 +02:00
Ludovic Marie 455967bd47 Merge pull request #647 from ludovic111/feat/sprite-arrays
Block textures: share identical sprites, and draw past 2048 layers
2026-10-17 04:58:13 +02:00
Ludovic Marie 1e514f8539 Merge pull request #633 from ludovic111/feat/port-pack-report
horizon-port-pack report: coverage per mod, and ATM10 measured
2026-10-17 04:58:09 +02:00
Ludovic Marie b0e31eb14f Merge pull request #632 from ludovic111/feat/neoforge-oracle-harness
Per-mod parity harness against a dev-only NeoForge oracle
2026-10-17 04:58:05 +02:00
Ludovic Marie 303c8d4452 Merge pull request #631 from ludovic111/feat/port-pack-oracle-carry
horizon-port-pack carry: templates and numbers from the NeoForge oracle, 1.21.1 loot upgraded
2026-10-17 04:58:00 +02:00
Ludovic Marie 03ca95e8af Merge pull request #630 from ludovic111/feat/mod-content-real-mods
Content mods: load real carried-over mods (large tables, convention tags, mod recipes)
2026-10-17 04:57:55 +02:00
Cosmic 1e597f356e Merge main and preserve resource reload and Mods screen tests 2026-10-16 22:56:10 -04:00
Ludovic Marie 2822d4e1b7 Content mods: refuse more block states than chunks hold; the pack against NeoForge, measured
Loading the eight carried-over mods in the game (not only the probe) showed
two limits real packs reach. Block textures past 2048 layers are another PR;
this one handles block states and measures a pack.

- Chunk sections store a block state in 16 bits. Vanilla 26.3 has 35,723
  states; Macaw's four mods add 36,154, the eight 41,389. Past 65,536 ids
  wrapped onto other blocks (a trapdoor became a hanging sign).
  mod_content::build now refuses a set of mods past MAX_STATES and names the
  states per mod; the game then starts without content mods, as for any
  refused content.
- tools/mod_port_harness.py probes each mod on its own against vanilla, as a
  player adding it would load it.
- tools/perf_bench.py --game neoforge: Minecraft 1.21.1 on NeoForge 21.1.259
  with --mod-jars and --deps, driven by a dev-only NeoForge port of the bench
  mod (mods/horizon/src/neoforge-bench); --port-work loads a work folder's
  carried-over mods into Horizon. tools/neoforge_oracle.py installs the
  client once under .local/neoforge-oracle (the installer, then the vanilla
  libraries it inherits, sha1-checked) and builds the driver. A NeoForge
  start that crashes before the driver loads (FML reading fml.toml while
  creating it) is retried once.

Measured (docs/modpacks.md): six ported mods in Horizon against the same
mods on NeoForge, Mac mini M4 Pro, 2 games per row on a loaded machine. The
world is ready 3.1x sooner at 8 and 16 chunks, the flights run 1.7x and
3.6x the frames, and Horizon's RSS is not lower (+1.1 GB with the mods).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:55:20 +02:00
Ludovic Marie 5f9dba6011 Merge pull request #639 from Online5277/fix/classic-extras
Make Extras accessible from Classic Options
2026-10-17 04:53:35 +02:00
Ludovic Marie 103d44f72f Merge main into fix/container-mouse-hotkeys
game.rs: keep this branch's container hotbar-mouse check, then #637's
mouse-bound sort key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:50:43 +02:00
Ludovic Marie 5118d824a6 LAN hub: hand a tick's packets to each connection together
Every packet sent to a guest woke its writer thread, and at 25 walking bots
those wake-ups (mpsc notify, semaphore_signal) were about a quarter of the
server thread's tick. While tick_lan runs, packets for each guest are held
and handed over in one Out::Packets at the end; a send outside a tick, or a
disconnect, first hands over what is held, so the bytes and their order are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:47:35 +02:00
Ludovic Marie 928f31e428 Merge main into fix/classic-extras
options_ui.rs: #585 put Mods... in the telemetry slot; keep it and put
Horizon Extras... in the credits slot as this branch intended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:47:11 +02:00
Cosmic 7575719d11 Reuse the GPU device and presentation mode across pack reloads 2026-10-16 22:46:47 -04:00
Ludovic Marie 6c5b04694e Merge pull request #642 from Online5277/fix/redstone-ore-attack
Light both redstone ore variants when mining starts
2026-10-17 04:42:19 +02:00
Ludovic Marie 65e5640350 Merge pull request #640 from Online5277/feat/fullbright-extra
Add an off-by-default Fullbright toggle in Extras
2026-10-17 04:42:15 +02:00
Ludovic Marie b0a82da895 Merge pull request #638 from Online5277/fix/inventory-preview-layout
Correct inventory player scale, labels and equipment overlap
2026-10-17 04:42:11 +02:00
Ludovic Marie f3dd2c27e5 Merge pull request #637 from Online5277/fix/extras-mouse-bindings
Support mouse buttons for Extras sorting and zoom
2026-10-17 04:42:07 +02:00
Ludovic Marie 6eba3f034e Merge pull request #585 from Online5277/fix/classic-mod-management
Add mod management to Classic Options
2026-10-17 04:42:03 +02:00
Cosmic e0d6e56281 Release Wayland surface before replacing the pack renderer 2026-10-16 22:41:33 -04:00
Cosmic 5515cbab33 Handle resource pack reload failures and reset menu atlas cache 2026-10-16 22:34:01 -04:00
Ludovic Marie 107671b1e8 Merge pull request #547 from Online5277/fix/banner-item-components
Fix Ominous Banner data, tooltips and breaking effects
2026-10-17 04:31:41 +02:00
Ludovic Marie 2e98f6a18a Let the behaviour profiler use a snapshot folder
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:25:02 +02:00
Ludovic Marie e7f7236c34 Open furnaces, blast furnaces and smokers on a server
Right-clicking a furnace as a guest did nothing: the host only handed
chests, barrels, hoppers, dispensers and shulker boxes over. It now opens
the furnace's own menu (minecraft:furnace, blast_furnace or smoker),
runs the guest's clicks through the host's AbstractFurnaceMenu (fuel slot,
take-only result, shift-clicks by recipe and fuel, a new input restarts
cooking) and keeps the client's progress arrows in step with
ContainerSetData. The dedicated server harness now opens a furnace and
smelts an ore in it on both servers.

Fixes #540

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:17:54 +02:00
Ludovic Marie 40970589be Wrap mixed translation arguments once, so vanilla clients can read /give
component_nbt wrapped the numbers of a mixed list under the empty key, and
the NBT writer then wrapped those wrappers again, as ListTag.wrapIfNeeded
does. A vanilla client reading /give's reply ("Gave 1 [Raw Iron] to ...")
unwrapped once, found a {"": 1} argument and dropped the connection. The
list is now left to the writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:17:54 +02:00
Ludovic Marie 8ff9247edb Merge pull request #643 from ludovic111/ci/parity-timeout
CI parity: raise the per-harness timeout to 2400 s
2026-10-17 04:14:57 +02:00
Ludovic Marie 0da61e660b CI parity: raise the per-harness timeout to 2400 s
world_spawn now takes about 1480 s on a loaded Mac mini runner, just
under the old 1500 s limit, so PRs failed on a timeout rather than a
mismatch (#567, #514).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 04:08:08 +02:00
Ludovic Marie d9dc5de701 Merge pull request #567 from ludovic111/perf/villager-poi-index
Villagers search an index of POI blocks instead of scanning every block
2026-10-17 04:07:54 +02:00