Skip to content

Crossbridge lua swc random library desyncs between Flash and Ruffle #23488

@ThePizza1k

Description

@ThePizza1k

Describe the bug

Use random.new(seed) on flash and ruffle to create an RNG object.
Observe that subsequent rng.random() calls generate a different sequence.

Image

Expected behavior

They should generate an identical sequence

Content Location

https://github.com/PlatformRacing3/crossbridge-swc-lua/releases/download/v0.4.0/Main.swf

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

This same bug causes desyncs on some Platform Racing 3 levels, since they rely on the same seed generating the same sequence between clients.

The culprit(s) are the two unsigned long long multiplications in the splitmix64 function in this file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions