Skip to content

Releases: indiesoftby/defold-splitmix64

2.2.0

09 Mar 12:30

Choose a tag to compare

What's Changed

2.1.0

25 Feb 10:24

Choose a tag to compare

What's Changed

  • Add shuffle function - 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

24 Feb 21:18

Choose a tag to compare

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 array t. Raises an error if the array is empty.
  • splitmix64.weightedchoice(t) - Returns a random key from table t where 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. Optional seed (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 accepts number or string (decimal uint64) for full 64-bit precision. Lua doubles cannot represent all uint64 values.

Compatibility fix

15 Feb 16:13
5f1d0b9

Choose a tag to compare

1.0.1

Update main.cpp

First release

01 Feb 15:39
8515ab8

Choose a tag to compare

1.0.0

Update README.md