Random Number

Lyle.

New Member
Reaction score
32
No, that's wrong. It will almost certainly make the outcome less random (formally: it will have less entropy).

For example, the sum of two rolls of a dice is more likely to be 7 than 12. It is less random than a uniform random number from 2 to 12.



If you want to *avoid* bursts of critical hits (or whatever), you need to make the probability of getting a critical hit lower if the last hit (or last couple hits) were criticals. In the extreme case you could give a critical hit exactly every 5 swings. A viable solution might that each swing deducts 1 from a count, when the count hits 0 you get a critical, and then the count resets to a random number from 2 to 10 (or whatever).

Yay real suggestions : )

Thanks, those are both viable solutions and I might default to those but at this point I want to give this "More" random number more time. Somebody's gotta know something :D?
 

Volkof

Well-Known Member
Reaction score
31
I was just wondering if the World Editor provides a function which lets you get the current microsecond of the computer time.

If it can be done, you can use that value for random number. Just a thought


Cheerio
 

Chao

Setting sail for fail in the sea of lame.
Reaction score
63
Yay real suggestions : )

Thanks, those are both viable solutions and I might default to those but at this point I want to give this "More" random number more time. Somebody's gotta know something :D?

Hey there.

What I use is an arrayed variable called Gamble.
You set up another trigger that is just
Event: "Every 0.03 seconds of gametime"
Set: "Gamble=random number from X to Y"

Then instead of plugging in a white-bread random number, you're plugging in a number that you could never predict. X and Y can be programmed in every ability, if you'd like two numbers that are a little "off the beaten path". You might have to add a little wait-time to your ability, or if there's already some, that's for the best; I don't leave this trigger on. I turn it off and then back on as necessary. Hope that helps!
 

Strilanc

Veteran Scripter
Reaction score
42
Code:
A = Random(1,100)
B = Random(1,100)
C = Random(1,100)
D = Random(1,100)
E = Random(1,100)
X = (a+b+c+d+e)/5

is not much random, this is random in the case you need "50" to be the most appearing number (there are much more possibilities to have 50 in that case than 1 or 100)


I'm pretty sure you meant 150. Fix your typo.

Hey there.

What I use is an arrayed variable called Gamble.
You set up another trigger that is just
Event: "Every 0.03 seconds of gametime"
Set: "Gamble=random number from X to Y"

Then instead of plugging in a white-bread random number, you're plugging in a number that you could never predict. X and Y can be programmed in every ability, if you'd like two numbers that are a little "off the beaten path". You might have to add a little wait-time to your ability, or if there's already some, that's for the best; I don't leave this trigger on. I turn it off and then back on as necessary. Hope that helps!

How is this any different from just calling (random from X to Y) directly? :rolleyes:
 

Moon_Raven

New Member
Reaction score
8
Does that actually help? Can anyone explain this logically to me if it does in fact work o_O


Otherwise I will try to make my own, I'm sure there is a usable algorithm out there some where :)

You won't get a random algorithm anywhere! Computers can't make random numbers! When you use GetRandomNumber(1,100), the computer already has a sequence of many many numbers betweeen 1 and 100 and with average sum of 50 in it. Now the only thing is the seed, it's where should the computer begin in that sequence. And since I don't think there is an option to set seed tot a number you want, you won't make more random numbers.
 

Strilanc

Veteran Scripter
Reaction score
42
You won't get a random algorithm anywhere! Computers can't make random numbers! When you use GetRandomNumber(1,100), the computer already has a sequence of many many numbers betweeen 1 and 100 and with average sum of 50 in it.

:banghead:
That is completely misleading. The computer doesn't have a fixed sequence of numbers stored anywhere. What it has is an algorithm (wc3 probably uses a linear congruential generator) which defines a massive sequence of numbers, and it reduces the generated values to the range you specify.

Also, the whole "computers can't generate random numbers" thing is ridiculous. First: it's not even true. Computers have access to plenty of entropy. Second: even if it was true, it wouldn't matter in this case. Just seeding the generator with the time is enough to make it too hard for a person to predict the next value.
 

Moon_Raven

New Member
Reaction score
8
What I said IS true. Of course computer CAN'T generate random numbers. And I diddn't say they have a sequence of numbers stored somewhere at all times, but the wc3 probably makes one when you put anything in you map which uses GetRandomInt, how would you make the "Use fixed random seed" work if it wasn't like that?
 

Strilanc

Veteran Scripter
Reaction score
42
What I said IS true. Of course computer CAN'T generate random numbers. And I diddn't say they have a sequence of numbers stored somewhere at all times, but the wc3 probably makes one when you put anything in you map which uses GetRandomInt, how would you make the "Use fixed random seed" work if it wasn't like that?

Computers can generate random numbers because they have access to entropy (random data). For example they can use network delays, user input, the temperature of some components, etc.

The idea that computers can't generate random numbers is a simplification of reality. In practice you need random numbers faster than you can collect entropy, so programs stretch out entropy using a PRNG. But that still doesn't mean the output is non-random. A deterministic process seeded with a random value doesn't have a deterministic output, it has a random output!

WC3 doesn't require cryptographically secure random numbers, so it (correctly) doesn't bother adding entropy over time. (Note: user actions have an effect on when values are generated, and this is a source of entropy. So even if you know the initial seed and current game time, you don't know enough to predict if the next hit will be a critical. So I guess technically wc3 *does* add entropy over time, but it's purely a side effect of its use.)
 

Lyle.

New Member
Reaction score
32
Like I said, The solution Darthfet led me too is quite sufficient so my problem is solved.

You won't get a random algorithm anywhere! Computers can't make random numbers! When you use GetRandomNumber(1,100), the computer already has a sequence of many many numbers betweeen 1 and 100 and with average sum of 50 in it. Now the only thing is the seed, it's where should the computer begin in that sequence. And since I don't think there is an option to set seed tot a number you want, you won't make more random numbers.

http://en.wikipedia.org/wiki/List_of_random_number_generators

Yes you can get Random number algorithms...? How do you think it WC3 has a Random Number Function? Of course they are not true Randoms but I already mentioned they can't be :)


EDIT: Quoted an old post there but Strilanc is right there are ways to create Random Numbers with computers. At the same time even when you take Temperature, Time of Day and Input you arn't creating a True Random : )
 

Moon_Raven

New Member
Reaction score
8
Yeah, I know they can use things such as last digits of miliseconds of current time and such things. But that will STILL not be random if you attack with a constant speed etc. And if you think wc3 does add entorpy over time, how would you explain the use of Use Fixed Random seed?

And to conclude this, computers CAN'T be random :)
 

Strilanc

Veteran Scripter
Reaction score
42
Yeah, I know they can use things such as last digits of miliseconds of current time and such things. But that will STILL not be random if you attack with a constant speed etc. And if you think wc3 does add entorpy over time, how would you explain the use of Use Fixed Random seed?

And to conclude this, computers CAN'T be random :)

You're not making a lot of sense. What does "Use Fixed Random seed" have to do with user input adding entropy? The number of random numbers generated depends on user input whether, regardless of the seed.

The time is a poor source of entropy, which is why I didn't mention it. Let me elaborate on one of the examples I did mention: user input. The amount of time between key presses varies, obviously. The variations might be small, but they are still there. More importantly, no one can predict those variations exactly. Not even you, the typist. If the computer accurately measures those variations, it can use the low-order bits as a source of random data.

You can even use many poor sources of random data, apply privacy amplification, and get very good random data out of it.

In short, I don't think you know what you're talking about. It sounds like you read a discussion somewhere where someone said computers can't make random numbers because they have to follow rigid instructions, but they left out the part where the input could vary.
 

Moon_Raven

New Member
Reaction score
8
Ok, sorry about that, but what ever entropy you use, numbers are STILL not random, and you know it...
 

DarkSonicele

New Member
Reaction score
20
Moon Raven is somewhat right here, and so are you. In our interpretation of the world, random cannot exist as there is always a scheme for anything. If the computer use temperature of components, monitor size and sound height to make a random number there will still be a very complex scheme behind.
But as these things are so close to being random as they are, we have to name them "random" to easier explain the overall term.

TL;DR answer: Just shut up and get back on topic.

The numbers generated through the warcraft 3 number generator are most of the time random, but as random is, well, random it can occur that it will come as burst, sometimes often sometimes not. It's magic of the random number generator systems :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top