A zero-dependency, zero-allocation deterministic RNG suite for Unity. It guarantees identical random sequences across all platforms and CPUs, making it perfect for lockstep multiplayer and replays.This package consists entirely of pure C# logic and does not contain any materials, shaders, or rendering components. Therefore, it is completely independent of any rendering pipeline and works flawlessly out-of-the-box with Built-in, URP, and HDRP.When building lockstep netcode, replay systems, or server-authoritative logic, standard random utilities like UnityEngine.Random or System.Random cannot be used because their results vary between platforms and Unity versions. OSL Deterministic Core solves this problem by providing a pure .NET Standard 2.1 PRNG suite designed from the ground up for strict determinism and high performance.Key FeaturesDeterministic by Construction: Same seed produces identical sequences across all machines, platforms, and CPU architectures, eliminating desynchronization risks.Zero Allocations on Hot Paths: Performance-critical operations—including RNG advance, dice rolls, deck shuffling, and weighted gacha draws—never allocate managed memory.Integer-First Probability: To completely avoid floating-point drift across different CPUs, APIs like RollPermille and RollProbability utilize strict integer comparisons.Pluggable Gacha & Pity Systems: Includes weighted draw tables (OSLGachaTable) and flexible extension points for pity rules (IPitySystem), with built-in support for Unity ScriptableObjects and JSON serialization.Independent Sub-RNG Streams: Supports deriving multiple statistically independent sub-RNGs from a single master seed using different stream IDs, isolating subsystems so that modifying one roll sequence does not affect others.Package ContentCore Engine: IRandomEngine contract, PCG32 algorithm implementation, and the OSLRandom developer facade.Shuffling: OSLDeckShuffler for in-place, zero-allocation Fisher–Yates shuffling.Gacha & Pity: OSLGachaTable and SimpleHardPity for managed reward configurations.Combat: OSLCombatResolver for reliable dice rolls and integer-based probability checks.Lockstep Demo: A split-screen sample application that runs two independent simulations side-by-side with real-time state hash validation to instantly demonstrate sync integrity.Editor Tests: Comprehensive NUnit EditMode tests covering determinism, statistical distribution, state round-trips, and pity semantics.🔥 LAUNCH SALE: 50% OFF for the first 2 weeks! (Regular price: $15.99) 🔥Core SpecificationsRender Pipeline Compatibility: Fully compatible with Built-in, Universal Render Pipeline (URP), and High Definition Render Pipeline (HDRP) as it contains no rendering dependencies.Architecture: Interface-driven design utilizing pure C# implementations that isolate core RNG structures from platform-specific overhead.Requirements & DependenciesUnity Version: Unity 2021.3 or newer.Scripting Runtime: .NET Standard 2.1.Dependencies: Zero third-party dependencies and zero native plugins. It runs on pure, self-contained C# code.Security & Best PracticesFloating-Point Drift Avoidance: For production environments requiring cross-platform synchronization, utilize the integer-first APIs (RollPermille, RollProbability) rather than standard floating-point variables to completely eliminate CPU-level simulation drift.State Isolation: Use distinct stream IDs when deriving sub-RNGs for independent gameplay systems (e.g., combat, loot, AI). This ensures that adding or removing a random roll in one subsystem will not inadvertently alter the sequence or corrupt the state of another.SupportFor comprehensive setup guides, structural patterns, and full technical documentation, please visit our repository: https://ongsoolabs.github.io/.AI tools (Google Gemini) were used to assist in translating and formatting the official English documentation (README, Setup Guides), and to help troubleshoot and refine the C# scripts. No AI-generated art or assets are included.

