Releases: indiesoftby/defold-splitmix64
Releases · indiesoftby/defold-splitmix64
2.2.0
What's Changed
- Added lua annotation file by @NaakkaDev
2.1.0
What's Changed
- Add
shufflefunction - for shuffling of Lua tables.
Reference Implementations
The implementations/** directory contains reference implementations of the SplitMix64 algorithm for other languages:
- C99
- Python 3
- TypeScript
These implementations produce identical random number sequences for the same seeds, which makes them suitable for networked multiplayer games that rely on deterministic PRNG state. By seeding all clients with the same value, you can guarantee consistent simulation results across platforms and languages!
2.0.0
What's Changed
New API
splitmix64.toss()- Returns 0 or 1 (coin flip).splitmix64.dice(roll, type)- Rolls one or more dice of the given type. Returns a table of individual rolls and the total sum. Dice types:splitmix64.D4,splitmix64.D6,splitmix64.D8,splitmix64.D10,splitmix64.D12,splitmix64.D20,splitmix64.D100.splitmix64.randomchoice(t)- Returns a random element from arrayt. Raises an error if the array is empty.splitmix64.weightedchoice(t)- Returns a random key from tabletwhere values are weights. Keys are sorted deterministically (numbers first, then strings) for reproducibility. Raises an error if weights are invalid.splitmix64.state()- Returns the current internal state as a string for save/restore or full 64-bit precision.- ✨
splitmix64.new_instance([seed])- Creates a new RNG instance with isolated state. Optionalseed(number or string) for reproducibility. Instance has the same methods as the global module:random,randomseed,state,randomchoice,weightedchoice,toss,dice.
Changes to Existing API
splitmix64.randomseed(x)- Now acceptsnumberorstring(decimal uint64) for full 64-bit precision. Lua doubles cannot represent all uint64 values.
Compatibility fix
1.0.1 Update main.cpp
First release
1.0.0 Update README.md