Skip to content

Releases: SputnikKaputtnik/magic-carpet-2-hd-reloaded

Reloaded fork 0.9.1 - upstream fixes merged, mana fix switchable

Choose a tag to compare

@SputnikKaputtnik SputnikKaputtnik released this 28 Sep 10:18

Brings the base project's latest decompilation fixes into the fork, and makes the
mana sphere colour fix switchable so the base project's regression suite can
guard this fork again.

Merged from Magic Carpet 2 HD

57 commits of upstream work since 2026-09-07 — decompilation fixes (archers,
invisibility, the countdown of a destroyed castle and several single functions),
a signed byte type that brings dead code such as the transparency render back to
life, and a rewritten regression test runner with DOSBox-X recordings of levels
1–5. The credit for it belongs to
thobbsinteractive and turican0.

Changed

  • game.fixManaSphereColour (default true) — the mana sphere colour fix
    from 0.8.2 is now optional. A resting sphere shows its current owner's colour;
    false restores the original behaviour, where it keeps its previous owner's
    colour while that owner's rival collects it.

Fixed

  • Exit warp trail stalls on a faint ghost (F8). The trail is kept at 16 bits
    per channel instead of 8. At 8 bits the per-frame fade rounded to zero once the
    trail came close to the world, so it stopped on a ghost image and could break
    into patches. Costs 16 MB more video memory at 4K.

Note on testing

This time the base project's own remc2-regression-test suite was run,
headless, against recordings of the original DOS game:

Build Passed
upstream development (c769164) 40 / 42
this release, fixManaSphereColour: false 40 / 42 — the same two (levels 22, 25)
this release, fixManaSphereColour: true 30 / 42

So the GPU renderer and the fixed simulation rate do not move the simulation;
the only difference from the original the suite finds is the mana sphere's
refreshed sprite index, which is the fix itself. regression-config.json
switches it off. The 16 renderer regressions pass as well.

Installing

You need an existing Magic Carpet 2 HD installation. This download is the
executable only — no game data is included here and none ever will be. Install
Magic Carpet 2 HD
first (it needs the GOG edition or an original CD), then put remc2-gpu.exe in
the same folder as that installation's remc2.exe and start it instead of the
original.

Nothing is overwritten, and starting remc2.exe again takes you back. Want
different settings for each? Copy config.json to config-gpu.json and edit
that one.

Requirements

Windows with Direct3D 11. gpuSky and the exact blend modes want feature level
11_1 hardware — in practice anything from roughly 2013 on. The SDL2 libraries and
the Visual C++ runtime come with the Magic Carpet 2 HD installation.

The binary is not code signed, so Windows SmartScreen will warn about an
unknown publisher. Verify it instead:

SHA256  CA2FDF861F30D3584422E6FAE2AD6C6631E87070B6D211A49A6C344F07F4442C

Or build it yourself — the source is this repository.

Credit where it belongs

Magic Carpet 2 is Bullfrog Productions (1995);
turican0 reverse engineered it into C/C++; and
thobbsinteractive and contributors
built the HD project this branches from. This fork only adds a renderer.

The code in this fork was written with Claude Code.

Reloaded fork 0.9.0 - upstream merged, renderer regressions repaired

Choose a tag to compare

@SputnikKaputtnik SputnikKaputtnik released this 10 Sep 07:34

Brings the base project's own progress into the fork, and repairs a test that
had been failing quietly.

Merged from Magic Carpet 2 HD

48 commits of upstream work since 2026-08-06 — the network rework, multiplayer
scores, popup messages, "fix load game" and a renaming pass over the engine.
Everything the base project gained in that time is in this build; the credit for
it belongs to thobbsinteractive and turican0.

The GPU world frame is byte-identical to 0.8.2 after the merge — 0 of 921600
palette indices differ at the same simulation tick — so the merge and the renames
left the rendering untouched.

Fixed

  • --test_renderers now switches the GPU stages off by itself. That suite
    compares the HD software renderer against the original one on the CPU. Since
    the GPU stages default to on (0.8.1), the HD image was on the GPU while the
    comparison read a CPU buffer that had been cleared — every pixel differed and
    the suite failed without explaining why. It had been failing since 0.8.1, the
    0.8.2 release included. 16/16 pass again.

Installing

You need an existing Magic Carpet 2 HD installation. This download is the
executable only — no game data is included here and none ever will be. Install
Magic Carpet 2 HD
first (it needs the GOG edition or an original CD), then put remc2-gpu.exe in
the same folder as that installation's remc2.exe and start it instead of the
original.

That is all. The GPU renderer is on by default, nothing is overwritten, and
starting remc2.exe again takes you back. Want different settings for each — a
higher resolution for the GPU renderer, say? Copy config.json to
config-gpu.json and edit that one.

What the fork does

  • Direct3D 11 world renderer — terrain, world sprites and sky on the GPU
  • Exact draw order between terrain and sprites, and exact destination
    blending
    (translucent water, shadows) through rasterizer ordered views
  • Roughly 30x less CPU time per world frame — 11.85 ms → 0.40 ms at 1280x720
  • The exit warp keeps its frame rate — it used to drop the world onto the
    software rasteriser, 60 fps → 3.5 at 4K
  • View distance up to 4x (Shift+F11) and a frame rate counter (Shift+F12)

Measurements, method and known limitations: docs/GPU-RENDERER.md

Requirements

Windows with Direct3D 11. gpuSky and the exact blend modes want feature level
11_1 hardware — in practice anything from roughly 2013 on. The SDL2 libraries and
the Visual C++ runtime come with the Magic Carpet 2 HD installation.

The binary is not code signed, so Windows SmartScreen will warn about an
unknown publisher. Verify it instead:

SHA256  C27CB53D4EB081F063C08C78C35D68F3F529D9669040178838E4805B5110D5BB

Or build it yourself — the source is this repository.

Note on testing

The renderer regressions (16/16) and a byte-exact frame comparison against 0.8.2
were run for this release. The base project's own remc2-regression-test suite
was not re-run after the merge; the upstream changes it covers are mostly
network and multiplayer code, which this fork does not touch.

Credit where it belongs

Magic Carpet 2 is Bullfrog Productions (1995);
turican0 reverse engineered it into C/C++; and
thobbsinteractive and contributors
built the HD project this branches from. This fork only adds a renderer.

The code in this fork was written with Claude Code.

Reloaded fork 0.8.2 - code review fixes, scaled fog, mana colours

Choose a tag to compare

@SputnikKaputtnik SputnikKaputtnik released this 06 Sep 08:41

Bug fix release on top of 0.8.1: the findings of an external code review of the
D3D11 renderer, a fog that scales with the view distance, and mana spheres that
show their real owner.

Fixed

  • Terrain atlas upload read past the end of the texture buffer with
    high-res (128 px) textures (review F1). The upload is clamped to the buffer
    that owns the atlas.
  • Graphics set changes did not reach the GPU (review F4). Day / night /
    cave block sets reload into the same buffer; the GPU atlas is now invalidated
    on every reload.
  • 1024 texel sky repeated every 256 texels (review F5). The column steps
    are accumulated modulo the texture size, like the software renderer. Sky rows
    are bit-identical to the software renderer at several roll angles.
  • Sprite atlas lookups could read the neighbouring entry (review F3) for
    strongly minified, rolled sprites. Lookups are clamped to the sprite's entry.
  • Distant creatures rendered beige and showed through terrain at view
    distance 3 and 4. The sprite fog shade overflowed 32 bits once the fog band
    was widened; the GPU rejected those sprites and the CPU drew them with a
    garbage shade. Computed in 64 bits now; every sprite handed back to the CPU
    is logged as a defect.
  • Mana spheres kept a stale owner colour. The sprite index that encodes
    owner colour and size was refreshed only while a sphere moved; a resting
    sphere kept its old colour after an owner change while balloons of the real
    owner collected it. Refreshed once per tick now.

Changed

  • Distance fog scales with the view distance. The original fades from 15
    to 19 tiles of a 20 tile range; at view distance 4 the band had shrunk to one
    tile right at the cut-off and the landscape popped in. Configurable via
    gameDetail.fogStartFraction (0.75) and gameDetail.fogEndFraction (0.95);
    bit-identical to the original at view distance 1.
  • F12 switches the terrain and sky texture set (CD 32 px / high-res
    128 px) at run time. Sprites keep the set they were loaded with.

Known open issues

  • Fogged sprites can render too dark on the GPU; cause not yet isolated.
  • Gouraud shaded terrain deviates from the software renderer in some levels.
  • Review findings F2, F6, F7 and F8 are open (CPU fallback draw order, colour
    index 0 as "not drawn", transparent UI blending against the cleared
    viewport, 8-bit warp history). See WHATSNEW.md and docs/GPU-RENDERER.md.

Installing

You need an existing Magic Carpet 2 HD installation. This download is the
executable only — no game data is included here and none ever will be. Install
Magic Carpet 2 HD
first (it needs the GOG edition or an original CD), then put remc2-gpu.exe in
the same folder as that installation's remc2.exe and start it instead of the
original. Starting remc2.exe again takes you back.

Want different settings for each? Copy config.json to config-gpu.json and
edit that one; it is read in preference when it sits next to the executable.

SHA-256 of remc2-gpu.exe: 371514D95A4048C06B1A858695D24E252729CEE61599EDCCE6F66AEFC6FE9453

Reloaded fork 0.8.1 - GPU renderer on by default

Choose a tag to compare

@SputnikKaputtnik SputnikKaputtnik released this 12 Aug 16:27

Bug fix release. Use this instead of 0.8 — that build ran the software
renderer unless you edited JSON by hand.

What was wrong

Every gpu* setting defaulted to false, and the config.json that
remc2-gpu.exe sits next to belongs to the base project and carries none of
those keys. So dropping the executable into an existing installation and
starting it gave you the old renderer at whatever resolution was configured —
11 fps at 2560x2560, with nothing in the interface to explain why.

What changed

  • The GPU stages default to on. This build exists for them. Each stage still
    steps aside on its own when the hardware cannot take it, and writing a key
    explicitly still wins.
  • config-gpu.json is read in preference to config.json when it sits next
    to the executable. Both executables otherwise share one file, and therefore
    one resolution; this lets them keep separate settings without touching the
    base project's configuration.

Verified with a config.json containing no gpu* keys at all: all four stages
report themselves enabled and the world pass runs on the GPU at 0.468 ms per
frame. With a config-gpu.json beside it, that file's settings are the ones
that take effect.

Installing

You need an existing Magic Carpet 2 HD installation. This download is the
executable only — no game data is included here and none ever will be. Install
Magic Carpet 2 HD
first (it needs the GOG edition or an original CD), then put remc2-gpu.exe in
the same folder as that installation's remc2.exe and start it instead of the
original.

That is all. Nothing is overwritten, nothing needs editing, and starting
remc2.exe again takes you back.

Want different settings for each — a higher resolution for the GPU renderer, for
instance? Copy config.json to config-gpu.json and edit that one.

What it does

  • Direct3D 11 world renderer — terrain, world sprites and sky on the GPU
  • Exact draw order between terrain and sprites, and exact destination
    blending
    (translucent water, shadows) through rasterizer ordered views
  • Roughly 30x less CPU time per world frame — 11.85 ms → 0.40 ms at 1280x720
  • The exit warp keeps its frame rate — it used to drop the world onto the
    software rasteriser, 60 fps → 3.5 at 4K
  • View distance up to 4x (Shift+F11) and a frame rate counter (Shift+F12)

Measurements, method and known limitations: docs/GPU-RENDERER.md

Requirements

Windows with Direct3D 11. gpuSky and the exact blend modes want feature level
11_1 hardware — in practice anything from roughly 2013 on. The SDL2 libraries and
the Visual C++ runtime come with the Magic Carpet 2 HD installation, so nothing
else is needed here.

The binary is not code signed, so Windows SmartScreen will warn about an
unknown publisher. Verify it instead:

SHA256  9846FA8E011933AD165881B0F75ACB907032E26B2E84C08A7DD81B3996BBE98A

Or build it yourself — the source is this repository.

Credit where it belongs

This fork only adds a renderer. Magic Carpet 2 is Bullfrog Productions (1995);
turican0 reverse engineered it into C/C++; and
thobbsinteractive and contributors
built the HD project this branches from — resolution support, modern controls,
sound, the configurator, the installer and multiplayer are all their work.

The code in this fork was written with Claude Code.