Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Question about random

Author
Message
haliop_New
User Banned
Posted: 17th May 2020 07:47
It says in the documents that if i set random seed at a real number of somekind no matter th device or how many times i will open the app it will show the same results.
Is that right? Is it gurenteed? Like for all devices?

The author of this post has marked a post as an answer.

Go to answer

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th May 2020 08:04
that's correct as random numbers aren't really random at all just a sequence of numbers
not so sure how that effects other platforms but should be fine. Seeding with a certain
number has been used for educational purposes this way as the lecturer can predict the
results

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
haliop_New
User Banned
Posted: 17th May 2020 08:34
Yes that is the exact thing i wanted to.know. especially with ed stuff.
So as far as we can tell,
If ill add like a sequence of an exact number for all android devices i should clarify that this sequence may not be the same for Ios, Windows, Mac and web.

I am wondering how could i create a random sequence for all devices without needing to "prebake" before releasing to all platforms.

One thing that comes to mind, is that the exact sequence maybe should stay on a server of somekind and download them at startup however this destroys my rule on web connectivity.

Thinking.
And thank you.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 18th May 2020 11:00 Edited at: 18th May 2020 11:03
This post has been marked by the post author as the answer.
This code produces the same list of random numbers every time it is run. Regardless of whether I run it on Windows, Android or iOS.


Namely these:

Try it and see if you get the same results. If you do, then it's a safe bet that it always be the same (I suspect it will).
haliop_New
User Banned
Posted: 18th May 2020 16:04
Awsome. Will do.

Login to post a reply

Server time is: 2024-03-29 07:59:04
Your offset time is: 2024-03-29 07:59:04