Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: RESOLVED: Creating Random Units
RESOLVED: Creating Random Units
Sep 10 2007, 8:16 am
By: Obzio  

Sep 10 2007, 8:16 am Obzio Post #1



How create a random unit? :unsure:
exaple...if playing a Individual Defence! There create a random unit but map is protect! :(



None.

Sep 10 2007, 8:27 am LemonFang Post #2



Randomize switches, with the units you want to create, of course I explained this rather lazily, if you don't get it, I'm sure someone else can explain it more in depth.



None.

Sep 10 2007, 8:29 am Clokr_ Post #3



You'll have to use switch randomization. The basic idea behind it is to randomize a specific number of switches so afterwards you can check each combination to archieve a different effect. Per example:

Trigger
Players

  • P1
  • Conditions

  • Always
  • Actions

  • Randomize Switch 1
  • Randomize Switch 2
  • Randomize Switch 3


  • Trigger
    Players

  • P1
  • Conditions

  • Switch 1 is cleared
  • Switch 2 is cleared
  • Switch 3 is cleared
  • Actions

  • Create unit A


  • Trigger
    Players

  • P1
  • Conditions

  • Switch 1 is cleared
  • Switch 2 is cleared
  • Switch 3 is set
  • Actions

  • Create unit B


  • Trigger
    Players

  • P1
  • Conditions

  • Switch 1 is cleared
  • Switch 2 is set
  • Switch 3 is cleared
  • Actions

  • Create unit C


  • ...


    All the possible combinations would be:
    Code
    clear clear clear
    clear clear set
    clear set clear
    clear set set
    set clear clear
    set clear set
    set set clear
    set set set


    You'd have to create a trigger for each of them.

    More generally you can archieve up to 2^n (2 to the n) different effects using n switches (in that example 3 switches mean 2^3 = 8 possibilities).



    ?????

    Sep 10 2007, 9:57 am Obzio Post #4



    10x Clokr_! :}
    It's Work...finaly! ^^



    None.

    Sep 10 2007, 1:06 pm Falkoner Post #5



    Another way is to have a deathcount going constantly up to the amount of different units you have, and then being reset, and you make a trigger for each death, this allows you to stray off the binary powers much more easily.



    None.

    Sep 10 2007, 8:54 pm Money Post #6



    Quote from Falkoner
    Another way is to have a deathcount going constantly up to the amount of different units you have, and then being reset, and you make a trigger for each death, this allows you to stray off the binary powers much more easily.

    The switches part works better I believe, when you do it with death counters it seems to hit some options more than others.



    None.

    Sep 10 2007, 10:32 pm Falkoner Post #7



    Death counters with hyper triggers are almost completely random, and if you want to make them really random, just randomize a switch, and add 1 or 2 depending on whether it is cleared or set.



    None.

    Sep 10 2007, 11:15 pm JaBoK Post #8



    Or do it the binary death counter way, where it actually generates a random number.



    None.

    Sep 11 2007, 1:29 am Clokr_ Post #9



    Generating random numbers have an advantage: you can set different probabilities for the different effects that can be archieved.
    e.g. if you get a random number between 0 and 99 you could make thing A happen if the number is at most 30, thing B happen if it is at most 75 and thing C happen if it at most 99. So the probability of A to happen would be 30%, B's 45% and C's 25%.



    ?????

    Sep 11 2007, 1:42 am Fallen Post #10



    Hey man things about random triggers for creating units is that after awhile you will start seeing certain units more then other. For instance in "Random Unit Wars" you had a strong chance of getting ghosts for the first 5 units. Also, seeing infested was very common with full house. So when you play your game and you plan on making more versions of it. Watch for that and attempt to balance it.

    Seeing favorites is very uncommon but sometimes they are prominit.



    None.

    Sep 11 2007, 1:44 am Demented Shaman Post #11



    Quote from Clokr_
    Generating random numbers have an advantage: you can set different probabilities for the different effects that can be archieved.
    e.g. if you get a random number between 0 and 99 you could make thing A happen if the number is at most 30, thing B happen if it is at most 75 and thing C happen if it at most 99. So the probability of A to happen would be 30%, B's 45% and C's 25%.
    That's the type of system I used in my improved Pokemon map. :D



    None.

    Sep 14 2007, 2:15 pm spinesheath Post #12



    Quote from Fallen
    Hey man things about random triggers for creating units is that after awhile you will start seeing certain units more then other. For instance in "Random Unit Wars" you had a strong chance of getting ghosts for the first 5 units. Also, seeing infested was very common with full house. So when you play your game and you plan on making more versions of it. Watch for that and attempt to balance it.

    Seeing favorites is very uncommon but sometimes they are prominit.

    There are two possibilities:
    1) The "random"-triggers of those maps are favoring some units, similar to what Clokr_ said about the 0-99 DC.
    2) You are seeing things. Starcraft's randomizer does not create the same numbers all the time - it probably uses some clock to seed like most randomizers. Since the time at which someone starts a game can be considered "random" in this context, SC's randomizer creates "random" values. Now if you are seeing more units of one type than you see of another and possibility 1) is false, nothing is wrong yet. You have to play MANY games to be able to say that there is something wrong with a probability of X percent.



    None.

    Sep 15 2007, 1:11 am Clokr_ Post #13



    Quote from spinesheath
    Quote from Fallen
    Hey man things about random triggers for creating units is that after awhile you will start seeing certain units more then other. For instance in "Random Unit Wars" you had a strong chance of getting ghosts for the first 5 units. Also, seeing infested was very common with full house. So when you play your game and you plan on making more versions of it. Watch for that and attempt to balance it.

    Seeing favorites is very uncommon but sometimes they are prominit.

    There are two possibilities:
    1) The "random"-triggers of those maps are favoring some units, similar to what Clokr_ said about the 0-99 DC.
    2) You are seeing things. Starcraft's randomizer does not create the same numbers all the time - it probably uses some clock to seed like most randomizers. Since the time at which someone starts a game can be considered "random" in this context, SC's randomizer creates "random" values. Now if you are seeing more units of one type than you see of another and possibility 1) is false, nothing is wrong yet. You have to play MANY games to be able to say that there is something wrong with a probability of X percent.


    I can tell that SC's random number generator is not as good as it'd be expected. All you have to do is create a map with a whole lot of units and set them to junk yard dog (critters will also work). You'll probably get zones where the critter density is higher the whole game (maybe it has to do with them trying to go through the map edges, but I don't think so...).



    ?????

    Sep 15 2007, 1:27 am Demented Shaman Post #14



    Quote from Fallen
    Why are so many people trying to make pokemon games?
    I didn't make it, I just edited one of the original ones, and I did it a long time ago too mainly for a clan and friends who liked to play the map.
    http://www.staredit.net/?topic=35



    None.

    Sep 16 2007, 4:57 pm DT_Battlekruser Post #15



    Quote from Clokr_
    Generating random numbers have an advantage: you can set different probabilities for the different effects that can be archieved.
    e.g. if you get a random number between 0 and 99 you could make thing A happen if the number is at most 30, thing B happen if it is at most 75 and thing C happen if it at most 99. So the probability of A to happen would be 30%, B's 45% and C's 25%.

    That and switches are as "truly" random as you can get in Starcraft. Although I suppose it's a question as to how true Starcraft's Random function is.

    Quote from Fallen
    Hey man things about random triggers for creating units is that after awhile you will start seeing certain units more then other. For instance in "Random Unit Wars" you had a strong chance of getting ghosts for the first 5 units. Also, seeing infested was very common with full house. So when you play your game and you plan on making more versions of it. Watch for that and attempt to balance it.

    Seeing favorites is very uncommon but sometimes they are prominit.

    You're very likely just seeing things. It's easy to be tricked into feeling like you can predict the outcome of any random generator, a good one or not.




    None.

    Sep 16 2007, 5:16 pm OfficerTJHooker Post #16



    Question. Would it be possible to create a random unit by having a group of units in one area, and labeling a location over all of them, and then when they are needed you just have to use a trigger like (Teleport 1 men at location ____).

    I thought of that and I think it might be possible. Of course, I never tried it cause I never really had a use for a random unit. It could screw up and always give you the same unit every play through. What do you guys think, since your all veterans at map making and stuff.



    None.

    Sep 16 2007, 6:03 pm DT_Battlekruser Post #17



    An action that affects one unit at LOCATION will always choose the left-most unit at LOCATION. That is what the Junkyard Dog method described above uses, but it is by far the most imprecise of the methods listed.



    None.

    Sep 16 2007, 6:23 pm TricksOfDeath Post #18



    But thats the point :><: so its COMPLEATLY random not just switch fire with the random unit though it sometimes never reaches the location so usualy it has to be a confined space and sometimes it just freezes ^^. I personaly say switch/unitcreation for best results. For instance have swith 255 set when switchs 1,2,3 are set and a unit created when switch 255 is created thus making SURE a player is picked incase of trigger misfire, also switchs can be "nulled" if some one lags as soon as the game starts so make sure you do have hyper triggers built into the map if you are using the switchs, but then again having a fail safe system cant be beat. ^^



    None.

    Sep 18 2007, 10:34 pm Esponeo Post #19



    The Randomize Switch option has been thoroughly tested by members of (U)UnKnOwN and does in fact generate acceptably random numbers.



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [07:46 am]
    RIVE -- :wob:
    [2024-4-22. : 6:48 pm]
    Ultraviolet -- :wob:
    [2024-4-21. : 1:32 pm]
    Oh_Man -- I will
    [2024-4-20. : 11:29 pm]
    Zoan -- Oh_Man
    Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
    You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
    [2024-4-20. : 8:20 pm]
    Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
    [2024-4-20. : 8:20 pm]
    Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
    [2024-4-20. : 8:18 pm]
    Ultraviolet -- Oh_Man
    Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
    oh ya I saw that when Armo posted it on Discord, pretty crazy
    [2024-4-20. : 8:09 pm]
    Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
    [2024-4-20. : 8:09 pm]
    Vrael -- woo baby talk about a time crunch
    [2024-4-20. : 8:08 pm]
    Vrael -- Oh_Man
    Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
    so that gives me approximately 27 more years to finish tenebrous before you get to it?
    Please log in to shout.


    Members Online: lil-Inferno