Skip to content

Randomno/UnityRNGTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

An implementation of Unity's random number generator to aid in making TASs.

Also implements libTAS's fake /dev/urandom, if running outside of libTAS.

Based on version 2020.3.48f1. Other versions should be the same or similar.

TODO

  • Reversing tools
  • Easy libTAS system time -> equivalent InitState value (or vice versa)
  • command line functionality?

Usage

unity_rng [system time]

Currently, it only sets the initial RNG state and doesn't do anything, but you could insert calls to Random functions inside main().

For example:

int main(int argc, char* argv[]){

    if (argc > 1){
        prng_state = atoi(argv[1]);
    }

    InitScriptingRand();

    // insert calls here
    printf("Random int: %i\n", RandomRangeInt(1,101));

    close(urandom_fd);

    return 0;
}

Will print 59, which matches what a Unity program with Random.Range(1, 101) would output given a system time of 1 in libTAS.

See also

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages