| 09-13-2004, 04:04 PM | #1 |
anybody know anything about how the random is seeded? or possibly how you can set it yourself... it appears to be generated at map compile time... |
| 09-13-2004, 08:17 PM | #2 |
Test map has an option to lock it , and check this native: Code:
native SetRandomSeed takes integer seed returns nothing |
| 09-14-2004, 12:38 AM | #3 | |
Quote:
no idea what your talking about... |
| 09-15-2004, 06:51 PM | #4 |
anybody? im using roc... any way to generate a random on the fly in game? i could use characters of people's names as a random seed i suppose... ... or player owned unit locations... how can you seed it? ... trying to think if it would be viable to try to create a custom random function... |
| 09-15-2004, 09:06 PM | #5 | |
Quote:
do you mean the players start locations?, if not please be more clear, i dont understand what you mean whit seed ^^ |
| 09-15-2004, 10:46 PM | #6 | |
Quote:
yeah... sorta need to be a programmer to understand what im saying... uhh... when you set something up to be random... like for instance... make a map and set a variable to be a random number between 1 and 100... then makea trigger to display that number to all players on map initialization... no matter how many times you run that map, that number is going to be the same... so, this tells us that the random is "seeded" when the map is compiled (saved)... i am looking for a way to "seed" this random generation on the fly right before the variable is displayed to me in the game, so the number will be diffrent every time i play the map... |
| 09-15-2004, 11:08 PM | #7 |
MAth - Random number anyone ? |
| 09-15-2004, 11:15 PM | #8 | |
Quote:
sigh... your not listening to me... that does not allow a random number each play of the map... it is based off (seeded) of something when you save the map... therefore the seed is static, thus weilding static results that are constants on every seperate play of the map... i want to use the live game engine to generate a random number, NOT THE MAP EDITOR WHEN I SAVE THE MAP! |
| 09-15-2004, 11:23 PM | #9 | |
Quote:
|
| 09-15-2004, 11:26 PM | #10 | |
Quote:
then when is it seeded? what is is seeded from? how can you make it an actual random? i'm not expecting cryptographic based randomness that i get from real programming... but, i do expect it to at least look random... |
| 09-15-2004, 11:28 PM | #11 |
there is a random random seed at the start of the game, but you can change it manually with the native I showed |
| 09-15-2004, 11:33 PM | #12 | |
Quote:
ok then, how would this be set on an RoC map using the RoC editor or whatever RoC based third-party tool? i just made a little test map that i started using the Test Map function and each time i ran it using the Test Map from the world editor it generated 544... i then went to a LAN game and started it using a made up name and the value was 414 each time... so apparently it is seeded from player 1's name? ok, apparently it's not seeded from the name... it appears random on LAN well... found an option in the map editor that says "fixed random seed"... all i have to say is that this is completely pathetic and ignorant game design to have that option defaultly on... |
| 09-16-2004, 01:23 AM | #13 |
Incidentally, nouse, I am 75% sure this is how it works: Any time you run a "test map" the random seed will be exactly the same every time. That check box, "Fixed Random Seed", only applies to when you are running a test map. Running the game normally through warcraft means that a random number truly is random (well, as a programmer, you know it's not, but it's pretty random. Random enough that it's unpredictable). With abilities like critical strike, that have a % chance of firing, they use a cheated random %, so that the ability has a low chance of firing multiple times in a row and has a low chance of not activating for a long time. The random numbers that are generated from Math - Random Number do not work this way (I think). I would have replied earlier, but I thought you had a particular reason for wanting a random seed other than the standard WC3 one, and not that you thought that Random Numbers were the same every time you can the map. At least you don't need to put "Randomize Timer" in Map Initialization (congrats to anyone who can recognize that ancient command). |
