Staredit Network

Staredit Network -> UMS Assistance -> Randomized Dice Rolls
Report, edit, etc...Posted by DevliN on 2005-03-01 at 02:41:51
I know how to make randomized switches and all, but I need to make some where I can have 12 different outcomes (for a pair of dice) so I was wondering what the best possible combination would be for this? Should I go with 3 switches per die (which is 16 randomized switches total) or should I attempt for more?

[First Die] With 3, I think that would be like this:
C - C - C = 1
S - S - S = 2
C - C - S = 3
S - C - C = 4
S - S - C = 5
C - S - S = 6
C - S - C = 1
S - C - S = 3

[Second Die] And then randomize another 3 for:
C - C - C = 1
S - S - S = 2
C - C - S = 3
S - C - C = 4
S - S - C = 5
C - S - S = 6
C - S - C = 2
S - C - S = 4

Unless anyone else has any input on a better way to randomize dice rolls I'll go with this, but I'm wondering if there is a better way.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-03-01 at 03:16:59
Read the Randomization tutorial.

At the very end it tells you how to randomize with non powers of 2.
http://www.staredit.net/index.php?tutorial=61
Report, edit, etc...Posted by sckor on 2005-03-01 at 05:21:38
or you can just use this way.

tutorial
no switches used at all, but yea I know, a bit costy on locations.
Report, edit, etc...Posted by in_a_biskit on 2005-03-01 at 07:00:01
There is, actually, even another way that is not 'really' random, but can be just as good and even easier depending on how you use it.

Have a counter that rapidly counts in a loop from 1 to 6 (using hypertriggers),
and since it's extremely hard for a human player to 'hyper-time' their actions, just pick whatever number the counter's at when they roll the dice. The number picked should be unpredictable.

However, if you want 2 dice, it's kinda tricky using this method, since if you have two counters counting the same amount, they will probably count in sync with each other, possibly meaning that you always roll a double disgust.gif .
One way to get around it is to have a counter going to 36, covering all the possibilities of 2 dice rolls, but then each cycle will take 3 seconds to complete, even with hypers.

You get a similar problem with the critter method: the critters tend to move slowly and stop often, so you can't pick 2 numbers in a row quickly, or you'll get the same one.

With switches, the extra states (the combinations remaining after you assign all six numbers once) should lead to a re-randomisation, rather than just arbitrarily picking a number to assign to it. The way you have it currently, the numbers 5 and 6 will come up less often than the others.

Which method you choose depends on how fast you need it to work and how the dice are rolled.
Report, edit, etc...Posted by DevliN on 2005-03-01 at 09:46:40
Thanks, Bolt. I was just wondering, though, if there was an easier way to determine dice rolls other than using random switches or a counter (which I'm using for a deck of cards).

Sckor, I don't think that Critter method would work for this one considering how many outcomes there are.

in a biskit, I am using that counter idea for a deck of cards you use in the game, but I don't think it would be too effective for dice. These deice determine how far you can move on the game board, so I purposely had 5 and 6 come up less often so people wont jump ahead huge amounts.

I think I'll go with Bolt's rerandomization then, since nothing else seems to be as effective. Thanks a bunch, guys.
Report, edit, etc...Posted by Mini Moose 2707 on 2005-03-01 at 10:56:34
Just have 1-6 combos for 1-6 and have the 7th and 8th rerandomize the switches.
Report, edit, etc...Posted by sckor on 2005-03-02 at 08:04:06
QUOTE(DevliN @ Mar 1 2005, 11:46 PM)
Thanks, Bolt. I was just wondering, though, if there was an easier way to determine dice rolls other than using random switches or a counter (which I'm using for a deck of cards).

Sckor, I don't think that Critter method would work for this one considering how many outcomes there are.

in a biskit, I am using that counter idea for a deck of cards you use in the game, but I don't think it would be too effective for dice. These deice determine how far you can move on the game board, so I purposely had 5 and 6 come up less often so people wont jump ahead huge amounts.

I think I'll go with Bolt's rerandomization then, since nothing else seems to be as effective. Thanks a bunch, guys.
[right][snapback]156313[/snapback][/right]


that's what I thought. tongue.gif 12 locations tongue.gif
Report, edit, etc...Posted by DevliN on 2005-03-02 at 09:31:22
If I used 12 locations then I'd need 2 critters at once, right? I also have an issue with a lack of space on my map, so I can't really use the critter method.
Report, edit, etc...Posted by Tuxedo Templar on 2005-03-02 at 22:48:40
Heh, that gave me a new randomization idea. Use in_a_biskit's quasi-randomizer by cycling through numbers 1-6 rapidly with triggers that do the cycling in random jumps. In other words, for each trigger loop:

- Randomize a switch
- Add 1 to a counter if the switch is cleared, 2 if its set.
- If the number goes outside the bounds, subtract the boundary amount (6 if its a dice roll) to get it back in.
- Repeat.
- Use the number for your randomized value.

A fairly decent randomization system without having to re-randomize. Re-randomization has a rare chance of drawing the same set of random switches magically in a row, and perpetuating the randomization longer than expected.
Report, edit, etc...Posted by Staredit.Net Essence on 2005-03-02 at 23:07:00
You could use a little unit generator or death generator.

like this

condition
always

action
create 1 terran marine at (genertator) for P7
Wait (1)ms
create 1 terran marine at (genertator) for P7
Wait (1)ms
create 1 terran marine at (genertator) for P7
Wait (1)ms
create 1 terran marine at (genertator) for P7
Wait (1)ms
create 1 terran marine at (genertator) for P7
Wait (1)ms
Remove all terran marines at (generator) for P7
preserver trigger

cond.
P7 has exactly 1 death of (whatever unit)
P7 brings exactly 0 terran marine to (generator)
action
Set Deaths for (whatever unit) for P7 to 0
Create 1 "whatever unit" for P7 at location "____"
create a (1) at (Dice Loc) for p1
preserve trigger

cond.
P7 has exactly 1 death of (whatever unit)
P7 brings exactly 1 terran marine to (generator)
action
Set Deaths for (whatever unit) for P7 to 0
Create 1 "whatever unit" for P7 at location "____"
create a (2) at (Dice Loc) for p1
preserve trigger

cond.
P7 has exactly 1 death of (whatever unit)
P7 brings exactly 2 terran marine to (generator)
action
Set Deaths for (whatever unit) for P7 to 0
Create 1 "whatever unit" for P7 at location "____"
create a (3) at (Dice Loc) for p1
preserve trigger

cond.
P7 has exactly 1 death of (whatever unit)
P7 brings exactly 3 terran marine to (generator)
action
Set Deaths for (whatever unit) for P7 to 0
Create 1 "whatever unit" for P7 at location "____"
create a (4) at (Dice Loc) for p1
preserve trigger

cond.
P7 has exactly 1 death of (whatever unit)
P7 brings exactly 4 terran marine to (generator)
action
Set Deaths for (whatever unit) for P7 to 0
Create 1 "whatever unit" for P7 at location "____"
create a (5) at (Dice Loc) for p1
preserve trigger

cond.
P7 has exactly 1 death of (whatever unit)
P7 brings exactly 5 terran marine to (generator)
action
Set Deaths for (whatever unit) for P7 to 0
Create 1 "whatever unit" for P7 at location "____"
create a (6) at (Dice Loc) for p1
preserve trigger





So you have a unit (the rolloer) to shoot the "whatever unit" owned by player 7 and when you do this it will create a unit with a number for its name (1-6) depending on how many marines P7 brings to the "generator" location. you can switch up how it creates the marines to make it more of a random thing too.

just an alternative way of doing a dice roll, and you could really use this mehtor for anything. its quite simple too.
Report, edit, etc...Posted by chuiu on 2005-03-02 at 23:18:14
That method is pretty retarded.
Report, edit, etc...Posted by Tuxedo Templar on 2005-03-03 at 00:05:03
"Quite simple" is the wrong term altogether. In fact, any method using units or locations is already more complicated than it needs to be for doing randomizations.
Report, edit, etc...Posted by Drakiel on 2005-03-03 at 00:16:49
How about... you just NOT use a 6 sided die...
DUH
THEN END, OVER! Shuttup and do it.

Golly, people have to make things so difficult.
Report, edit, etc...Posted by Tuxedo Templar on 2005-03-03 at 00:24:48
What a dumb thing to say. I doubt you even read the discussion before posting that.
Report, edit, etc...Posted by chuiu on 2005-03-03 at 00:33:07
Guh, this was solved long ago. Locked.
Next Page (1)