Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Switch Randomization Preference
Switch Randomization Preference
Aug 4 2009, 4:53 pm
By: UnholyUrine  

Aug 4 2009, 4:53 pm UnholyUrine Post #1



We all (hopefully) know that we use Switches to do clean and clear Randomizations...

however, I've been using 1 switch with 2 outcomes... and, even tho I might just be paranoid, I keep finding the switch favoring the "set" option.

I remember this being discussed somewr, but I'm too lazy to find out.. Is it true that randomized switches prefer set/clear? ...



None.

Aug 4 2009, 5:08 pm Pyro682 Post #2



If it's doing ONLY the "Set" option and you have never even seen the "clear" option, then you may have a bug in the triggers.

If Not, then I beleive you are just paranoid, because I think switches are quite unbiased when it comes to their two options.



None.

Aug 4 2009, 5:20 pm Vrael Post #3



I don't really know how the SC randomization code works, but maybe if the switch is being randomized at exactly the same time every game, and if the code depends on the in-game clock, perhaps it might not be random. If the trigger is something like
Always
Randomize Switch 1

then it happens at the same time every game so, just a theory.



None.

Aug 4 2009, 5:21 pm Ashamed Post #4

Hear me Raor!!

Just use deather counters, DC= bomb in every situation, Ok what you do is have 1 death counter cycle through 1-2 if you just want to random switches, so when it hits 3- tell the game to set back to 0. Now the deather counter is going back and forth between 1 and 2. Now when you want the random part to happen have it switch another deather counter to 1. So now if player so and so, has 1 + 1 dc then do this, 1+2 death counters then do that.



None.

Aug 4 2009, 5:27 pm Kenshin23 Post #5



I agree with you Ashamed, I use hyper triggers and Death counters to randomize stuff in my map and it works perfect, I have no reason to change them.



None.

Aug 4 2009, 5:28 pm Ahli Post #6

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

1. copy your triggers into notepad++ (or other programs like that).
2. search for
Code
Set Switch("Switch#"
# = the number of the switch you are using (if you didn't rename it).
3. check your triggers




Aug 4 2009, 5:39 pm JaFF Post #7



I've noticed that some games are a bit biased towards some switches or their combinations, while other games are fine. In my The Thing map, you get one of 8 random messages when you step on a corpse. If you set your unit to patrol on and off the corpse, you notice that it tends to repeat the same message a lot, sometimes even up to 4 times.

I personally consider the randomization engine in SC to be total crap.
Quote
I don't really know how the SC randomization code works, but maybe if the switch is being randomized at exactly the same time every game, and if the code depends on the in-game clock, perhaps it might not be random. If the trigger is something like
Always
Randomize Switch 1

then it happens at the same time every game so, just a theory.
This is wrong. If it were true, the same player would be 'the thing' or 'the phantom' every time in such maps. :P



None.

Aug 4 2009, 5:51 pm Pyro682 Post #8



This gets into the topic of how computers (and computer programmers, for that matter) randomize things.
There are a couple of methods in which they do something like this: (These are not all of them, mind you)
-They take a very highly complicated formula (By complicated, I mean lots of different operatives are used) and use a small number of variables that are very prone to change with the game, so that the results of the formula are extremely exaggerated, even with the littlest changes to that variable. Vrael was thinking of this when he said the randomization may depend on an "in-game" clock. This would be similar to most of the "DCs" we have in our maps today. (Without the formula in most cases, anyways)n
-They also may take a series of variables that are very highly prone to change, and then use either a very complicated formula or a not complicated formula to change these results.

The variables in these randomization engines may account for the "Biased" feeling that people get towards switches. Since we often run similar courses of action while testing/playing our maps who run quite similar each game (especially in the early game), we often keep these variables quite constant (or close to constant) and then see more of a "constant" feel to our Switch randomizations.



None.

Aug 4 2009, 6:44 pm Demented Shaman Post #9



How big is your sample size? You may think there's a bias but that's only because you're looking at a small sample. I think this is a pretty pointless topic questioning the randomness of switches especially when you don't have any evidence and it's just based on your hunch.



None.

Aug 4 2009, 7:00 pm UnholyUrine Post #10



Obviously it was just a random test, and one outcome was more abundant than the other...

Anyways, I simply wanted to see if there is a mechanism in Starcraft that'd create a bias.
Pyro's answer is very enlightening... but also raises more questions than it answers... Though I don't really care, I'll just stick with what I have.

.. Oh, Devilesk... If you really want, I don't remember for sure, but if out of 10, about 7 was the switch being "set"...
So in that case, the probability of getting that is...

10C7 (0.5)^7 (0.5)^3 + 10C8 (0.5)^8 (0.5)^2 + 10C9 (0.5)^9 (0.5)^1 + 10C10 (0.5)^10 (0.5)^0
= 0.1719 > 0.05
therefore we would fail to reject the null hypothesis... which would've been that the switches favor being "set"

If you want, you can create a larger experiment to test the bias with the Chi-square test.



None.

Aug 4 2009, 7:05 pm JaFF Post #11



Quote from name:Pariah
How big is your sample size? You may think there's a bias but that's only because you're looking at a small sample. I think this is a pretty pointless topic questioning the randomness of switches especially when you don't have any evidence and it's just based on your hunch.
Even if you do attain a reasonably large sample (over 30, which is considered the 'minimum' for most industrial problems by most analysts), it is still you who has to pick the critical value. Thus it is again based on what you think if a 'good randomization'. Say we make 1000 randomizations and get 570/430. Some may say that's a fair switch/coin, while others will disagree.

Just stick to your personal opinion about switches and that's it. If you hate them so much that you don't even want to use them, you can use JYD or unit death updating (50/50 with hypers). If the trigger cycles in which you will need the random number are random themselves in a way, go ahead and use a looped deathcounter.



None.

Aug 4 2009, 7:14 pm killer_sss Post #12



i personally have ran 8 switches 80k times each. 8k times at a crack to see there variance. although i wasn't specifically looking for preference to set vs clear every time a different color won out and the color was not more than 100 ahead of the others. i would say this is fairly random. the % diffence between all tests was 2.3% i believe.



None.

Aug 4 2009, 7:19 pm Demented Shaman Post #13



Quote from UnholyUrine
.. Oh, Devilesk... If you really want, I don't remember for sure, but if out of 10, about 7 was the switch being "set"...
So in that case, the probability of getting that is...

10C7 (0.5)^7 (0.5)^3 + 10C8 (0.5)^8 (0.5)^2 + 10C9 (0.5)^9 (0.5)^1 + 10C10 (0.5)^10 (0.5)^0
= 0.1719 > 0.05
therefore we would fail to reject the null hypothesis... which would've been that the switches favor being "set"

If you want, you can create a larger experiment to test the bias with the Chi-square test.
You're coming here after only doing 10 trials? Lol.


Quote from JaFF
Quote from name:Pariah
How big is your sample size? You may think there's a bias but that's only because you're looking at a small sample. I think this is a pretty pointless topic questioning the randomness of switches especially when you don't have any evidence and it's just based on your hunch.
Even if you do attain a reasonably large sample (over 30, which is considered the 'minimum' for most industrial problems by most analysts), it is still you who has to pick the critical value. Thus it is again based on what you think if a 'good randomization'. Say we make 1000 randomizations and get 570/430. Some may say that's a fair switch/coin, while others will disagree.
Of course there will be interpretation that we will have to debate, but I was just asking the question to see what we were currently working with. And as seen by Unholy's post we are dealing with his laughable 10 runs.



None.

Aug 4 2009, 7:26 pm JaFF Post #14



Quote from killer_sss
i personally have ran 8 switches 80k times each. 8k times at a crack to see there variance. although i wasn't specifically looking for preference to set vs clear every time a different color won out and the color was not more than 100 ahead of the others. i would say this is fairly random. the % diffence between all tests was 2.3% i believe.
After considering this information, combined with this:
Quote
In my The Thing map, you get one of 8 random messages when you step on a corpse. If you set your unit to patrol on and off the corpse, you notice that it tends to repeat the same message a lot, sometimes even up to 4 times.

...I am tempted to think that some bias in randomization follows a sinusoid through time (note: not game time). Although there is no statistical method to prove that short-term randomization is biased, because it's hard to get a large-enough sample. Although my experience says there is something fishy about it: testing the zombie spawns in CotD seems to support this idea.



None.

Aug 4 2009, 9:13 pm killer_sss Post #15



yes that could be tru jaff. i certainly wouldn't argue against it from what i have seen. I too have played the thing maps and have seen time after time someone constantly being selected.

as for ashamed's method i think it seems flawed but maybe i'm misunderstanding cycling through.

if your going to truely randomize the cycle should not happen. It should be something like 1,1,2,1,2,1,2,2,2,1,1,2,1,2,1,2
if your cycling n + 1 and if n=3 then n=0 well then you are forcing it to go back and forth between 2 and 1 therefore you can never have two or more ones in a row or two or more twos in a row.



None.

Aug 4 2009, 11:57 pm rockz Post #16

ᴄʜᴇᴇsᴇ ɪᴛ!

Nothing can ever be perfectly randomized.

UU, you're being paranoid. If you're that worried about it, randomize more than one switch.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Aug 5 2009, 7:33 pm Ashamed Post #17

Hear me Raor!!

But its not suppose to be random, Its just supose to be a system and what ever is showed in DC when you do the trigger that is what reacts. There is the same amount of 1 and 2 DC's because the second it gets to 3 it starts over back at 1. So then it goes 1 and 2. Then starts over again. This lets it be almost always on 1 and 2. Then it will change the output when the trigger is activated.

Post has been edited 1 time(s), last time on Aug 5 2009, 8:24 pm by Ashamed.



None.

Aug 5 2009, 7:54 pm JaFF Post #18



Quote from Ashamed
But its not suppose to be random, Its just supose to be a system and what ever is showed in DC when you do the trigger that is what reacts, there is the same amount of 1 and 2, because the second it gets to 3 it starts over back at 0, so then it goes 1 and 2, then starts over again. This lets it be almost always on 1 and 2, so when the trigger is set, then it will change the output when the trigger is activated.
If you need the random variable at the same trigger loops, this method stops working. Picking the thing or the phantom in the first trigger loop with this method will always result in 0 or 1, depending on how you set it up.



None.

Aug 5 2009, 7:56 pm Ashamed Post #19

Hear me Raor!!

Its always worked for me, i have random battles set up on my game 1-4, and it looks like it really is random, but its a bit differnt the way i use it.



None.

Aug 5 2009, 8:18 pm JaFF Post #20



Such a system is only 'random' because the players and in-game events bring randomness into it. If the battle begins when, say, all the players bring their heroes to a town, it can be considered 'random', because the players don't know what trigger loop did the trigger fire in.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
Please log in to shout.


Members Online: Moose, Roy