reddit_programming 2026-10-25 원문 보기 ↗
A side project where Minecraft's player fights inside Mount & Blade II: Bannerlord. The three parts never call each other; they only meet in five named shared-memory blocks:
- a Bannerlord module (C#, Harmony patches),
- a Minecraft Fabric mod (Java 25, Mixin, the Foreign Function & Memory API),
- a ReShade add-on (C++) with an HLSL shader that composites Minecraft's frame into Bannerlord's.
Some of the interesting problems:
- lock-free sharing with seqlocks and single-writer ring buffers, so neither game ever waits for the other
- comparing two different reversed-Z depth buffers per pixel, and reprojecting a Minecraft frame that's a frame or two old
- making Minecraft's own attack code hit soldiers that only exist in the other game (invisible, frozen stand-in mobs)
- rebuilding Bannerlord's terrain around the player as invisible Minecraft blocks, without stutter while flying
Write-up of every byte: https://github.com/emretrksy/bannerlord-minecraft-passthrough/blob/main/docs/PROTOCOL.md
Repo (MIT): https://github.com/emretrksy/bannerlord-minecraft-passthrough