Skip to content

Features

Zaldaryon edited this page Jul 3, 2026 · 17 revisions

Features

Every optimization in Optimum v0.1.2. Each one produces identical gameplay to vanilla. The only observable difference is higher and steadier FPS.

Frame Timing

Precise Frame Pacing. Vanilla uses Thread.Sleep(1) for frame limiting, which overshoots by 1-15ms depending on the OS timer resolution. Optimum replaces this with a three-stage loop: sleep while far from target, yield when close, spin for the final microseconds. Frame times become consistent and micro-stutter disappears. Togglable in settings.

Background FPS Limiter. When the game window loses focus (alt-tab), Optimum caps the client at 30 FPS. The GPU and CPU drop to near-idle. Togglable in settings.

Rendering

Entity Shadow Distance Culling. Shadows for entities beyond a configurable distance (default 80 blocks) stop drawing. Shadow maps are expensive per-entity, and shadows beyond this range are invisible to the player. The distance slider in settings controls the threshold.

Shadow Far Vegetation Skip. The far shadow cascade renders vegetation (BlendNoCull pass) into a shadow map that covers terrain at extreme range. At that distance, foliage shadows contribute nothing visible. Optimum skips vegetation in the far cascade. Togglable in settings.

Dynamic Light Radius Scaling. The held-item dynamic light (torch, lantern) uses a fixed 120-block radius in vanilla. Optimum scales it to 35-60 blocks based on your view distance setting. A 120-block light sphere on a 64-block view distance wastes GPU time illuminating chunks that do not exist on screen.

Animated Block LOD. Block entities with animations (forges, querns, crucibles, mechanical components) update their animation at three distance tiers. Close blocks animate at full rate. Medium-distance blocks tick at half rate. Far blocks tick at quarter rate. The visual difference at distance is imperceptible, but the CPU cost of skeletal animation drops proportionally. Togglable in settings.

Chiseled Block LOD. Chiseled blocks carry full vertex meshes (up to 15,000 vertices per block for complex sculptures). Optimum uses the engine's native lodLevel system to render distant chiseled blocks as simplified geometry. Near blocks render at full detail. Far blocks drop to a solid cube. 83x vertex reduction for distant chiseled chunks in builds with heavy microblock use. Togglable in settings.

Entity Render Distance Pre-Cull. Before computing the model matrix, shader uniforms, and UBO joint copy for an entity, Optimum checks squared distance against view distance. Entities beyond range skip the render call entirely. At 200 loaded entities, this saves 6-15 microseconds per frame in the opaque render pass.

Name-Tag Frustum Reuse. Vanilla runs a frustum visibility check per HUD element per entity (name tag, health bar, debug info). Optimum reuses the entity.IsRendered flag set during the render pass instead of recomputing SphereInFrustum per entity per frame.

SSAO Bilateral Blur Tap Reduction. The SSAO blur shader runs 2-6 fullscreen passes per frame (depending on quality setting). Vanilla uses 11 taps per pixel per pass. Optimum drops the outer 4 taps (indices 0, 1, 9, 10) which contribute less than 4% of the gaussian weight. The remaining 7 taps are renormalized to sum to 1.0. This saves 8 texture reads per pass (4 depth + 4 color). On SSAO Quality 2 (6 passes/frame), that is 48 fewer texture reads per pixel per frame.

Water Foam Grid Reduction. Foam edge detection on water and lava surfaces uses a depth comparison grid. Vanilla samples a 5x5 area (25 depth reads per water fragment). Optimum shrinks this to 3x3 (9 reads). The foam edge is slightly sharper but visually indistinguishable in motion. In scenes with significant water coverage (ocean biomes, rivers), this saves millions of texture reads per frame.

Entity and Physics

Repulsion Distance Gate. Client-side entity repulsion physics (the force that prevents entities from overlapping) skips entities beyond a configurable range (default 64 blocks). Repulsion at that distance has zero visual impact because the entities are too small to see overlap. The distance slider in settings controls the threshold. Togglable.

Animation Check Reorder. Vanilla tests frustum visibility before testing distance for entity animation updates. Frustum intersection is more expensive than a distance squared comparison. Optimum reverses the order: test distance first, skip the frustum check if the entity is already too far. The result is identical (same entities get animated), the cost is lower.

Audio and Weather

Weather Wind Throttle. Wind calculations (used for grass/leaf sway, particle drift, ambient audio panning) run every frame in vanilla. Optimum caches the result and reuses it for 4 frames. Wind changes slowly enough that a 66ms stale value is imperceptible. Togglable in settings.

Particle Distance Gate. Particle emitters beyond 48 blocks stop spawning. At that range, individual particles are sub-pixel and invisible. Reduces CPU and GPU load in chunk-dense areas with many forges, campfires, and torches. Togglable in settings.

Ambient Sound Position Gate. When the player stands still, ambient sound source positions do not change. Vanilla recalculates them every frame regardless. Optimum skips the update when the player position delta is zero.

Fly Sound Volume Deduplication. The flight/glide sound adjusts volume based on velocity. Vanilla pushes a new volume value to the audio engine every frame. Optimum skips the update when the delta is below 1%. The audio engine cannot reproduce sub-1% volume differences through speakers.

Memory and GC

Server GC with DATAS. Optimum switches the client from Workstation GC to Server GC with Dynamic Adaptation To Application Sizes (DATAS). Server GC collects 73% fewer times and promotes zero objects to Gen1 under allocation pressure. DATAS prevents unbounded heap growth on machines with limited RAM. Mean throughput trades roughly 10% for reduced P99 frame spikes caused by Gen2 collections.

BlockPos Reuse in Particle Ticks. Ticking blocks spawn particles in a loop. Vanilla allocates a new BlockPos struct per particle per tick. Optimum reuses a single BlockPos instance across the loop, zeroing GC pressure from this path.

Mat4f.Multiply Inlining. Thirteen hot 4x4 matrix methods (Multiply, Translate, Scale, Rotate, etc.) carry [MethodImpl(AggressiveInlining)]. These methods run 50,000+ times per frame during entity rendering and mesh transforms. The inlining hint eliminates call/ret overhead and enables the JIT to fold the multiplication into the caller.

Lock Contention Reduction. Eleven client-side locks converted from object + Monitor.Enter to System.Threading.Lock (.NET 9+). This type avoids sync-block inflation and uses a single interlocked CAS on the uncontended path. Two boolean flag locks converted to Volatile.Read/Write (zero-cost on x64). Measured 0.16% reduction in Monitor.Enter_Slowpath under 50-entity load.

Shader Optimizations

Optimum ships modified GLSL shaders in assets/game/shaders/. These replace the vanilla shaders at deploy time. They produce identical visual output to vanilla (or output within rounding error) and have no runtime toggle.

  • bilateralblur.fsh + bilateralblur.vsh: 7-tap bilateral blur (vanilla: 11 taps)
  • chunkliquid.fsh: 3x3 foam grid (vanilla: 5x5)

Bugfixes

#9710: Mouse Wheel at Low Sensitivity. Vanilla casts the high-precision wheel delta to int before applying sensitivity. At sensitivity values below 1.0, the int truncation creates dead zones where scrolling does nothing. Optimum keeps the float precision through the full calculation chain.

#8874: Prospecting Dialog Mouse Capture. The prospecting results dialog registers mouse click handlers but does not deregister them when closed. After closing the dialog, clicks get consumed by the invisible handler. Optimum skips disabled composers in the GuiDialog bounds check.

#8901: Health Tooltip Decimal. The health tooltip formats max health as an integer, hiding the decimal. When max health is not a whole number (e.g. 14.5 from armor), the tooltip rounds down. Optimum shows the decimal.

Clone this wiki locally