Commit Graph

4750 Commits

Author SHA1 Message Date
Ludovic Marie 304ea50a5f Shader packs design: the renderer's passes, Horizon WGSL packs and Iris translation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:35:11 +02:00
Ludovic Marie 1573e4e553 Cap a fresh install at vanilla's 120 frames per second (#271)
Without an options.txt the game ran unlimited (260), while an options.txt
without maxFps, like vanilla, gives 120. With VSync off (or rendering
offscreen) that kept a core busy drawing frames nobody sees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:34:36 +02:00
Ludovic Marie 337ee470b5 Merge pull request #318 from rdbtCVS/perf/20261015-random-tick-eligibility
Cache random-tick section eligibility across unchanged chunks
2026-10-15 14:29:44 +02:00
Ludovic Marie 1286523047 Merge pull request #309 from rdbtCVS/perf/20261015-typed-block-facts
Load gameplay facts with typed decoding and interned shapes
2026-10-15 14:29:37 +02:00
Ludovic Marie b0abb62883 Launcher MCP: play the running game through game_* tools
An agent now needs one MCP server. horizon-launcher mcp runs the selected
version's horizon-ctl mcp as a child and offers its tools as game_<name>
(all but launch, which launch_client covers), passing calls and image
results through. launch_client starts the game with a control socket in
the launcher's data folder, takes world, creative and offscreen, and
returns once the socket answers. A game tool called while no game listens
says to call launch_client.

tools/launcher_mcp_e2e.py checks it end to end against this checkout's
builds in a scratch launcher home.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:23:57 +02:00
Ludovic Marie a2b62913ba Merge pull request #331 from ludovic111/chore/discord-assets-to-kira
Move the Discord brand assets to the kira repo
2026-10-15 14:23:38 +02:00
Ludovic Marie 8dc2a0e90a Move the Discord brand assets to the kira repo; this repo holds the game, launcher and website
The Discord server banner (page + PNG), the server icon render and Kira's avatar (SVG master +
render) now live in the private kira repo (ludovic111/kira#1). xtask icons no longer renders them;
the brand README points there, and CONTRIBUTING states what belongs in this repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:23:14 +02:00
rdbtCVS 969ff7e4d9 Merge main and preserve shared model-state preparation 2026-10-15 13:22:02 +01:00
rdbtCVS 7b8189d19c perf(client): share parsed block and item models 2026-10-15 13:20:49 +01:00
Ludovic Marie 8c5d1ed86b Agent control: the widget tree of every screen, click and set by id
`ui` lists every widget the last frame drew (title menus, pause, options
in both menu styles, inventories and menus) with an id, its kind, label,
bounds and value; `click ID` clicks one through the same window events
as the mouse, `set ID VALUE` moves a slider along its track. Ids come
from labels (FOV: 70 is fov), world/server/language rows carry their
names, Horizon switches, sliders and segments their row's caption, and
inventory slots are slot-ID with their stacks. After a click, the next
widget command waits for a redrawn frame.

horizon-ctl and its MCP gain ui, click and set, and launch --offscreen.
tools/agent_control_e2e.py gains a ui scenario and runs offscreen on
macOS; both scenarios now handle Singleplayer opening Create New World
when there are no worlds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:08:15 +02:00
Ludovic Marie 90edb028bf Mods design: Horizon's Rust mod system and what carries over from Java mods
docs/mods.md: the sandboxed WebAssembly runtime, capabilities, hooks, budgets,
authoring, versions, multiplayer and distribution, with measured hook costs.
docs/research/java-mod-compat.md: why Fabric/NeoForge jars cannot run, data
import, which mods to port natively first, a porting guide outline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:04:56 +02:00
Ludovic Marie 0248df4d90 cargo horizon-mod: new, build and run Horizon mods
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:01:57 +02:00
Ludovic Marie b3906d803d Horizon mods runtime: load sandboxed WebAssembly components with wasmtime
Manifest and .hmod reading, capability checks against the component's imports,
fuel and memory limits per call, a trapping mod stopped alone, hot reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:01:57 +02:00
Ludovic Marie 670e055f4a Horizon mod SDK: the horizon:mods WIT contract, a Rust SDK and an example mod
horizon-mod-sdk wraps wit-bindgen: a Mod trait with default hooks and export_mod!.
coords-hud shows coordinates, facing and the time of day, with /where and /coords.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:01:57 +02:00
Ludovic Marie c6eb50f10b Merge pull request #325 from ludovic111/feat/version-port-report
Port report: ranked work items from a Minecraft version diff
2026-10-15 14:00:06 +02:00
Ludovic Marie 62b704ceaf Merge pull request #324 from ludovic111/feat/version-port-classes
Diff vanilla classes method by method and map them to Horizon
2026-10-15 13:59:57 +02:00
Ludovic Marie 59d0148057 Merge pull request #323 from ludovic111/feat/version-port-diff
version_port.py: detect, prepare and diff Minecraft releases
2026-10-15 13:59:50 +02:00
Ludovic Marie 64f480ce65 Merge pull request #322 from ludovic111/docs/version-ports
Design: port each new Minecraft release with as little human work as possible
2026-10-15 13:59:44 +02:00
Ludovic Marie 7c0d3ceea6 Port report: ranked work items from a version diff
tools/port_report.py turns a diff into work items: rank 1 blocks the switch (facts,
packets, DataFixers, data component types, report formats, tables to regenerate),
rank 2 and 3 one item per Horizon file that ports changed vanilla code (with or
without a harness), rank 4 new content, rank 5 summaries. version_port.py report
writes report.md and report.json; port prepares, diffs and reports in one go.
The class map now resolves names of both versions. The doc records the 26.2 -> 26.3
replay against Horizon's own code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:51:39 +02:00
Ludovic Marie 93bb113e0d Diff vanilla classes method by method and map them to Horizon
tools/class_index.py hashes every method's bytecode with constant-pool references
resolved and branch targets as instruction indices, lambdas folded into their
declaring method; class diffs list moved classes. tools/vanilla_map.py maps vanilla
classes to the Rust files whose comments name them and the harnesses whose oracles
or probes reach them. version_port.py prepare indexes, diff reports both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:44:26 +02:00
Ludovic Marie 58ad81674b version_port.py: detect, prepare and diff Minecraft releases
detect reads Mojang's manifest; prepare downloads and verifies a version into the
version store (outside the repository), runs its data generator and reads the
jar's own version facts; diff compares facts, packets, registries, blocks, item
components, commands, data packs, assets and lang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:38:37 +02:00
Ludovic Marie 720e91fb8c Design the version-port pipeline: detect, prepare, diff, regenerate, report
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:33:51 +02:00
Ludovic Marie 81c3e58a1c docs/agent-control.md: inventory of agent control and the design ahead
What the launcher, the game socket, horizon-ctl and the two MCP servers
can do today, and one model for what comes next: shared names and JSON
shapes, a widget tree with actions by id, options get/set, waits, an
event stream, the launcher's MCP proxying the game, errors with a kind,
and the safety rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:32:32 +02:00
Ludovic Marie a3cf73d9be Merge pull request #316 from ludovic111/feat/fishing-rod-visuals
Fishing: the rod casts, bites splash and bubble, and the line is vanilla's
2026-10-15 12:40:48 +02:00
Ludovic Marie 44e21e6601 Merge main into feat/fishing-rod-visuals: keep the off-hand renderer, add the cast-rod flag
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:35:49 +02:00
Ludovic Marie ce6bc9c5c7 Merge pull request #320 from ludovic111/feat/trial-spawners-game
Trial spawners run in game
2026-10-15 12:32:58 +02:00
Ludovic Marie 96268647d3 Merge pull request #319 from ludovic111/feat/trial-spawners
Trial spawner state machine, checked against vanilla
2026-10-15 12:32:52 +02:00
Ludovic Marie d4c16084d7 Merge pull request #317 from ludovic111/fix/axe-copper-animation
Axes on copper: a shield in the off hand is raised first, and sculk sensors hear it
2026-10-15 12:32:40 +02:00
Ludovic Marie fd3d456de8 Merge pull request #315 from ludovic111/feat/minecart-sounds
Minecarts roll and rattle when ridden, and hits on vehicles sound
2026-10-15 12:32:32 +02:00
Ludovic Marie 23ac335b53 Merge pull request #314 from ludovic111/fix/offhand-render
Show the off-hand item in first person
2026-10-15 12:32:26 +02:00
Ludovic Marie 204e4fdccb Merge pull request #313 from ludovic111/fix/offhand-use
Use the off hand when the main hand passes: place blocks, eat, charge anchors
2026-10-15 12:32:20 +02:00
Ludovic Marie e00ce7c89e Merge pull request #312 from ludovic111/fix/offhand-crossbow-fireworks
Crossbows load firework rockets from either hand; bows and crossbows take held arrows first
2026-10-15 12:32:14 +02:00
Ludovic Marie 40d5b43e43 Merge pull request #311 from ludovic111/fix/shield-deflects-arrows
Shields turn arrows back, as vanilla does
2026-10-15 12:32:06 +02:00
Ludovic Marie d5e7dc76e6 Merge pull request #310 from ludovic111/fix/shield-block-no-hurt-sound
Shield blocks: the player hears the block sound, not the hurt sound
2026-10-15 12:32:00 +02:00
rdbtCVS ed0febf163 Merge main and preserve tick chunk membership invalidation 2026-10-15 11:29:05 +01:00
Ludovic Marie ed3d1e1168 Trial spawners run in game
Trial spawner block entities are kept (generated chunks and saves), tick on
the server with the level random and random sequences, spawn persistent
mobs, eject their rewards as items and set their block state, with their
level events and shutter sounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:20:30 +02:00
Ludovic Marie ca76075cc9 Trial spawner state machine, checked against vanilla
mobs::trial_spawner: TrialSpawner and its state data, the registry
configs (data/*/trial_spawner), the six states, player detection with the
visual line of sight, mob spawns and reward ejection, read and saved as
vanilla does (a field that fails to decode takes its default alone).

tools/test_trial_spawner_parity.py ticks 2,500 random trial spawners in
VanillaNaturalSpawnOracle and natural_spawn_fixture and compares states,
spawns, events and ejected items line by line.

Also: copper grates have no visual shape; a slime's or magma cube's
obstruction box scales with the Size its spawn data sets; LootData::roll_split
for an empty-context getRandomItems.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 12:20:29 +02:00
rdbtCVS ef92004ede test(client): cache legacy shape identity keys 2026-10-15 10:57:28 +01:00
rdbtCVS bea9d4b765 perf(client): decode gameplay facts without a JSON document tree 2026-10-15 10:57:28 +01:00
Ludovic Marie ce4d520f55 Fishing line: the hand side is a float, as in vanilla
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:55:30 +02:00
Ludovic Marie e162f9cdb7 Axes on copper: a shield in the off hand comes first, and sculk hears it
Scraping and waxing off copper already swing the arm, show the scrape and
wax-off particles and play the axe sound on main (#59, #104). Two gaps were
left in BlockTransformer.transformBlock:

- playerHasBlockingItemUseIntent: with a shield in the off hand, right-clicking
  with an axe raises the shield instead of scraping, unless sneaking.
- The block_change game event, which sculk sensors pick up.

Fixes #222

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:47:02 +02:00
Ludovic Marie 64739d2b8b Show the off-hand item in first person
FirstPersonHandsAndItemsRenderer draws both hands: the off-hand item sits
on the other arm with its own equip height and swing, uses its own pose
when it is the hand in use (eating, blocking, drawing a bow), and
evaluateWhichHandsToRender hides a hand while a bow or crossbow is drawn
or a charged crossbow is held in the main hand. Only the main hand's empty
arm shows, as in vanilla.

Part of #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie 5e2935747b Use the off hand when the main hand passes: place blocks, eat, charge anchors
Minecraft.startUseItem tries each InteractionHand in turn: useItemOn, then
useItem, stopping at the first that succeeds or fails. Item uses now act on
the hand that started them (Game::hand), so blocks, food, potions, buckets,
spawn eggs and the rest work from the off hand, the swing and the
re-equip animation follow that hand, and the empty-hand block use
(useWithoutItem) stays main-hand only. The respawn anchor passes on the
main hand when the off hand holds glowstone, as vanilla does, replacing the
special case for it.

The use_item_on harness now puts items in the off hand too.

Part of #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie ffd0297dc4 Crossbows load firework rockets from either hand; bows and crossbows take held arrows first
Player.getProjectile: what the weapon supports in the off hand, then in
the main hand (getHeldProjectile; crossbows also take firework rockets
there), else the first arrows in the inventory. Crossbows only looked
for arrows in the inventory, so a rocket in the off hand was never
loaded. A charged rocket is shot at an angle from 0.15 under the eyes
(CrossbowItem.createProjectile), every shot of a load holding one at
power 1.6 (getShootingPower), for three durability (getDurabilityUse).

Part of #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie e2473aafd8 Shields turn arrows back, as vanilla does
AbstractArrow.onHitEntity: an entity that takes no damage from the arrow
(a raised shield, invulnerability) turns it back with
ProjectileDeflection.REVERSE at power 0.2: a tenth of the speed, a half
turn give or take ten degrees from the arrow's own random; one left
almost still drops its pickup and is discarded. Arrows used to vanish.

The arrow tick now stops at the entity it hits: the game hurts the
entity, then arrows::finish_entity_hit spends the arrow (with its hit
sound, from the arrow's random) or turns it back, and ends the tick
(drag, gravity, fluids). The damage is taken from the speed at the hit,
the crit bonus from the arrow's random, the entity search follows
ProjectileUtil.getManyEntityHitResult (the box first, then
computeMargin's margin, which needs tickCount), Punch pushes only what
was hurt, and a refused burning arrow leaves the player's fire as it
was. Mobs' refusals keep the old ending until their hurt results follow
hurtServer.

The arrow harness gains an entity in the way that takes or refuses the
damage: squarely, grazing, slow enough to drop.

Part of #277

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
Ludovic Marie 72ff742273 Shield blocks: the player hears the block sound, not the hurt sound
LivingEntity.hurtServer's playHurtSound goes through Player.playSound,
which leaves the player itself out; the player hears its hurt sound from
the client's handleDamageEvent, and a blocked hit sends BlocksAttacks'
block sound (onBlocked) instead of the damage event. Queue the local hurt
sound on the damage broadcast rather than on the server's hurt sound.

Part of #277

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:41:06 +02:00
rdbtCVS fac4944cfa Document transient chunk wrapper retention 2026-10-15 10:40:54 +01:00
Ludovic Marie 050b203846 Merge pull request #306 from ludovic111/feat/debug-lightmap
F3+4 shows the lightmap texture in the bottom right corner
2026-10-15 11:39:03 +02:00
Ludovic Marie b6ced87869 Merge pull request #305 from ludovic111/feat/debug-charts
Debug charts: F3+2 frame and tick times, F3+3 ping and bandwidth
2026-10-15 11:38:57 +02:00
Ludovic Marie 89465a8c6d Merge pull request #304 from ludovic111/feat/create-world-tabs
Create New World: vanilla's Game, World and More tabs
2026-10-15 11:37:55 +02:00