Staredit Network

Staredit Network -> Concepts -> New Dice Rolling Method
Report, edit, etc...Posted by FaZ- on 2005-03-04 at 18:21:53
I just thought of an interesting way to do weighted dice rolls. In a system I had read earlier, a trigger would add 1 to a dice counter every 5 milliseconds or so to be random. To weight this and easily create a dice system, use the following:


Trigger
Description:
Starting Trigger
Players:
¤ Current Player.
Conditions:
¤ Always.
Actions:
¤ Set Deaths of Nexus to 0.
¤ Set Deaths of Gateway to 0.



Trigger
Description:
Dice Rotation
Players:
¤ Current Player.
Conditions:
¤ Always.
¤ (Dice Rolling is Activated.)
Actions:
¤ Set Deaths of Nexus to 2.
¤ Wait 28 Milliseconds.
¤ Set Deaths of Nexus to 3.
¤ Wait 56 Milliseconds.
¤ Set Deaths of Nexus to 4.
¤ Wait for 84 Milliseconds
¤ Set Deaths of Nexus to 5.
¤ Wait for 112 Milliseconds
¤ Set Deaths of Nexus to 6.
¤ Wait for 140 Milliseconds
¤ Set Deaths of Nexus to 7.
¤ Wait for 168 Milliseconds.
¤ Set Deaths of Nexus to 8.
¤ Wait for 140 Milliseconds.
¤ Set Deaths of Nexus to 9.
¤ Wait for 112 Milliseconds.
¤ Set Deaths of Nexus to 10.
¤ Wait for 84 Milliseconds.
¤ Set Deaths of Nexus to 11.
¤ Wait for 56 Milliseconds.
¤ Set Deaths of Nexus to 12.
¤ Wait for 28 Milliseconds.
¤ Preserve Trigger.
¤ Comment: Dice Number Rotation.



Trigger
Description:
Player Rolls.
Players:
¤ Current Player.
Conditions:
¤ Current Player Brings 1 "Roller" to "Roll."
Actions:
¤ Move all "Rollers" of Current Player at "Roll" to "Next To Roll."
¤ Set deaths of Gateway to "1"
¤ Preserve Trigger.



Trigger
Description:
Roll = Two.
Players:
¤ Current Player.
Conditions:
¤ Current Player has exactly 2 deaths of Nexus.
¤ Current Player has exactly 1 deaths of Gateway.
Actions:
¤ Set Deaths Of Gateway to "0".
¤ Display For Current Player: "You rolled a two!"
¤ Preserve Trigger.
¤ Comment: Roll = Two.


And then make a trigger for each subsequent roll. I'm lazy, if you want to use the system then you do it.


CODE
1 - 1, 2, 3, 4, 5, 6 | 2, 3, 4, 5, 6, 7
2 - 1, 2, 3, 4, 5, 6 | 3, 4, 5, 6, 7, 8
3 - 1, 2, 3, 4, 5, 6 | 4, 5, 6, 7, 8, 9
4 - 1, 2, 3, 4, 5, 6 | 5, 6, 7, 8, 9, 10
5 - 1, 2, 3, 4, 5, 6 | 6, 7, 8, 9, 10, 11
6 - 1, 2, 3, 4, 5, 6 | 7, 8, 9, 10, 11, 12


This gives all the posibble values of dice rolling, 36 of them, equally. I picked a base of 28 so that the trigger cycle happens once every second. (28*36=1008) If someone wants to use hyper triggers in conjunction with a system like this, they can simply use a second death counter to add "wait time." As this is untested, StarCraft may be unable to differ in such small numbers, but I believe it is able to. If not, many dice rolls cannot happen quickly, but either way dice rolls can happen within seconds of each other without problems. Easily usable in a monopoly type map without problems.
Report, edit, etc...Posted by Urmom(U) on 2005-03-04 at 19:03:45
can i ask what the point of setting the deaths to 0? thats its default already but i guess itd be useful for a boardgame game.
Report, edit, etc...Posted by FaZ- on 2005-03-04 at 22:46:37
I thought I would include that in case this was used for a minigame of some sort in which case a player may have had inadvertantly suffered actual deaths of either of those units.
Report, edit, etc...Posted by LegacyWeapon on 2005-03-04 at 23:20:50
You do know that everytime, the player will roll a 2 due to the waits...
Report, edit, etc...Posted by FaZ- on 2005-03-05 at 00:33:15
No I obviously don't and fail to understand you. I assume that you are talking about if hyper triggers are used, in which case I suggest reading my entire post.

QUOTE
If someone wants to use hyper triggers in conjunction with a system like this, they can simply use a second death counter to add "wait time."
Report, edit, etc...Posted by TRiGGaMaSTa on 2005-03-05 at 01:31:34
Lol, nice system... it would work, after getting waits right. Its creative cause i would always have used randomizing triggers.. but you've done a system using rolling a pair of dice? or is it.
Report, edit, etc...Posted by DevliN on 2005-03-05 at 02:25:41
So the waits wouldn't mess up the other triggers with wait/preserve? I try to avoid using waits whenever I possibly can.
Report, edit, etc...Posted by FaZ- on 2005-03-05 at 11:11:15
The trigger can't start again until it finishes for the first time, so it would act as a loop shuffling among the number possibilities. The waits would most likely mess up if used in conjunction with hyper triggers, but perhaps not. In either case, I could use a second death counter to count elasped time and shuffle through the triggers. This is much simpler though. That would have more problems because of the limitedness of death counters.

Trigga-- yes this system is for a pair of dice. The outcome would be 1/36 possibilities. (6 possiblities 1-6) up to the second power for 2 dice. So 6^2=36, the number of outcomes.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-03-07 at 12:05:45
QUOTE(FaZ- @ Mar 4 2005, 11:33 PM)
No I obviously don't and fail to understand you. I assume that you are talking about if hyper triggers are used, in which case I suggest reading my entire post.
[right][snapback]158704[/snapback][/right]


If you arn't using hyper triggers the problem is that the death counter will stop during the 'Neo' (two second wait). the chances are much higher that the player will put the guy on the roll during this time. So when it checks the triggers finnally It will be set to 2 before fireing the action.
Report, edit, etc...Posted by FaZ- on 2005-03-07 at 12:31:46
But with hyper triggers would this system work? I am not well informed on the actuality of how the triggers work in such a detailed fashion.
Report, edit, etc...Posted by SA_Max71 on 2005-03-07 at 13:02:45
QUOTE((U)Bolt_Head @ Mar 7 2005, 09:05 AM)
If you arn't using hyper triggers the problem is that the death counter will stop during the 'Neo' (two second wait).  the chances are much higher that the player will put the guy on the roll during this time.  So when it checks the triggers finnally It will be set to 2 before fireing the action.
[right][snapback]160001[/snapback][/right]

Hmmm, what about using dabbu's new hypertrigger system? (The one that uses 2 switches, and that prevents a neo from ever happening.)

QUOTE(FaZ- @ Mar 7 2005, 09:31 AM)
But with hyper triggers would this system work? I am not well informed on the actuality of how the triggers work in such a detailed fashion.
[right][snapback]160011[/snapback][/right]

Hmmm, nice system happy.gif. I would rather use deathcounts instead of waits if I had to use this system.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-03-07 at 15:01:56
QUOTE(FaZ- @ Mar 7 2005, 11:31 AM)
But with hyper triggers would this system work? I am not well informed on the actuality of how the triggers work in such a detailed fashion.
[right][snapback]160011[/snapback][/right]


If the hyper triggers were not interfering with the waits then it would work alot better. Because there isn't a long amount of time that the player can go set on the roll dice beacon waiting for the triggers.

But I think if your using hyper triggers or not your better off just making the trigger to Add one death each step rather than setting it multiple times in one trigger with waits.

That will help even the chances assumeing your roll at a random time.
Report, edit, etc...Posted by in_a_biskit on 2005-03-08 at 05:43:11
Hey! That was my idea! angry.gif

with this specific example,
1. wait actions run only in multiples of 84ms, so your wait actions need to be modified.
2. as (U)Bolt_Head said, the trigger will experience a 'lag' (neo) before it loops through again, making 2 the most likely roll. However, you can probably force it to run through again with hypers (given to another player so as not to interfere with the wait actions).
3. probably a more efficient system is to continually loop a death counter from 1 to 36 with hypers

It's possible to make it work, though.
Report, edit, etc...Posted by Coprofago on 2005-03-09 at 19:04:23
The best way to avoid the uses of "Wait" trigger would be the switch randomization way..

since you have more possibilities to get 7 with a pair of dices.. but since you need a 36 possibilities switch system it would be very long to do..

2^5 = 32
2^6 = 64 (way too much!)

but you could use 2^5 (using 5 switches) and add another extra switch for the 4 more possibilities you need.. so let's call that extra switch: X

You do all ur 32 random possibilities using X = 0 and you do 4 more random possibilities with the same 5 switches: with X = 1 but now you have to deal with 28 unused possibilities.. thats why you need a trigger that does: "If X = 1 and nothing happened.. reroll" To do so.. you need a rerolling trigger at the END of your trigger using the X = 1.

by doing so.. of course you'll waste time since it takes many triggers.. but this system doesnt use any waits.. but you can use death counters as a wait.. which is even better..

With a trigger like this:

CONDITIONS: Always
ACTIONS: Add 1 death of Y for current player.
------------ Preserve Triggers.

CONDITIONS: Death of Y for current player is at least Z (number of death to activate the 12)
ACTIONS: Set death to zero and restart the whole thing..

but now i think you'll need 1 trigger for each of the possiblities: (2,3,4,5,6,7,8,9,10,11,12)
Report, edit, etc...Posted by FaZ- on 2005-03-09 at 19:29:52
That way is very well known, and obvious. This would be a much more simple way if it functions like I had originally thought that it would. If however the "NEO" compicates matters it would be worse. Thanks for your input anyway, but read the title. It says NEW Dice Rolling Method as opposed to the older known ways such as the one you proposed.

By the way, take a peek at these tutorials. We have tutorials for everything!

Tutorial 1
Tutorial 2

wink.gif I'm not a newb thanks. This is why I think that we need the old self-rating system. He gave me an explanation as if I was a clueless mapper inventing new random things, and gave me a basic way of doing this, while my way is an attempt at something more complex and less taxing to program.
Report, edit, etc...Posted by Coprofago on 2005-03-09 at 22:43:20
oh lol I'm sorry by re reading my post.. i see.. it's very useless unless for the noobs.. ya those methods are known.. your is new and really good.. beside the use of waits.. i never liked the wait trigger.. thats why i always try to find a way to avoid it..
Report, edit, etc...Posted by RexyRex on 2005-03-13 at 15:48:27
Please tell my why you wouldn't use switches. I don't see how they could screw anything up...
Report, edit, etc...Posted by Staredit.Net Essence on 2005-03-13 at 16:31:52
I thought of a REALLY simple way of dice rolling.


Trigger
Description:
Dice #'s
Players:
¤ Computer
Conditions:
¤ Always
Actions:
¤ Create 1 #1 at location "Dice#'s"
¤ wait 50 milliseconds
¤ Remove all anyunit owned by (computer player) at "Dice #'s
¤ Create 1 #2 at location "Dice#'s"
¤ wait 50
¤ Remove
¤ etc..


Don't for get to preserve trigger.

THan


Trigger
Description:
Roll the dice
Players:
¤ Human players
Conditions:
¤ Player brings at least 1 terran cavilian to "roll dice".
Actions:
¤ Move cavillian owned by current player at "roll dice" to "dice roller"
¤ Move 1 anyunit owned by player 2 at "Dice #'s" to "Dice appear"
¤ Preserve trigger


Where the dice #'s are being constantly changed 1-6 shouldn't be seen. And dice apear is where the player sees what they rolled.

I hope this works. Good luck.


Next Page (1)