• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

What is the algorithm used for GMS 2.x Random Number Generator?

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
If you have a HTML5 GM module, you may compile in debug mode and then inspect the generated code in JS debugger - the exact algorithm name is not known, but the state is 128-bit (IIRC) and there's a handful of bit operations involved, which puts it into "definitely not LCG" bracket.
 

Kruno

Member
Just as a precaution I have implemented PCG. I am writing simulations and this is mission critical for me. I have used poor RNG in the past and it cost me some serious time.
 

Yal

🐧 *penguin noises*
GMC Elder
Just as a side note, I've seen disclaimers thrown around that the same seed gives different sequences on different targets, so the HTML5 source might be different from the RNG used on desktop targets, and so on, so inspecting one target's source tells you nothing about the others, and if you want consistent set-seed RNG between different ports of your game, you can't rely on the built-in system. Not sure if this was unified in GMS2 or is still a valid caveat. Okay, GMS2 manual still has the disclaimer.
 

Kruno

Member
I don't mean to be annoying but does anyone know any more details? I am only concerned about GM:S 2 on the Desktop (win32).

Thanks.
 
Top