Commit Graph

3685 Commits

Author SHA1 Message Date
Ludovic Marie d088140c0d Compare beacon beams with BeaconRenderer
Move the beam geometry into block_entity_render::beacon_beam so the
block entity render harness can replay it against vanilla submit calls
(positions, UVs and colours of the solid beam and glow per section).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 22:02:40 +02:00
Ludovic Marie 9e4811dd6e Compare the ambient sound handlers tick by tick with vanilla LocalPlayer
The oracle runs the real updateIsUnderwater, UnderwaterAmbientSoundHandler
and BiomeAmbientSoundsHandler over the real SoundEngine, comparing every
level random draw, loop fade, mood sample and playing instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:57:02 +02:00
Ludovic Marie 723ec3bb8a Drop entity death loot exactly as vanilla's LivingEntity.die does
Entity loot tables now run on the faithful loot engine with an entity
context: the victim, the killer and direct attacker, the damage type and
its tags, the last player to hurt it and their luck, entity predicates
(flags, equipment, components, sheep, cube size, raider captains,
vehicles, entity type tags), damage source predicates, killed_by_player,
random_chance_with_enchanted_bonus, enchanted_count_increase, furnace_smelt
and tag entries. Draws come from the world's random sequence for the table.

mobs::drops ports dropAllDeathLoot: Monster loot for babies, equipment
drops in EquipmentSlot order with Looting's equipment_drops effect and
durability, the fox's mouth item, the wither's star, the charged creeper
head hook, horse inventories and chests, and getBaseExperienceReward with
the equipment bonus and baby zombie reward, split into orbs.

Fixes found on the way: sheep dropped their wool twice, baby monsters
dropped nothing, armour bonus experience and the equipment slot order were
wrong, hoglins were fire immune, and fishing treasure was unreachable (the
hook predicate format changed).

tools/test_entity_death_loot_parity.py: 1,578 cases over 87 entity types
match vanilla.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:56:39 +02:00
Ludovic Marie 268babc257 Lay out the HUD decorations exactly as vanilla Hud does
Add horizon_client::hud_layout (crosshair and attack indicator, hotbar
with selection, off hand by main arm, item slots with the pop squeeze,
armour, hearts including frozen and absorbing kinds, food, air bubbles,
mount hearts capped at 30, experience bar and level) and the
test_hud_parity harness whose oracle runs vanilla Hud methods on a
stand-in client. The game now draws these through hud_layout; the
experience level is centred with integer division like vanilla,
spectators get no crosshair and mount hearts show in creative too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:56:23 +02:00
Ludovic Marie 6eee2e3262 Compare audio environment attributes and Musics with the vanilla data
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:52:28 +02:00
Ludovic Marie ebb66e451f Pace frames with vanilla's FramerateLimiter and compare it
The game now ends each frame with FramerateLimiter.limitDisplayFPS below
260 fps (sleep, overshoot averaging, spin-wait) instead of waking the event
loop at a computed deadline, and the limiter honours Thread.interrupted.
tools/test_frame_limiter_parity.py runs the real limiter bytecode with its
clock calls rewritten to a scripted virtual clock (5,288 cases).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:51:04 +02:00
Ludovic Marie a903cb4dd5 Pass the save round-trip harness
Horizon spawned mobs whatever the spawn_mobs and spawn_monsters game rules
said; natural spawning now follows ServerChunkCache.tickChunks (the chunks
are still shuffled every tick) and the custom spawners tick only with
spawn_mobs. The slimes this put in the test world were what woke its sculk
sensor.

Falling blocks keep their UUID and loaded compound while they move, read
NoGravity, DropItem and a signed Time, and drop themselves as an item
after 600 ticks off the ground instead of landing. A crafter's saved
triggered flag only follows the block state when the state changes
(CrafterBlock.neighborChanged), and a horse saves the attribute instances
it was loaded with, as AttributeMap.pack does.

The harness compares vanilla log lines without their time stamps, accepts
extra entities only in chunks vanilla never generated, treats a falling
block's Time as a timer, and keeps the lit furnace's slots out of the
vanilla view. Its scene starts the falling block far below the 600-tick
limit and keeps the campfire from finishing during the run. The known-gap
list is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:49:38 +02:00
Ludovic Marie 13e434d49d Compare the music manager tick by tick with the real vanilla MusicManager
The oracle drives MusicManager over the real SoundEngine with the situation
as input; the script covers delays, replacements, frequencies, fades,
loading screens, pauses, silent starts, toasts and unplayable events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:49:11 +02:00
Ludovic Marie 120ac32311 Test LAN hosting against the vanilla client and track entities as ServerEntity does
Add a decoding capture proxy (tools/net_capture.py), an offline vanilla
client launcher (tools/vanilla_client.py) and a vanilla codec oracle that
decodes every captured clientbound packet with vanilla's StreamCodecs.
Fix the entity data serializer ids (vector3 onwards were off by one), the
sheep wool and piglin baby indices, send mob variants, villager data and
equipment, and send entity movement at each type's update interval and
tracking range with position syncs, like ServerEntity.sendChanges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:47:11 +02:00
Ludovic Marie b29f51f8e1 Add a differential mob AI harness and match vanilla mob movement math
VanillaMobAiOracle runs vanilla mobs in a real headless flat server level,
ticking them as ServerLevel does while the rest of the level stands
still; mob_ai_probe replays the same scenarios on Horizon. Both print each
mob's AI-visible state every tick (position, motion, rotations, goals,
targets, navigation, controls, input, brain activities and memories,
sounds) and tools/test_mob_ai_parity.py reports the first divergence.

Fixes found: float entity dimensions, Mth.sin/cos in moveRelative and the
strafe/swim controls, Mth.atan2 and the float thresholds of the controls,
RandomPos float constants, the ambient sound clock starting at zero, hurt
and death sounds drawn from the mob's own random (also when burning),
knockback for every damage type not tagged no_knockback, Entity.move's
collision flags, restitution and footstep/swim sounds, and mob sound
volumes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:46:57 +02:00
Ludovic Marie f85411f2fb Port the camera, field of view and view/hurt bobbing exactly
Camera.tick, tickFov, alignWithEntity with getMaxZoom over visual-shape
clipping, setRotation and move with JOML quaternion arithmetic,
calculateFov/calculateHudFov, getFieldOfViewModifier (now including
flight), ClientAvatarState walk/bob history (the backwards-extrapolated
walk distance and velocity-based bob) and GameRenderer.bobHurt/bobView as
the JOML pose matrix with property flags. The game renders through them,
adding hurt tilt, the camera distance and scale attributes, the mirrored
front camera and the sleeping camera. tools/test_camera_parity.py compares
18,502 cases against the real classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:45:35 +02:00
Ludovic Marie ccdf49d3e5 Play every sound through the vanilla SoundEngine model
Audio now keeps vanilla SoundEngine bookkeeping over a mixer that stands in
for OpenAL sources (gain, pitch, linear distance attenuation, looping,
relative, source states, the 247/8 channel pools), ticks once per client
tick with pauseAllExcept/resume and stops everything when the world closes.
MusicManager holds a forMusic instance and checks isActive as vanilla does;
the ambient handlers play LoopSoundInstance, UnderLiquid* and mood instances,
the enter/exit sounds seeded from the level random; jukebox songs use
forJukeboxSong instead of a hand-made volume ramp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:44:58 +02:00
Ludovic Marie 3429de0020 Compare block entity rendering with vanilla renderers
Add a differential harness (test_block_entity_render_parity) whose Java
oracle runs each vanilla BlockEntityRenderer on a real block entity and
captures the submitted model vertices, textures, light and text calls.
Horizon now animates shulker lids, bell shakes, active conduits (cage,
wind and the camera-facing eye), skull jaws and ears, pot wobble and
sherd sides; signs wrap lines like StringSplitter and measure spaces
with the font; books use the Mth sine table and player heads the slim
default skin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:35:45 +02:00
Ludovic Marie d68efbabfc Compare the sound engine bookkeeping with the real vanilla SoundEngine
The oracle runs vanilla SoundManager/SoundEngine on OpenAL Soft null device
(inline executor, silent buffers) and replays scripts of plays, stops,
category gains, option volumes, channel ends, pauses, queued, delayed and
looping sounds and tickable ambient instances, printing every AL source
parameter, isActive, subtitle notification and pool count per step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:33:17 +02:00
Ludovic Marie fc468a021d Resolve item models exactly as the vanilla client does
The item model harness ran out of memory, so it now streams both outputs and
looks Horizon's rows up by offset. With the vanilla side no longer crashing on
swap-animation lookups (properties now come from the baked set), on armour
(trim sprites are generated by the items atlas's paletted_permutations source
once SpriteSources is bootstrapped) or on compasses (item tags are bound from
the data pack), 197,000 more stacks were compared and 121,841 differed.

Horizon now composes transformations as JOML 1.10.9 does: rotationXYZ and
axis-angle quaternions with cosFromSin, and Matrix4f operations that take the
identity, translation, affine or generic path by matrix properties, with
unfused a * b + c. Float RGB tint constants are scaled by 255, the shulker box
renderer always encodes its texture, and a new palette module ports
PalettedPermutations and PaletteMapping so trim sprites exist on the Horizon
side too.

196,290 resolved stacks match; 2,582 cases are still rejected by vanilla's
stand-in client and not compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:21:50 +02:00
Ludovic Marie 1d70ca47a8 Generate whole chunks block for block as vanilla does
The chunk generation harness found 70 differing chunks across three seeds in
the overworld, Nether and End. Proto chunks, biomes and decoration now span
the dimension type's build range rather than the noise height, so features
above y=128 in the Nether and End city upper floors survive; the decoration
level reports no sky light, as unlit vanilla chunks do, so mushrooms and crops
pass or fail their light checks the same way; beehive decorators store their
bees; iceberg ellipses skip NaN distances; double slabs never waterlog;
mineshaft spawners save an empty SpawnPotentials list; and the dump example
forgets structure starts between rectangles, as the oracle starts each with
fresh chunks.

The oracle prints absent block entity keys as vanilla loads them from an empty
tag, and the harness treats vanilla's save-format equivalences (plain sign
text, absent empty banner patterns, unfiltered sign messages) as equal. All 2,352
chunks over 225 structure sites match with zero block, biome or block entity
differences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:20:51 +02:00
Ludovic Marie ad4d836f6f Resolve sound events exactly as vanilla SoundManager does
Add SoundRegistry (sounds.json with replace, subtitles, file validation and
event references weighing as much as their event) and a SoundEngine model,
with a differential harness resolving every sounds.json event against the
real SoundManager.prepare and SimpleSoundInstance.getOrResolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 21:16:28 +02:00
Ludovic Marie 1e03d531eb Parse every command exactly as vanilla's Brigadier tree does
Ports vanilla's packrat parser with SNBT and component-predicate grammars, the
entity selector, block state and item parsers, resource-or-inline codec
arguments, and the remaining argument types, suggestion providers and error
cursors. The tree gains compute, data modify compute, place, locate poi,
datapack create, item modifiers and the parse-only commands (dialog, kick,
posteffect, fetchprofile, spectate, publish, waypoint, debug, jfr), with
release-dispatcher permissions. /particle takes the 26.3 option syntax.

The oracle's stand-in server now holds a fresh world's real state (data pack
managers, pack repository, empty storages, clocks, templates, an overworld),
so vanilla answers every input instead of crashing on about 1,100 per level.
The command parse harness matches on 39,685 of 39,685 commands at permission
levels 4, 2 and 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 20:56:06 +02:00
Ludovic Marie 6897e4155b Add the nautilus, zombie nautilus, sulfur cube and camel husk
Ports AbstractNautilus, Nautilus, ZombieNautilus and their brains (taming
with pufferfish, saddles and nautilus armour, riding with a dash, breeding,
spawning below sea level, drowned riders), SulfurCube on the slime code
(swallowed blocks and their archetypes, shears, TNT cubes, splitting) and
CamelHusk on the camel (its own saddle and sounds, husk jockeys). Camels now
save their saddle and stay tame after loading, and horse armour layers load.

The entity model harness compares 150 layers, all matching, including the new
mobs and previously unmapped armour, harness, fish and villager layers; mob
attributes pass with the new types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 20:55:17 +02:00
Ludovic Marie f58413cbbf Random-tick only sections holding randomly ticking states
The client random-ticked every section with a non-air block, drawing
getBlockRandomPos positions vanilla never draws. It now ticks a section only
when its palette holds a randomly ticking state, as
LevelChunkSection.isRandomlyTicking does (lava counts through LiquidBlock).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 20:02:40 +02:00
Ludovic Marie 58fe23d330 Match vanilla entity model poses on every compared layer
The warden's walk, idle wobble and pulsating spots now use Mth's sine table
as WardenModel and WardenRenderer do, and baby sniffers no longer apply
SnifferAnimation.BABY_TRANSFORM: SnifferRenderer wraps the baby geometry in a
plain SnifferModel, so that animation never runs in 26.3. The harness now
drives the illusioner through explicit arm poses like the other illagers, and
the oracle shows its hat as IllusionerRenderer does. All 132 compared layers
match over 3,876 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:58:56 +02:00
Ludovic Marie 2876752a36 Read an empty lectern's comparator signal in the block fixture
The oracle now gives comparators and lecterns real block entities, so a
lectern whose state has a book reads page progress 1 of an empty book and
signals 14. The fixture's stand-in block entities now do the same, and the
redstone harness matches on 8,000 of 8,000 cases with a second seed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:32:30 +02:00
Ludovic Marie 11b8a98ff5 Match vanilla random ticks on every comparable case
The random tick oracle now stands on a real overworld: the data pack's
dimension type (for fire's infiniburn tag), its attributes and day timeline
on a clock at the fixture's day time, level data for difficulty, and block
scans that walk positions in BlockScanUtils' section order, since 26.3 reads
chunk sections the map-backed level does not have.

Horizon now rolls the nether portal's zombified piglin spawn with the level
random (the client spawns it near a player), rechecks chest and ender chest
openers through a new block entity hook and broadcasts the lid event, gives
melting ice and placed sniffer eggs their game events, and reads the weather
age of copper golem statues, which name the field weatheringState. The
fixture prints empty dispensers, crafters, ghastling spawns and fresh
shriekers as vanilla resolves them.

Random ticks match on 39,998 of 39,998 compared cases (two propagules cannot
grow trees in the oracle), block updates on 40,000 of 40,000 and redstone on
3,999 of 4,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 18:51:18 +02:00
Ludovic Marie cf570c9fba Match vanilla block updates on every harness case
The block update oracle crashed on 625 cases because its constructor-less
level had no sound seed generator, attribute system or chunk source; it now
supplies them, keeps cave and void air apart from air, and creates block
entities on demand as a real level does. With those cases compared, Horizon
now primes TNT with the level random, sound and prime_fuse event at the
moment of priming, links powered wooden shelves into side chains, breaks
nether portals whose frame is no longer complete, reacts to power at command
blocks through a new block entity hook, rings bells with their block event,
uses the straw bed's own destroy particles and gives big dripleaf tilt changes
their vibration. Empty dispensers also emit block_activate in the client.

Block updates match on 40,000 of 40,000 cases and redstone on 3,999 of 4,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 18:27:39 +02:00
Ludovic Marie 60cf7b5252 Merge branch 'main' into night-entities 2026-10-10 10:26:59 +02:00
Ludovic Marie f419c33533 Add mob attribute and dimension parity harness
Adds a differential harness that instantiates every vanilla entity type on a detached server level and compares default attributes, standing dimensions and baby dimensions with Horizon's mob table. Baby donkeys and mules now use the vanilla half-size hitbox instead of 0.7 scale.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 10:26:59 +02:00
Ludovic Marie d5ce2b5201 Merge worktree-agent-abc3c79c07e209fba 2026-10-10 10:08:36 +02:00
Ludovic Marie e53da6f281 Merge worktree-agent-a45c92d353e101334 2026-10-10 10:08:35 +02:00
Ludovic Marie 0548179661 Merge worktree-agent-a3f604d3c8055fe6e 2026-10-10 10:08:35 +02:00
Ludovic Marie aabc88d433 Merge main into agent branch
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:57:55 +02:00
Ludovic Marie 88980141c2 Merge branch 'main' into worktree-agent-a45c92d353e101334 2026-10-10 09:57:38 +02:00
Ludovic Marie a08f6c7c7a Fix clippy lint in item modifier sequence
The sequence loot function folds over an Option accumulator, which clippy flags as a manual try_fold. The fold is intentional, so allow the lint there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:57:38 +02:00
Ludovic Marie 8e4e31e823 Merge worktree-agent-afae8fa7e3c2bed72 2026-10-10 09:55:55 +02:00
Ludovic Marie 742a3dbfca Merge main into the X work
Merges local main into this branch. The only conflict was in the illager
animation: this branch's anim_pose (with the passenger sitting pose) is kept,
and main's change that leaves the illusioner's hat visible is applied to it.
fmt, clippy with -D warnings and the full workspace tests pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:54:41 +02:00
Ludovic Marie 03e7c7fd64 Merge main into the save roundtrip work
Brings main's sync_level()/save_game() split and the world ticks inside
`if running {}` into the typed block entity NBT, save roundtrip harness and
session.lock work. The only textual conflict was in recipe_book.rs, where
the player file writer keeps main's toBeDisplayed list alongside the
recipes list. fmt, clippy -D warnings and the whole workspace test suite
pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:52:51 +02:00
Ludovic Marie 2758614c49 Merge worktree-agent-aadb889c2eebe6c5b 2026-10-10 09:31:28 +02:00
Ludovic Marie d511cffa11 Satisfy clippy in the long set size check
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:31:13 +02:00
Ludovic Marie 5dbf3b62a8 Fix integration of the overnight branches
After merging the overnight feature branches, the only remaining problem was a clippy lint in the illusioner mob code, where a manual modulo check had to become is_multiple_of. With that change, formatting, clippy with warnings denied and the full workspace test suite all pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:15:53 +02:00
Ludovic Marie bd9b873fcd Add random tick and redstone harnesses, wire detector rails and plates
Adds differential harnesses for random/scheduled ticks and redstone circuits on top of the block update oracle, and makes the oracle report pending block events as the deduplicated set vanilla keeps. The harness found that detector rails never sensed anything, so they now check for minecarts on place, tick and entity contact, and the client reports the player and minecarts to pressure plates, tripwires and detector rails each tick.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:12:17 +02:00
Ludovic Marie c8567f4049 Merge main into the item model and mob work
Finishes the in-progress merge of main into this worktree's branch, keeping both sides: main's sync_level()/save_game() split and the world ticks inside the running block alongside this branch's item model baking, new mob brains and command parsing work. cargo fmt, clippy with warnings denied and the full workspace tests all pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 09:08:45 +02:00
Ludovic Marie eba56af3d6 Merge worktree-agent-ad30db2169aa3bd5b 2026-10-10 09:05:49 +02:00
Ludovic Marie f0d33d3cf8 WIP: command and datapack tweaks
Work in progress on commands, functions and scoreboard handling carried over from the interrupted run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 08:59:08 +02:00
Ludovic Marie 528cb26f33 Add illusioners
The illusioner is an illager spellcaster with a bow. It casts a mirror spell that makes it invisible for a minute while four mirror images wobble around it and reshuffle when it is hurt, and, on Hard-ish local difficulty, a blindness spell on a new target. It shoots arrows like a skeleton, flees from creakings, joins raids and illager target rules, scares villagers and traders, and shows its hat and bow arm pose as in vanilla. Other illagers no longer draw the hidden hat layer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 08:51:41 +02:00
Ludovic Marie d32c0bf209 Merge worktree-agent-aa7e89ef91d408a4e 2026-10-10 08:46:27 +02:00
Ludovic Marie f5a4a4931e Merge worktree-agent-a12e061d400abc3f6 2026-10-10 08:46:23 +02:00
Ludovic Marie adb7db1893 Merge worktree-agent-a3d290373639c1580 2026-10-10 08:46:19 +02:00
Ludovic Marie 9489ce1cd8 Merge worktree-agent-aa7f8206a004fc51a 2026-10-10 08:46:17 +02:00
Ludovic Marie f9cf32650b Merge branch 'main' into worktree-agent-aadb889c2eebe6c5b 2026-10-10 08:46:16 +02:00
Ludovic Marie 4dbab3ba99 Merge branch 'main' into worktree-agent-a3f604d3c8055fe6e 2026-10-10 08:15:00 +02:00
Ludovic Marie 935e2712be Merge main into the game loop and input work
Merge local main into the options, timer and mouse branch. The only conflict was the module list in horizon-client's lib.rs, where this branch adds keymapping and main adds lan; both modules are kept. main's sync_level()/save_game() split and the world ticks inside `if running {}` merged cleanly. cargo fmt, clippy with -D warnings and the whole workspace test suite pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-10 08:12:32 +02:00