#What RNG algorithm does GameMaker use?

1 messages · Page 1 of 1 (latest)

topaz bison
#

Hello, I want to recreate RNG functions like irandom_range outside of GameMaker. Is it known what algorithm is used within the engine? I care specifically about the Windows target.

left sedge
#

#programming message

#

straight from russel's mouth

#

or i guess, fingers

topaz bison
#

okay, it looks like it's also mentioned in the GameMaker-HTML5 repo

#

i tried to copy the algorithm from there but it gives a different result

#

i guess i did something wrong

#

either way, thanks

topaz bison
#

okay it's actually kinda hard to figure out

light quiver
#

Oh wait outside of GameMaker

#

Yeah it’s just WELL512

topaz bison
#

Sure but what is the state initialised to?

#

And how does for example the irandom_range function work

light quiver
#

You're asking about specifics which you would not really get told of, outside of what the HTML5 repo offers

left sedge
#

so is the rng seed, with randomize()

topaz bison
#

is it the same though?

light quiver
#

Since it’s the HTML5 target, probably not

topaz bison
#

yeah so it's kinda useless

#

i also tested the JS code directly

#

and it gives a different result

light quiver
#

Honestly, what is the reason for wanting to recreate 1:1 GameMakers RNG system elsewhere? Why isn’t just going by WELL512 good enough?

topaz bison
#

it would allow me to predict random events in gamemaker games

light quiver
#

I mean, GameMaker could work without having to recreate entire mechanisms. 🤔

topaz bison
#

i guess

#

but that's a bit dumb

light quiver
#

No?

#

Like, you already have an entire engine that works perfectly for all other existing games. There is virtually no good reason to reinvent the wheel just to "predict random events".

topaz bison
#

i just need to recreate like 4 functions

#

i don't want a whole engine

light quiver
#

I don't see any reason why, GameMaker isn't that big

#

And once you make an executable, it's not so bad either

topaz bison
#

well okay that is probably a dewcent way of doing things

#

but it's not like doing this at all is very much needed

#

and i think recreating the RNG in C or some other sane language is more fun

light quiver
#

Look, outside of telling you the algorithm and pointing at the HTML5 repo for at least some structure

#

There isn't really much else you're going to get

#

The exact specifics of how the code or implementation is done in the C++ side of things, isn't going to happen

#

No one here is going to be able to explain that

topaz bison
#

yeah i know, it's really annoying

#

that's why open source is better

light quiver
#

Eh, not always

#

FOSS doesn't pay bills

#

Not always

topaz bison
#

i mean

#

there could be an option to pay in order to get the source code

#

or something like that

light quiver
#

I mean, that's called source available

#

And that is an option

topaz bison
#

there are many options

#

either way it's probably really hard to reverse engineer the rng

light quiver
#

FOSS isn't the same as source available, and you're not only tied to NDAs, but also can't legally redistribute the code... You can look at it and work with it.

#

But I cannot really speak much more on the legality on that

#

But as I've said, that is an option

topaz bison
light quiver
#

If you can spare $75 USD/month

light quiver
#

I've said it twice

#

It is source available, already

#

Per month

#

For $75 USD

#

It's under GameMaker Enterprise

topaz bison
#

that's great

light quiver
light quiver
#

Which the only thing you'd have to deal with is downloading the runtime you care about, and then build a barebones project. (Even I could just whip up a barebones project).
Or there is an existing GML interpreter + CLI program that exists out there, made in GameMaker.

#

Either way, the path of least pain, is just using GameMaker. It does not hurt, and it's fast enough to build a lot of things with. Including to make predictions on random events.

topaz bison
#

yeah okay

#

there is also the option of decompiling gamemaker

#

i guess

#

but it's not something i am good at

#

i did manage to recreate RNG of another game

#

made in Unity

light quiver
#

I still don't think there is a huge need to recreate it for the purpose you intend, over just using GameMaker

#

Unless there's another reason you're hiding

topaz bison
#

Actually i think i found relevent functions using ghidra