
Create Optimized Trains
Create Optimized Trains — Performance optimization addon for Create Mod trains.
- Загрузки
- 3K
- Подписчики
- 5
- Обновлён
- 6 июля 2026 г.
- Лицензия
- MIT
Опубликован 4 апреля 2026 г.
🚅⚡Create Optimized Trains
Performance optimization addon for Create Mod trains (Forge 1.20.1).
🔗Dependencies
This mod requires Create or Create Fabric.
- Minecraft 1.20.1
- Forge 47.1.33+
- Create Mod 6.0.8+
- Flywheel 1.0.6+ (bundled with Create)
📦Features
1. LOD (Level of Detail) for Trains
- FULL — Real carriages with full physics (player nearby)
- MEDIUM — Simplified physics, normal rendering
- LOW — No physics, no collisions, minimal contraption updates
- GHOST — Ghost entity, no rendering, abstract data only
2. Carriage Grouping / Abstraction
- Merges multiple carriages into a single logical entity (
TrainGroup) - Stores only: length, speed, position, carriage list as NBT
- Expands back when the player approaches
3. Safe Multi-threading
Secondary thread (safe):
- Route calculation
- Collision prediction
- Schedule optimization
- Priority management
- LOD decisions
- Predictive simulation
Main thread (required):
- Actual entity movement
- Create physics
- Rendering
- Block interaction
4. Tick Throttling (Partial Updates)
- FULL: every tick
- MEDIUM: every 3 ticks (configurable)
- LOW: every 8 ticks
- GHOST: every 20 ticks
5. Render Optimization
- Disables animations for distant trains
- Skips full rendering for GHOST LOD
- Reduces particles and visual effects
- Hides internal details when not visible
6. Proxy Entities
- Lightweight entity representing the entire train
- Replaces dozens of contraptions
- Keeps position, speed and direction
- Recreates real carriages when needed
7. Smart Chunk Loading Management
- Loads only essential chunks
- Unloads chunks behind the train earlier
- Pre-loads chunks ahead
- Anti-thrashing (prevents repeated load/unload cycles)
8. Physics Optimization
- Simplified physics for distant carriages
- Disables collisions between carriages at low LOD
- Reduces bogie checks
- Disables internal contraption physics when far away
9. Networking Optimization
- Sends updates only when speed/direction changes
- Batches packets (delta compression)
- Reduces sync frequency for distant trains
10. Priority System
- Priority by type (EXPRESS > PASSENGER > FREIGHT > LOW)
- Conflict resolution at junctions
- Track segment reservation
- Async conflict analysis
11. Dynamic Performance Monitor
- NORMAL (TPS >= 18): full fidelity
- DEGRADED (15 <= TPS < 18): light optimizations
- CRITICAL (TPS < 15): aggressive optimizations, reduced LOD distances
🏅 Technical Performance Certificate
Create Optimized Trains has undergone a series of internal and community tests, including:
Stress Tests
- Trains over 300 blocks long
- Simultaneous moving contraptions
- Rendering with hundreds of entities
- Worlds with aggressive preloading
Compatibility Tests
- Create
- Steam ’n’ Rails
- Embeddium
- Radium
- Copycats+
- Distant Horizons
Community Testing
Pre-release versions were made available on the official Discord, ensuring that every public update is stable and free of regressions.
⚙️Configuration
File: create_optimized_trains-common.toml
All features are individually configurable with distances, intervals and toggles.
🪄Backported Fixes from Create 6.0.9+
Create 6.0.9 (for Minecraft 1.21.1) introduced several important fixes that were never backported to 1.20.1. Since 1.20.1 is no longer receiving updates from the Create team, this mod backports the following fixes for users staying on 1.20.1:
Contraption Collision Box GC Pressure (#6902)
Original problem: When train doors open/close at a station, gatherBBsOffThread() combines ALL block collision shapes into a single VoxelShape using Shapes.joinUnoptimized() — an O(n²) operation that creates massive temporary objects. The garbage collector can't keep up, causing lag spikes of 1-30+ seconds depending on train complexity.
Our fix: ContraptionCollisionMixin replaces the collision gathering algorithm with the same O(n) approach used in Create 6.0.9 (commit 8f30c2c). Instead of joining VoxelShapes, it collects AABBs directly from each block's collision shape — no intermediate allocations, no GC pressure. Also includes related duplicates: #4607, #5685, #9026, #9389.
Train Stutter from carriageWaitingForChunks
Original problem: In Train.tick(), when a carriage enters an unloaded chunk, Create sets carriageWaitingForChunks which forces speed = 0 until the chunk finishes loading. On maps with many trains and limited view distance, this causes 0.5-1.5 second freezes every time a train crosses a chunk boundary.
Our fix: TrainMixin redirects all reads of carriageWaitingForChunks in tick() to always return -1, so speed is never zeroed. Combined with the Smart Chunk Loading system (pre-loading chunks ahead of the train), trains move continuously without stutter.
Collision Check Performance
Original problem: collideWithOtherTrains() runs every tick for every train, which becomes expensive on maps with 20+ trains.
Our fix: TrainMixin throttles collision checks adaptively based on server performance — every 4 ticks normally, every 8 when degraded, every 12 when critical. Each train's check is offset by its UUID hash to distribute the load evenly across ticks.
💚About us
Publisher: GreenToastSoftware Games® (C)GreenToastSoftware Corporation. All rights reserved 2020-2026.
Ченджлог
1.3.1Бета1.20.4, 1.20.5, 1.20.6 · 6 июля 2026 г.
v1.3.1
Focus
- Movement smoothness, simulation distance, LOD chunk radius, and rendering correctness
- Rendering fixes target entity visibility and depth layering with Oculus/Embeddium + Flywheel OIT
- Chunk loading and directional filtering improved for smoother train travel
- Distant Horizons compatibility groundwork added
New Features
Train Simulation Distance
- New
simulationconfig section:simulationDistance(0–128 chunks) extends the directional chunk lookahead beyond the previous hardcoded 10-chunk limit maxForcedChunks(20–400): configurable global cap for force-loaded chunks- Designed for use with Distant Horizons for smooth far-train visibility
Per-LOD Carriage Chunk Radius
- New
lod_radiusconfig section:radiusFull,radiusMedium,radiusLow,radiusGhost - Load a larger or smaller chunk area around carriages depending on their LOD level
- Replaces the single
CARRIAGE_CHUNK_RADIUSoption with fine-grained per-LOD control
Distant Horizons Compatibility
- Added
DistantHorizonsCompatto detect DH and coordinate chunk loading so the two systems do not conflict - Added
ShaderCompatfor lightweight detection of active shader packs (used by LOD and render decisions)
Player Train Tracker
- Added
PlayerTrainTrackerutility to track which players are currently riding which trains - Used by chunk loading and LOD systems for proximity-aware decisions
Improvements
Movement Smoothness
- Chunk boundary grace period is now adaptive: 5 ticks while moving, 20 ticks while stopped
- Eliminates JourneyMap position lag and entity freeze at chunk boundaries
ContraptionTickThrottleMixinadded to throttletickContraption()safely without visual desync
Chunk Loading
ChunkMapMixin: added a 5-chunk minimum radius — directional filtering is now disabled entirely when the player is close to the train, preventing nearby chunks from being skippedChunkLoadManager: global forced-chunk cap increased from 30 to 60; lookahead cap increased from 6 to 10TrainEventHandler: startup delay reduced from 100 to 40 ticks; ramp-up batch increased from 2 to 5DirectionalChunkShaper: direction response made faster (smooth factor 0.3 → 0.5)- Default
sideChunksincreased from 3 to 5 inModConfig
LOD System
- LOD distances restored to v1.2.0 baseline (
shaderLodShiftdefault back to 0) - Fixed
resolveCarriagePositionto usepositionAnchoras a fallback when a carriage entity is not yet available shouldAnimatenow allowsLOWLOD to animate; onlyGHOSTskips animationshouldSkipRenderthreshold lowered from 40 to 20 FPS
Rendering Performance
- Removed Flywheel frame skipping from
RenderOptimizer— positions now update every frame, eliminating position drift under load CarriageRendererMixin: culling distance increased from 256 to 512 blocks
Bug Fixes
Camera Shake
- Removed the
isActiveChunkOrLoadedInManageRedirect that was causing camera shake when sitting in a moving carriage
Visual Throttle
- Added
NEAR_VISUAL_SKIP_RADIUS_SQproximity guard so the visual throttle never fires for trains near the player/camera
Collision Throttle Intervals
TrainMixin: reduced collision throttle tick intervals from 4/8/12 to 2/4/8, making collisions more responsive
Chunk Grace Periods
CarriageMixin: chunk grace period reduced from 60 to 20 ticksCarriageEntityMixin: bind grace period reduced from 40 to 15 ticks
Entity Visibility Through Contraption Glass (Oculus/Embeddium)
- Entities were invisible when viewed through glass blocks on contraptions (trains with glass windows/doors)
- Root cause: Flywheel's OIT pipeline writes its glass composite to the
itemEntityTargetFBO. With Oculus, entity rendering is deferred intoFullyBufferedMultiBufferSource— entities were not in the framebuffer whencomposite()ran - Fix: inject a flush of the Iris/Oculus batched entity source at
popPush("blockentities")(priority 500, before Flywheel's priority 1000 hook), so entities are in the framebuffer when OIT composites the glass tint
Copycats+ Door Not Following Camera
- Animated doors from Copycats+ were moving with the camera when mounted in a contraption
- Root cause:
translucentMovingBlockwas routed throughbufferSource(), which Oculus replaces withFullyBufferedMultiBufferSource. The Iris source is flushed at a different time, causing the door geometry to be drawn relative to camera movement - Fix:
ContraptionBufferSourceWrappernow routestranslucentMovingBlocktoBufferSourceResolver.getRawMainBufferSource()— the vanilla rawBufferSourcenot replaced by Oculus — avoiding the infinite recursion that the Oculus getter substitution would otherwise cause
Entity Ghost / Wrong Layer Effect
- Entities appeared ghost-like or at the wrong depth layer relative to block entities rendered after them
- Root cause: the early entity flush was using
depthMask(false), so entities did not write their own depth to the main FBO. Block entities rendered after Flywheel's OIT hook would pass the depth test where they shouldn't, appearing on top of entities - Fix: removed
depthMask(false)from the entity flush — entities now write correct depth, giving proper layering
Copycats+ Door Wrong Depth Layer
- With the entity flush corrected, the door remained at the wrong layer relative to contraption solid blocks
- Root cause: the door was flushed with
depthMask(false)before OIT, then OITprepare()overwrote the item entity FBO depth — the door had no depth information when Iris compositeditemEntityTargetonto the main FBO - Fix: the door is now flushed by
OitFramebufferMixinat@HEADofcomposite()(withdepthMask(true)by default) and byLevelRendererPostFlywheelMixin(priority 1500) as a fallback when no OIT is active
Entities Invisible Through Copycats+ Door + Glass Combination
- When a contraption had both Copycats+ doors and glass blocks, all entities seen through the door were invisible
- Root cause: flushing the door to
ITEM_ENTITY_TARGETbeforeprepare()withdepthMask(true)wrote door depth into the item entity FBO, interfering with the shared depth texture between the OIT FBO and item entity FBO - Fix:
OitFramebufferMixin @HEADflush fires afterprepare()has already run, so the item entity FBO depth is clean before the door writes its own depth
Technical Details (Rendering)
- Added
BufferSourceResolver(reflection-based) to accessRenderBuffers.f_110094_directly, bypassing the Oculus getter substitution - Added
ContraptionBufferSourceWrapperto centralisetranslucentMovingBlockandtranslucentrerouting during contraption render - Added
FullyBufferedMultiBufferSourceMixin(@Pseudo) targeting bothnet.irisshadersandnet.coderbotnamespaces OitDepthMixin: cancelsrenderDepthFromTransmittance()to prevent Flywheel OIT from writing synthetic glass depthsoit_composite_fix.jscoremod: patchesOitFramebuffer.composite()fromdepthMask(true)todepthMask(false)
Configuration
New config sections in create_optimized_trains-common.toml:
[simulation]—simulationDistance,maxForcedChunks[lod_radius]—radiusFull,radiusMedium,radiusLow,radiusGhostsideChunksdefault changed from 3 to 5shaderLodShiftdefault restored to 0
Thank you so much to all of you for making this mod a success! And let's keep growing!
1.3.0Бета1.20.4, 1.20.5, 1.20.6 · 12 мая 2026 г.
v1.3.0
Focus
- Stability-first release focused on fixing regressions introduced after v1.2.0
- Restores smooth train behavior under real gameplay load (multiple trains, stations, chunk boundaries)
- Keeps most aggressive optimizations optional behind config flags
Improvements
Movement and Physics Stability
- Added player proximity guards so nearby trains keep full physics/collision updates
- Aggressive throttling for other trains is now optional (
AGGRESSIVE_OTHER_TRAINS_THROTTLE), default OFF - Client-side
tickContraption()throttling is blocked to avoid visual desync and “entry-state freeze”
Chunk Loading and Spawn Smoothness
- Startup grace period added to chunk filtering in
ChunkMapMixinto avoid missing chunks on world join - Chunk force-load pipeline now uses per-train rate limiting to reduce tick spikes when new trains appear
- Prioritizes immediate carriage chunks before lookahead/trailing chunks
- Added trailing buffer logic based on train length so rear carriages stay stable on long consists
LOD Consistency
- Fixed LOD classification bug where
lowDistancewas not being applied correctly - Removed dynamic TPS-based shrinking of LOD distances (distance thresholds are now stable)
- Restored effective LOD behavior to v1.2.0 profile (no extra client-side shader LOD shift)
- Added fallback distance source (
positionAnchor) when a carriage entity is not yet available
Bug Fixes
Camera Shake While Sitting in Carriages
- Root cause addressed by preventing premature carriage entity creation in non-entity-ticking chunks
- Added priority chunk loading for carriages with player passengers to stabilize seat/camera sync
Trains Appearing as Distant LOD While Nearby
- Fixed client visual throttle path to never apply near the player/camera
- Nearby stationary trains no longer look choppy or “far LOD” when standing next to them
Visual and Flywheel Regressions
CarriageContraptionVisualMixinbegin-frame flow aligned with safer behavior (no incorrect skip path for moving trains)- Removed problematic skip conditions that could freeze or under-update visuals
Configuration
New/updated behavior in create_optimized_trains-common.toml:
AGGRESSIVE_OTHER_TRAINS_THROTTLE(default:false)GROUPING_ENABLEDdefault changed tofalse(experimental)PROXY_ENABLEDdefault changed tofalse(experimental)SHADER_BOOST_ENABLEDdefault changed tofalseSHADER_LOD_SHIFTdefault changed to0
Notes
- Recommended migration from older configs: review existing
.tomlvalues, because existing files keep old values instead of new defaults - This release is tuned for predictable behavior first; re-enable aggressive options only if needed per world/server
Dependencies
- Minecraft 1.20.1
- Forge 47.4.16+
- Create Mod 6.0.8+
- Flywheel 1.0.5 (JiJ'd inside Create)
- Mixin 0.8.5
1.2.0Бета1.20.4, 1.20.5, 1.20.6 · 13 апреля 2026 г.
v1.2.0
New Features
Route Chunk Preloader
- New chunk preloading system along the railway route using Create's track graph
- Uses
getChunkFuture(FULL)to load chunks into memory without force-loading (no entity-ticking) - Dedicated
COT-RouteChunkPreloaderthread to avoid blocking the server tick - ~256 block lookahead, maximum of 24 chunks per train
Directional Chunk Loading
ChunkMapMixinfilters new chunks sent to the client when the player is riding a train- Lateral chunks outside the directional area are not loaded (front/back have priority)
DirectionalChunkShapertracks players on trains and calculates direction with EMA smoothing- Compatible with Distant Horizons — DH uses its own LOD system independently
Player Proximity Buffer
updatePlayerProximityBuffer()preloads chunks in the buffer zone (view distance + 1~3 chunks)- Carriage entities are created and positioned BEFORE the player can see them
- Result: trains appear fully positioned with no ghost/stutter
Position Snap (Client)
CarriageEntityClientMixinforcesxo=x, yo=y, zo=zfor the first 5 ticks after spawn- Prevents visual interpolation/sliding when carriage entities are created
F3 Debug Overlay
- COT information on the F3 screen: memory, threads (pool/active/queued), TPS/MSPT/Peak, state/factor, FPS, chunks forced/route-cached
- JVM thread count cached every ~1s to prevent flickering
- Can be disabled via
DEBUG_OVERLAY_ENABLEDconfig
Safe Train Tick Protection
SafeTrainTickMixinwrapstrain.earlyTick()in a try-catch insideGlobalRailwayManager.tickTrains()- If an external mod (e.g. RailX) crashes during a train's tick, the train skips the tick instead of crashing the server
- Logging limited to 3 warnings per train to avoid spam
- Prevents crash loops that block worlds from loading
Improvements
Chunk Load Manager
- Directional lookahead based on real train movement (deltaMovement + fallback to position delta)
- Adaptive lookahead capped at 6 chunks (entity-ticking is CPU-expensive)
- Side chunks (for curves) only for the 3 nearest chunks
getCarriagePosition()usesDimensionalCarriageEntity.positionAnchoras fallback for carriages without entities- Anti-thrashing with 12-chunk recent history
Render Optimization
- LOD-based render skipping by distance (>256 blocks = culling)
- Flywheel update skipping for distant trains (LOD > MEDIUM)
- Per-train visibility tracking for LOD decisions
getClientFPS()cached every 30 frames
LOD System
- Buffer zone: trains approaching the player forced to LOD FULL
- Temporal hysteresis (500ms minimum between LOD changes) to prevent flip-flop
- Player position caching for thread-safe calculations
- Distances adjustable by the Performance Monitor
Bug Fixes
Invisible Trains (Critical)
- Cause: Fade-out system marked all distant trains as "departing" on world load →
getDepartureScale()returned -1 after 12 frames → renderer permanently skipped them - Fix: Fade-out system completely removed.
getDepartureScale()always returns 1.0f,startFadeOut()is a no-op,isFadingOut()returns false
Inflated Chunk Tracking (Critical)
- Cause:
trainChunks.put(trainId, needed)stored ALL "needed" chunks even when the global cap (30) blocked force-loading →getLoadedChunkCount()inflated (reached 196) → cap blocked everything → trains without entity-ticking → movement stuttering - Fix:
trainChunksnow only stores chunks actually forced on the server. Cap calculation uses exact count:otherTrainsCount + actuallyForced.size()
OOM from Forced Chunk Leak
- Cause:
RouteChunkPreloaderusedsetChunkForced()instead of just loading into memory → forced chunks accumulated without limit - Fix: Replaced with
getChunkFuture(FULL)— loads chunks into memory without force-loading
RejectedExecutionException
- Added
isShutdown()guards inAsyncTaskManagerbefore submitting tasks - Prevents crash during server shutdown
World Stuck at 100%
- Cause: Global startup delay blocked all Create systems
- Fix: Delay now applies only to chunk operations, not to the general tick
Configuration
New options in create_optimized_trains-common.toml:
DEBUG_OVERLAY_ENABLED— Show F3 overlay (default: true)DIRECTIONAL_CHUNK_LOADING— Directional chunk loading (default: true)DIRECTIONAL_FORWARD_CHUNKS— Forward chunks (default: 12)DIRECTIONAL_BACKWARD_CHUNKS— Backward chunks (default: 4)DIRECTIONAL_SIDE_CHUNKS— Side chunks (default: 5)CHUNK_LOOKAHEAD— Base lookahead chunks (default: 3)
Mixins
Server (7)
TrainMixin— carriageWaitingForChunks bypass + collision throttlingSafeTrainTickMixin— try-catch protection on earlyTickCarriageMixin— 60-tick grace period for chunksCarriageEntityMixin— isActiveChunk always trueDimensionalCarriageEntityMixin— isActiveChunk always trueContraptionCollisionMixin— Collision throttlingChunkMapMixin— Directional chunk filtering
Client (7)
CarriageRendererMixin— Render skipping by LOD/distanceCarriageContraptionVisualMixin— Flywheel update skipping by LODCarriageEntityClientMixin— Position snap for first 5 ticksContraptionEntityRendererMixin— Render optimizationContraptionVisualMaterialMixin— Material optimizationLevelRendererFlushMixin— Flush optimizationOitDepthMixin— Depth sorting fix
Dependencies
- Minecraft 1.20.1
- Forge 47.4.16+
- Create Mod 6.0.8+
- Flywheel 1.0.5 (JiJ'd inside Create)
- Mixin 0.8.5
1.0.0Бета1.20.1 · 4 апреля 2026 г.
Create Optimized Trains
Performance optimization addon for Create Mod trains (Forge 1.20.1).
Features
1. LOD (Level of Detail) for Trains
- FULL — Real carriages with full physics (player nearby)
- MEDIUM — Simplified physics, normal rendering
- LOW — No physics, no collisions, minimal contraption updates
- GHOST — Ghost entity, no rendering, abstract data only
2. Carriage Grouping / Abstraction
- Merges multiple carriages into a single logical entity (
TrainGroup) - Stores only: length, speed, position, carriage list as NBT
- Expands back when the player approaches
3. Safe Multi-threading
Secondary thread (safe):
- Route calculation
- Collision prediction
- Schedule optimization
- Priority management
- LOD decisions
- Predictive simulation
Main thread (required):
- Actual entity movement
- Create physics
- Rendering
- Block interaction
4. Tick Throttling (Partial Updates)
- FULL: every tick
- MEDIUM: every 3 ticks (configurable)
- LOW: every 8 ticks
- GHOST: every 20 ticks
5. Render Optimization
- Disables animations for distant trains
- Skips full rendering for GHOST LOD
- Reduces particles and visual effects
- Hides internal details when not visible
6. Proxy Entities
- Lightweight entity representing the entire train
- Replaces dozens of contraptions
- Keeps position, speed and direction
- Recreates real carriages when needed
7. Smart Chunk Loading Management
- Loads only essential chunks
- Unloads chunks behind the train earlier
- Pre-loads chunks ahead
- Anti-thrashing (prevents repeated load/unload cycles)
8. Physics Optimization
- Simplified physics for distant carriages
- Disables collisions between carriages at low LOD
- Reduces bogie checks
- Disables internal contraption physics when far away
9. Networking Optimization
- Sends updates only when speed/direction changes
- Batches packets (delta compression)
- Reduces sync frequency for distant trains
10. Priority System
- Priority by type (EXPRESS > PASSENGER > FREIGHT > LOW)
- Conflict resolution at junctions
- Track segment reservation
- Async conflict analysis
11. Dynamic Performance Monitor
- NORMAL (TPS >= 18): full fidelity
- DEGRADED (15 <= TPS < 18): light optimizations
- CRITICAL (TPS < 15): aggressive optimizations, reduced LOD distances
Configuration
File: create_optimized_trains-common.toml
All features are individually configurable with distances, intervals and toggles.
Dependencies
- Minecraft 1.20.1
- Forge 47.1.33+
- Create Mod 6.0.8+
- Flywheel 1.0.6+ (bundled with Create)
Комментарии
Загружаем…