Does ACS random(n, m); allow for multiple random numbers in the same tic?

General help and assistance forum.
Post Reply
Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

Does ACS random(n, m); allow for multiple random numbers in the same tic?

#1

Post by Watermelon » Mon Dec 03, 2012 1:29 am

I swear back on Skulltag if I called random(1, 2); in the same game tic it would ALWAYS return the same number.

Is online game play where the server generates a random number in ACS always going to be 'possibly' different if it generates lets say a ton of random numbers in the same game tic? I don't know if this was for demo compatibility or something. I believe it has changed recently but I'd like to make sure it has before I go building something up and finding out a core element of the game is not what I thought it was.

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: Does ACS random(n, m); allow for multiple random numbers in the same tic?

#2

Post by Llewellyn » Mon Dec 03, 2012 4:08 am

Test it?

Code: Select all

script 1 NET
for (int x; x < 20; ++x)
Log(d:random(1,2));
Last edited by Llewellyn on Mon Dec 03, 2012 4:13 am, edited 1 time in total.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Does ACS random(n, m); allow for multiple random numbers in the same tic?

#3

Post by Watermelon » Mon Dec 03, 2012 5:48 am

Llewellyn wrote: Test it?

Code: Select all

script 1 NET
for (int x; x < 20; ++x)
Log(d:random(1,2));
That one instance could work, but there could be something hidden which activates upon various flags or such that would crop up later on.

Therefore probably only a developer can truly answer my question, but thanks for trying.

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: Does ACS random(n, m); allow for multiple random numbers in the same tic?

#4

Post by Torr Samaho » Tue Dec 04, 2012 6:29 am

Watermelon wrote: That one instance could work, but there could be something hidden which activates upon various flags or such that would crop up later on.
There is nothing purposely hidden to make random() not random in online play. I just remember somebody reporting that adding bots somehow resets the random number generator.

Post Reply