Commit Graph

4750 Commits

Author SHA1 Message Date
Ludovic Marie 09a0a0e261 Match vanilla happy ghasts and ghastlings
The adult's careful GhastMoveControl (the blocks around the destination
and swept on the way, #happy_ghast_avoids, fluids), HappyGhastLookControl,
HappyGhastFloatGoal, the still timeout of a player standing on top, and
getSuitableFlyToPosition returning its first good point. The ghastling
flies by its brain with getWalkTargetValue's preference for air just
above the ground. Flying travel drags by 0.91F and 0.8F as floats, and a
happy ghast swims as fast as it flies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:51:36 +02:00
Ludovic Marie 4490ff75fc Spill block entity contents when their block is replaced, as vanilla does
LevelChunk.setBlockState now runs BlockEntity.preRemoveSideEffects and
removes the block entity when a block with one is replaced by another
block (copper chests and copper golem statues keep theirs across
weathering; UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS skips the side effects).
Containers spill every slot through Containers.dropItemStack (spot and
pieces of 10 to 30 with triangular motions from the level random, empty
slots still drawing their spot), jukeboxes pop their record, lecterns
their book; shulker boxes keep their contents for the dropped box.
Campfires, decorated pots, chiseled bookshelves and shelves, which Horizon
keeps as loaded, spill too.

Block.dropResources now draws its loot and pop spots when the behaviour
calls it, not after it returns, and spawnAfterBreak awards ore, sculk and
spawner experience. Item entities and orbs the behaviour makes are added
before it returns to the game, in the same tick. Player mining follows
ServerPlayerGameMode.destroyBlock's order (removal and spill, tool wear,
then the drops); explosions let the removal spill the contents.
ExperienceOrb.award draws the merge id from the level random and moves
the orb with its own random. Decorated pots copy their decorations and
drop their sherds when cracked (loot tables' dynamic entries).

The block update oracle replays preRemoveSideEffects too, and the new
block removal harness (tools/test_block_removal_parity.py) compares
setBlock/destroyBlock/removeBlock on every block entity holder with
contents against vanilla: 2000/2000 cases match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:49:20 +02:00
Ludovic Marie cdd05f8e8b Trial-merge branches before integrating them
supervise.py check trial-merges every candidate branch into the integration
branch with git merge-tree, without touching a worktree: each alone, every
pair, then the largest set that merges cleanly together, in about a second.
integrate starts from that set (or every parity/* branch with new commits,
with --ready), gates it once, and if the gate fails tries each half, so the
branches that pass still land.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:43:58 +02:00
Ludovic Marie e6aa9f71b0 Merge branch 'parity/rendering-be' into parity-base 2026-10-12 16:43:52 +02:00
Ludovic Marie 93c3de5d61 Merge branch 'parity/hud' into parity-base 2026-10-12 16:43:50 +02:00
Ludovic Marie 095991b946 Merge branch 'parity/rendering-hud' into parity-base 2026-10-12 16:43:49 +02:00
Ludovic Marie cfb19e238f Merge branch 'parity/rendering-anim' into parity-base 2026-10-12 16:43:49 +02:00
Ludovic Marie ec6c2c596f Merge branch 'parity/entity-ai' into parity-base 2026-10-12 16:43:48 +02:00
Ludovic Marie 577e68fd12 Merge branch 'parity/tooling' into parity-base 2026-10-12 16:43:47 +02:00
Ludovic Marie 70992eb815 Document the patrol and raid harness and its scope
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:43:32 +02:00
Ludovic Marie cb0244ce4a Fill the mob effect registry so /effect finds its effects
The command registries never received the effect ids, so every /effect
and mob_effect argument failed to resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:43:32 +02:00
Ludovic Marie a05f9b7b8c Run harnesses on the Mac mini by default
Every harness gave the same result on the Mac mini as on Linux, except
options and chunk_generation, where Rust's float functions use the platform
libm and round differently on macOS: those stay off the Mac. gate.py and
supervise.py no longer force 8 local harnesses, so parity.py keeps the
desktop to 3. The ThinkPad is listed (2 harnesses, nice 19) but not used by
default. Oracle runs get a 15-minute hang guard instead of 5, since one oracle
on a fully loaded machine can take more than 5 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:42:07 +02:00
Ludovic Marie cb19f5e7d6 Make the datafix harness take 40 seconds instead of 25 minutes
The oracle spent 58 of every world's 62 seconds waiting for the idle
threads of the game's IO pool to time out; it now exits once its outputs are
written (same outputs on all 22 worlds). The harness runs in 6 shards, keeps
the vanilla outputs so the oracle's results are reused, and declares its Rust
scope (datafix, NBT, region files, compression and horizon-core positions):
other horizon-world changes no longer rerun it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:41:51 +02:00
Ludovic Marie f5ab40d415 Shard harnesses, narrow their Rust sources, keep the desktop light
parity.py:
- A harness declaring PARITY_SHARDS = N runs as N entries, NAME#1..NAME#N,
  each told its share through PARITY_SHARD; NAME selects them all.
- PARITY_RUST_SCOPE lists the Rust sources a harness's probes can reach.
  It applies only if closed (nothing in it names a module, crate-root
  re-export or macro outside it, and nothing outside implements anything for
  its types); crate roots then count without their other module declarations.
- Bytecode caches no longer count as dependencies.
- With other hosts, this machine runs 3 harnesses at once and only those
  under 800 MB, admitted against the memory free at each start; hosts can
  exclude harnesses and run at a nice level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:41:51 +02:00
Ludovic Marie 5352b59358 Tick the sniffer's and the ghastling's brains
The level random is passed down to the mob AI step as the integration
branch does, the brain runs in customServerAiStep's place, and the mob AI
probe builds the brain after seeding the mob and prints its activities and
memories. The oracle seeds every GateBehavior's shuffle with the mob's seed
(the same change the entity-ai branch makes) so RunOne picks are
reproducible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:36:44 +02:00
Ludovic Marie 1515c5e46c Add vanilla's team rules and compare them with vanilla
Friendly fire (doTeamsAllowDamage), alliances, collision rules
(EntitySelector.pushableBy), seeing invisible team mates (isInvisibleTo),
name tag visibility (LivingEntityRenderer.shouldShowName) and who sees a
player's own death message. tools/test_team_rules_parity.py runs vanilla's
methods on stand-in entities and a stand-in client over 6000 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:36:04 +02:00
Ludovic Marie 89c3a155c5 Play the sniffer's digging and searching sounds on the client side
The searching sound and the digging block hit sound are the client's
(playSearchingSound, emitDiggingParticles), the digging sound starts with
the dig (SnifferSoundInstance), and the egg plop and the breeding
experience come from the parent's random in its brain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:31:58 +02:00
Ludovic Marie eb9bee05bd Run the loom and the crafter menu on the verified menu engine
LoomMenu (selectable patterns, clickMenuButton, the six-layer limit,
quick moves, the result's onTake) and the server's CrafterMenu over the
block entity (the result following the grid, slot state packets, filled
disabled slots enabling) join the menu click harness, now 8,000 click
sequences over 19 menus with pattern button and slot state ops. Slot
clicks end with setChanged and container slots are limited to their
stack size as SimpleContainer does. The game's loom and crafter screens
now click through Game::menu_session on the same engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:31:00 +02:00
Ludovic Marie 4e871bf22e Match vanilla llamas: the horse tail draw and mobs seeing earlier mobs' moves
AbstractHorse.aiStep draws a tail swish every tick before the goals run.
Mobs now see the mobs ticked before them as they are after their tick
(ServerLevel ticks entities one after another), in the game and in the
mob AI probe; a baby llama following its parent depended on it. The
llama's strength is read raw, as getStrength does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:29:00 +02:00
Ludovic Marie b8711a7c64 Add a sculk vibration harness against a vanilla server level
VanillaSculkOracle runs sensor, calibrated sensor and shrieker scenarios
(scripted game events and block changes, the player's warning level) in
a real headless level ticked in ServerLevel.tick's order; the game runs
the same scenarios through its own sculk code (HORIZON_SCULK_FIXTURE).

Fixes found on the way: sculk block entities tick in the order they were
added, the entity phase of sculk runs before the block entities, client
side effects of level events draw from the client random, scheduled
ticks run one at a time so a shrieker summons inline, wardens are
summoned as SpawnUtil does (obstruction by entities, the yaw and
finalizeSpawn draws, agitated sounds of discarded attempts), and an
empty level no longer draws the level random every tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:25:06 +02:00
Ludovic Marie 68520308d0 Keep the scoreboard in vanilla's hash orders and save it as its codec does
The objectives, holders and teams now iterate as vanilla's fastutil maps and
each team's members as its HashSet; criteria resolve to their canonical
names as ObjectiveCriteria.byName does; scoreboard.dat leaves out the
fields equal to the codec defaults and writes components as
ComponentSerialization does. tools/test_scoreboard_parity.py runs vanilla's
own Scoreboard against the model on 500 scripted cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:23:34 +02:00
Ludovic Marie 81783a5125 Port PatrolSpawner, Raid and Raids exactly, and run the game on them
The patrol spawner, the raid tick (countdown, spawn positions, wave
composition, bonus wave, leaders, riders, boss bar, horn seed, raiders
leaving, victory, loss, celebration) and the raids.dat codec with
DataFixerUpper's partial results and fastutil's map order now follow
vanilla line by line. tools/test_raid_parity.py runs vanilla's own
PatrolSpawner, Raids and Raids.CODEC on a stand-in level: 1,900 cases
match.

In game, raiders join, are loaded, hurt and killed through addWaveMob,
updateBossbar and removeFromRaid as vanilla calls them, the wave leader
map lives in the raid, recruits take the raid's current wave, raid and
patrol mobs keep their spawn rotation, and each dimension keeps its own
raids.dat. Bad Omen and Raid Omen act from inside the effect tick, with
the ConcurrentModificationException vanilla swallows when Raid Omen is
first added, and the omen position is saved with the player.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:22:29 +02:00
Ludovic Marie 0e076c7153 Port the sniffer's and the ghastling's brains
SnifferAi and HappyGhastAi as vanilla's Brain runs them: the sensors and
their scan rates, the activities and their requirements, and every
behaviour (AnimalPanic, MoveToTargetSink, FollowTemptation, AnimalMakeLove,
LookAtTargetSink, RunOne and the sniffer's scenting, sniffing, searching,
digging, rising and happy states) in availableBehaviorsByPriority order.
Adds AirAndWaterRandomPos and the mob AI scenarios for llamas, sniffers
and happy ghasts. The brain is not ticked yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:17:44 +02:00
Ludovic Marie 95c7e7ad2a Document the player list and world border parity harnesses
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:08:40 +02:00
Ludovic Marie e4bb8463b9 Show the player list and the world border wall in the game
Holding the player-list key draws tab_list's layout: in single player the
local player with the list objective (vanilla shows nothing otherwise), on
a server the listed players from PlayerInfoUpdate (game mode, latency,
display name, list order, hat), the tab list header and footer, online
mode for heads and the server's objectives, scores, display slots and
teams, which now also feed the sidebar. The renderer draws the border wall
with RenderPipelines.WORLD_BORDER's overlay blend and the forcefield
texture, from border_render's buffer and transforms; the client border
follows the server's border packets and ticks between them. The vignette
reddens near the border.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:07:47 +02:00
Ludovic Marie 16227901fc Check the crafter against vanilla with a crafting harness
CrafterBlock.dispenseFrom and CrafterBlockEntity.serverTick over 4,000
cases: recipes from the datapack with remainders and specials, disabled
slots, containers and other crafters in front. The crafter now reports
its level events (1049, 1050, white smoke 2010) through the client
random, hoppers merge stacks only with equal components, brewing stands
take items as a WorldlyContainer, and empty written book pages are not
written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:05:18 +02:00
Ludovic Marie 1c9c9486f6 Run vanilla harnesses on other machines with parity.py --hosts
A worker started over ssh (parity.py --worker) runs harnesses on a mirror of
the worktree on another machine, here the Mac mini. One longest-first queue
feeds every machine, remote ones first; passes come back with the content
hash of each dependency, so they are keyed on exactly what ran. Harnesses
that need this machine are listed in tools/parity_hosts.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:54:35 +02:00
Ludovic Marie 95015b7828 Compare sniffer animation states, happy ghast layers and the llama decor model
The entity model harness now drives the sniffer's five keyframe animation
states and its search walk, the happy ghast body item, riding and leash
holder on its body, harness and ropes layers, and LlamaDecorLayer's model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:51:58 +02:00
Ludovic Marie cba3f5bb6a Compare the breeze's animations and its wind and eyes layers with vanilla
The entity model harness now poses the breeze's six animation states and
bakes BreezeWindLayer's and BreezeEyesLayer's models and the creaking's
emissive eyes model (141 and 64 cases, no differences).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:51:57 +02:00
Ludovic Marie 8a32850f95 Lay out the player list exactly as vanilla PlayerTabOverlay does
tab_list ports PlayerTabOverlay: the comparator (list order, spectators,
team, name ignoring case), the 80-player limit and 20-row columns, heads
with the default skin by UUID and upside-down names, team and spectator
name styling, ping bars, the list objective as integer scores in their
number format or hearts with their change blink and the hp text fallback,
and the wrapped header and footer. Font::split_lines now follows
StringSplitter.splitLines and Text::resolve_legacy applies legacy codes
inside components. test_tab_list_parity runs vanilla's overlay against
examples/tab_list_fixture: 1,000 cases, 3,476 frames, 844,758 calls match.

The protocol gains the scoreboard, team and world border packets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:47:55 +02:00
Ludovic Marie 84afe5a020 Merge origin/parity/rendering-hud into parity/rendering-be
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:40:54 +02:00
Ludovic Marie 36b944ec3d Merge origin/parity/rendering-anim into parity/rendering-be
Client-ticked animation state now drives the renderer alongside the End
portal and gateway rendering; gateways, whose ages and cooldowns the client
does not track yet, keep rendering settled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:40:50 +02:00
Ludovic Marie a086bd83ba Merge parity/entity-ai, parity/rendering-anim and parity/rendering-hud into parity/hud
Keep the nbt contents hook and stack_display_name from parity/hud with
rendering-hud's object_style and first-component sibling style.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:40:44 +02:00
Ludovic Marie 94508b4528 Merge remote-tracking branch 'origin/parity/rendering-anim' into parity/hud 2026-10-12 15:39:07 +02:00
Ludovic Marie 136b74011c Merge remote-tracking branch 'origin/parity/entity-ai' into parity/hud 2026-10-12 15:39:06 +02:00
Ludovic Marie af463e976b Merge origin/parity/entity-ai into parity/rendering-be
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:39:05 +02:00
Ludovic Marie 3467380074 Render the world border wall and its vignette exactly as vanilla does
The client border now wraps horizon-core's vanilla-checked BorderGeometry
(previous size for partial ticks, status, lerp speed, absolute limit) and
border_render ports WorldBorderRenderer: extract's fade and tint, the cached
wall buffer, the scrolling texture transform and which walls draw. The
vignette takes vanilla's int colour and the warning strength from the
border. test_world_border_render_parity runs vanilla's renderer against
examples/world_border_render_fixture: 1,500 cases, 16,859 frames match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:29:53 +02:00
Ludovic Marie f94aa2a3d6 Assemble /place jigsaw pieces from the generation context's random
JigsawPlacement.generateJigsaw builds the pieces with the GenerationContext's
WorldgenRandom (large feature seed from the level seed and the position's
chunk) and only places them with the level random. Horizon assembled them from
the level random, so the village layout, and the plants /fill later broke
around it, changed from run to run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:28:40 +02:00
Ludovic Marie fc7a95ee10 Merge branch 'parity-base' into parity/rendering-be
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:08:08 +02:00
Ludovic Marie 42c2e96082 Merge remote-tracking branch 'origin/t3/achieve-full-parity' into parity/hud 2026-10-12 14:07:23 +02:00
Ludovic Marie fd79addba4 Merge branch 'parity/saves' into parity-base 2026-10-12 14:06:53 +02:00
Ludovic Marie 7f8bec70bc Merge branch 'parity/blocks' into parity-base 2026-10-12 14:06:53 +02:00
Ludovic Marie 22bc86739b Port the villager brain from VillagerGoalPackages
Villagers ran an approximation built from goals. They now run vanilla's
Brain: expiring memories, the nine sensors with their randomly delayed
scan clocks, activities from the villager_activity timeline, and every
package's behaviours (core, work, play, meet, rest, idle, panic, pre-raid,
raid, hide), started and ticked in Brain.availableBehaviorsByPriority's
order with RunOne's shuffles, the level random for behaviour timing and
POI scans, and Villager.refreshBrain when the profession changes.

The mob AI probe prints the activities and memories as the oracle does,
and the harness's three villager scenarios now match: 34/34.
Sleeping villagers take LivingEntity.SLEEPING_DIMENSIONS instead of being
frozen in travel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:37:39 +02:00
Ludovic Marie b0527b4818 Check a shulker box's lid room before opening and tick animations only while the world runs
ShulkerBoxBlock.canOpen: a closed box opens only when the half-open lid
box is free of collisions. Bells gather and test entities by their real
bounding boxes and liveness. Client block-entity tickers run with
ClientLevel.tickBlockEntities, which Minecraft.tick skips while paused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:32:58 +02:00
Ludovic Marie d48017ab70 Build the player's attack strength model with its tests
Player.attackStrengthTicker and itemSwapTicker: both advance each tick, a
different main-hand item resets them, and getAttackStrengthScale divides
by the ATTACK_SPEED delay. The game does not drive it yet; the attack
indicator still shows full strength until combat uses the cooldown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:29:20 +02:00
Ludovic Marie 5b201965af Compare the chat with vanilla's ChatComponent
The chat cases add messages (with the system and error tags) at given Hud
ticks and draw ChatComponent in background mode: wrapping, the 200-tick
fade, scale, width, height, spacing and opacity options. Horizon's chat now
wraps like StringSplitter.splitLines and ComponentRenderUtils.wrapComponents
(the indent on wrapped lines, breaks at the last space, a dropped newline
or space), keeps the options as doubles and draws through a layout with
vanilla's fills and text offsets. A component list whose first part has
empty text now still passes its style to the rest. The harness runs 200
cases per kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:28:05 +02:00
Ludovic Marie e2b3f7b4e9 Keep unsimulated entities' UUIDs across saves and save player equipment as vanilla
save_entities forgot the UUID and compound of entities Horizon keeps but
does not simulate, so the save on quit gave them new UUIDs. The player's
equipment is written as LivingEntity does: omitted when empty, where
PlayerEquipment.isEmpty also counts the selected hotbar item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:26:18 +02:00
Ludovic Marie ef0c6604a5 Compare camera overlays and the sleep overlay with vanilla's Hud
The overlays cases run Hud.extractCameraOverlays and extractSleepOverlay:
the vignette with its brightness and world border warning, the spyglass
scope and its scopeScale easing (read back and compared), equipment
camera overlays, powder snow, the nether portal sprite and the nausea
swirl. The game feeds its full-screen camera overlays from the same
layout (the vignette option and first person now count), draws the
spyglass with vanilla's unclamped easing and the sleep fade at vanilla's
opacity under the sidebar, titles and chat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:19:38 +02:00
Ludovic Marie 51d4598632 Draw End portals and gateways with vanilla's end portal shader
The entity shader gains rendertype_end_portal as layers 9 (15 portal
layers) and 10 (16 for gateways): end_sky and the rotating, scrolling
layers of end_portal.png projected from the screen, repeated inside their
atlas sprites, with vanilla's GameTime uniform. The world-space
approximation and its portal block scan are gone; the block-entity
renderer draws both blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:16:32 +02:00
Ludovic Marie cd116711c2 Seed the mob AI oracle's gate shuffles so villager runs are reproducible
Every GateBehavior (RunOne, and the gates of TradeWithVillager and
VillagerMakeLove) shuffles its behaviours with a ShufflingList random that
RandomSource.create() seeds from the clock, so two oracle runs of the same
villager scenario diverged after the first RunOne. The oracle now gives
each gate a LegacyRandomSource seeded with the mob's seed, and seeds the
gates of a brain rebuilt by Villager.refreshBrain before its next tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:16:13 +02:00