promotional bannermobile promotional banner
premium banner
A high-performance replay mod. Record, replay & render with triple-buffered pipelines, GPU compute shaders, Zstd compression, async I/O, and native FFmpeg encoding.

Description

ReForgedPlay β€” Enhanced Replay Mod


Record. Replay. Render. Reimagined.

ReForgedPlay is a from-the-ground-up performance overhaul of the classic Replay Mod, rebuilt for Minecraft 1.21.1 on NeoForge. Every major subsystem has been redesigned with modern Java 21 features, GPU acceleration, and async architecture to deliver a dramatically faster, more reliable experience.


✨ Features

πŸŽ₯ Recording

  • Async Packet Writing β€” Lock-free, non-blocking packet capture using a dedicated writer thread. Recording no longer causes micro-stutters or frame drops, even on busy servers.
  • Zstd Compression β€” Optional Zstandard compression for replay files. 3–5Γ— faster decompression than deflate at equivalent compression ratios. Fully backward-compatible β€” old replays still load seamlessly.

🎬 Playback

  • Memory-Mapped Replay I/O β€” Replay files are loaded via memory-mapped file channels for near-instant random access. No more waiting for large replays to buffer into memory.
  • Chunked & Indexed Replay Format β€” Time-indexed chunks enable O(1) seeking to any point in a replay. Jump to any timestamp instantly instead of scanning from the start.
  • State Machine Architecture β€” Centralized lifecycle management with validated state transitions (Idle β†’ Recording β†’ Playing β†’ Rendering, etc.). Prevents illegal operations, simplifies error recovery, and provides full transition history for debugging.

🎞️ Rendering

  • Triple-Buffered Frame Pipeline β€” Overlaps three stages concurrently:
    • Stage 1 (GPU): Capture frame N+2
    • Stage 2 (CPU): Process frame N+1
    • Stage 3 (Encoder): Encode frame N
    • Result: Up to 3Γ— higher frame throughput compared to the original synchronous pipeline.
  • GPU Compute Shader Conversion β€” RGBA β†’ BGRA pixel format conversion and vertical flip performed entirely on the GPU via OpenGL 4.3 compute shaders. Falls back to CPU automatically on older hardware.
  • Parallel ODS Rendering β€” Omnidirectional stereo (360Β° VR) rendering uses a thread pool to parallelize equirectangular projection. Left and right eye captures overlap with processing for maximum throughput.
  • Native FFmpeg via Panama API β€” Direct function calls to libavcodec/libavformat through Java 21's Foreign Function & Memory API, enabling zero-copy frame passing and direct access to hardware encoders (NVENC, QSV, AMF). Falls back gracefully to the standard FFmpeg subprocess if native libraries aren't available.

🧠 Memory & Performance

  • Off-Heap Arena Buffer Pool β€” All render buffers are allocated off-heap with a fixed-size arena pool and semaphore-based backpressure. Eliminates GC pauses from the render path entirely.
  • Lock-Free Data Structures β€” LinkedTransferQueue, ConcurrentHashMap, and atomic operations replace synchronized blocks throughout the codebase.
  • Named Daemon Threads β€” All background threads are named and daemonized for clean shutdown and easy profiling.

πŸ“Š Performance Comparison

Metric ReForgedPlay My Mod Improvement
Frame Pipeline Synchronous Triple-buffered async ~3Γ— throughput
Pixel Conversion CPU single-thread GPU compute shader ~10Γ— faster
Replay Seeking Linear scan Indexed chunks O(n) β†’ O(1)
Packet Writing Blocking ExecutorService Lock-free async No frame drops
File I/O Stream-based Memory-mapped Near-instant access
Compression Deflate only Zstd + deflate fallback 3–5Γ— faster decompress
Buffer Allocation GC-managed SoftReference Off-heap arena pool Zero GC pauses
FFmpeg Encoding Subprocess pipe Native API (+ fallback) ~20–40% faster
ODS Rendering Sequential faces Parallel thread pool ~2Γ— faster
State Management Scattered flags Validated state machine No illegal states

πŸ”§ Technical Details

  • Minecraft Version: 1.21.1
  • Mod Loader: NeoForge 21.1.217
  • Java Version: 21+
  • API: Architectury Loom
  • Shader Requirements: OpenGL 4.3 for GPU compute (auto-fallback to CPU)
  • FFmpeg: Bundled Windows x64 binary β€” no manual install required
  • Compression: Zstd (via zstd-jni if present), deflate fallback

πŸ“¦ Installation

  1. Install NeoForge 21.1.217 for Minecraft 1.21.1
  2. Drop replaymodenhanced-1.21.1-1.0.0.jar into your mods/ folder
  3. Launch the game β€” no additional configuration needed

FFmpeg is bundled inside the jar β€” you do not need to install it separately.


πŸ›‘οΈ Compatibility

  • βœ… Iris / Oculus β€” Fully compatible with shader mods
  • βœ… Sodium / Embeddium β€” Works with performance mods
  • βœ… Old Replay Files β€” Backward-compatible; auto-detects compression format
  • βœ… Older GPUs β€” GPU compute features gracefully fall back to CPU if OpenGL 4.3 is not supported

Built for performance. Designed for reliability. Made for creators.

πŸ‘€ Credits