Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: How to make it so scourges appear at random
How to make it so scourges appear at random
Mar 25 2010, 11:22 pm
By: m.0.n.3.y  

Mar 25 2010, 11:22 pm m.0.n.3.y Post #1



So, how do I make it so I create Scourges at random locations (probably about 30 in all) at random times. There will be a 30 second timer, and as the 30 seconds expires, more should start appearing. I know about randomization but how do I implement it to do this?

I just got an idea as I was writing this. I guess I could create a switch for each location, and create a 30 second death counter, and at every death randomize a switch...but that's so many triggers/so much time. With this method, it would also be kind of predictable because every time it would randomize the same switches in the same order. Ex: deaths = 5 randomize switch 5, deaths = 4 randomize switch 4 etc. And it would do this same pattern every time. I also want it to be more random than that. So for example, when deaths = 5, a scourge can be created for the location for switch 5 or 4. Is there way to do it?



None.

Mar 25 2010, 11:46 pm Lanthanide Post #2



It is easy to make a random number between 1-30 that can be any number each time.

If you want a random number with no repeats, eg pick 30 random numbers between 1-30 until all numbers have been used up, that is much more difficult to do in a timely manner in SC. This is because we basically only get 1 shot at executing something every trigger cycle, so if you select a random number that has already been chosen before, for this present cycle you either:
1) can't generate any output (because it would be repeated), or
2) need to run the trigger again in the hopes that you'll get a non-repeated number

#2 means you'll end up with many many copies of the same trigger, and you're still never 100% guaranteed that you will always get unique output: if you have 30 copies of your trigger, and you are trying to generate number 26, all 30 copies of that trigger could easily generate any number but 26, and so you're left with a trigger cycle where you couldn't generate output.

There's a thread on advanced randomization, but I can't find it using search at the moment. Hopefully someone else will be able to link to it.



None.

Mar 25 2010, 11:47 pm JaFF Post #3



You know how to randomize a number between 1 and 30. If you don't, look at my randomizer map in the DLDB.

To randomize the time between the spawns, have a deathcounter representing the intensity of the spawns. Increase it by 1 every 30 seconds. For each value the intensity deathcounter can take, you have a distribution that assigns values to another deathcounter, called, say, "time to next spawn". Obviously, the larger the intesnity DC, the smaller the values of the 'time to next spawn' deathcounter.



None.

Mar 25 2010, 11:56 pm Lanthanide Post #4



I can't edit my post, but I found the thread, which I think Jaff is also talking about above:

http://www.staredit.net/topic/9099/#191211

You can considerably cut down the number of intervals (or 'buckets') used in this system. Get rid of all of the 100's section, and cut the 10's section down to just 0, 10, 20. You also don't need to count up to 2^21, 2^10 or so is accurate enough for most purposes: some numbers will be chosen 99 times out of 1000, and others 100 times out of 1000 - such a small difference that no one will notice in practice.



None.

Mar 26 2010, 12:05 am Vrael Post #5



If you're going to have 30 spawn locations for the scourages, you may want to consider using burrowed units instead. I have an area in my map where 4-5 different units spawn in 8-10 random locations (and simultaneously die, but thats beside the point) so instead of having triggers to spawn at each location, have the triggers give 1-29 burrowed units to a neutral/different player, center a small location on a remaining burrowed unit for that player, spawn the scourage, then give the burrowed units back. If you do this it could cause lag, but once every 30 seconds shouldnt matter hardly.



None.

Mar 26 2010, 12:20 am CecilSunkure Post #6



Yeah, I like Vrael's suggestion of using burrowed units. Also, since you are going to be doing this rhythmically (once every 30 seconds), you are going to need some advanced randomization, otherwise the results may appear in a predictable pattern.

I suggest making the amount of scourges a number that fits into the equation 2^(x-1), which could include 4, 8, 16, 32, 64, etc. This way, you can use an advanced randomization technique easily. The square root of 64 is 8, and the square root of 16 is 4. You can use an 8x8 or 4v4 square in conjunction with a form of single switch randomization.

All in all, I'm guessing the spawning system should take about 30-50 triggers?



None.

Mar 26 2010, 7:37 pm Aristocrat Post #7



The way I implemented my random teleporter for C&M is like this:
-Place observers for players 9. 10, 11, and 12.
-Every once in a while, randomly order them to move to one of 4 locations (4 corners of the map in my case)
-If teleport is activated, randomize between the 4 obs, and move a location to the observer selected and move the unit that just teleported to the location.

So you can simply replace the last step with the creation of a scourge at the location instead.

NOTE: This has a bias to create them near the middle, but not too significant as it still simulates brownian motion to an extent.



None.

Mar 26 2010, 8:56 pm rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

If ya need any help understanding it, ask

It's not hard to randomize the timer either. You can move the devouring ones anywhere on the map, and it will work fine.



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

Mar 28 2010, 8:13 am poison_us Post #9

Back* from the grave

Here's a map I was fooling around a bit on. I actually got a lot further, but this was the latest version I could find. My old computer had the latest, but it's FUBAR now. I actually can't even remember if this map is recent enough to work, but hey :awesome:. It should actually use two sets of randomizations to send interceptors from a random spawnpoint to a random destination, if it's recent enough. If not, :blush:

EDIT: forgot to attach.


Post has been edited 1 time(s), last time on Mar 28 2010, 6:21 pm by poison_us.




Mar 28 2010, 9:30 am rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from poison_us
Here's a map I was fooling around a bit on. I actually got a lot further, but this was the latest version I could find. My old computer had the latest, but it's FUBAR now. I actually can't even remember if this map is recent enough to work, but hey :awesome:. It should actually use two sets of randomizations to send interceptors from a random spawnpoint to a random destination, if it's recent enough. If not, :blush:
Labyrinthos uses a nuclear missile to randomly place enemies throughout the place.

Post has been edited 1 time(s), last time on Mar 29 2010, 5:41 am by rockz.



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

Mar 29 2010, 3:24 am DavidJCobb Post #11



Here's a system for random timing on an event. It uses two death counters, one as a "base" (minimum) length and another as a randomization factor. It also uses a switch.

Trigger
Players
  • Player 1
  • Conditions
  • Always
  • Actions
  • Set deaths for Player 1: Add 1 to Alan Turret.
  • Randomize Switch 1.
  • Preserve trigger.

  • Trigger
    Players
  • Player 1
  • Conditions
  • Switch 1 is set.
  • Actions
  • Set deaths for Player 1: Add 1 to Cantina.
  • Preserve trigger.

  • Trigger
    Players
  • Player 1
  • Conditions
  • Player 1 has suffered at least 120 deaths of Alan Turret
  • Player 1 has suffered at least 12 deaths of Cantina
  • Actions
  • Create 1 Zerg Scourge for Player 1 at Anywhere
  • Set deaths for Player 1: Set Alan Turret to 0.
  • Set deaths for Player 1: Set Cantina to 0.
  • Preserve trigger.


  • I suppose that to increase the likelihood of the event over time, you'd add multiple copies of this trigger right before the second trigger in the list above:
    Trigger
    Players
  • Player 1
  • Conditions
  • <CONDITION FOR INCREASING LIKELIHOOD>
  • Switch 1 is cleared.
  • Actions
  • Randomize Switch 1.
  • Preserve trigger.


  • In your case, as the clock ticks down to 30 seconds, you'd start ramping up the likelihood (if you don't have enough Scourges). As for random spawn locations... I'm sorry, I didn't understand exactly what you wanted regarding spawn locations, I can't help you there. But the above triggers should help with random timing. (I'm actually using this system, without the increasing likelohood trigger, to play random Zerg sounds as ambient noise in a zombie-themed map I'm making. So I can attest to its functionality.)



    None.

    Mar 29 2010, 5:39 am rockz Post #12

    ᴄʜᴇᴇsᴇ ɪᴛ!

    The "mimimum" time will almost certainly be the limiting factor here. Re-randomizing a switch shouldn't do anything if it works properly (but then again, shuffling 1 time in the magic boxes should also work properly), unless you also add 1 after each randomization. It's like flipping a coin twice and ignoring the first flip.

    If you want to have a minimum time, it would be better to simply add to alan turret rather than cantina. That way you set a maximum and minimum time at the same time. If you use 120 in the trigger, then the minimum time it could take is 60 trigger runs, and the maximum is 120 trigger runs. Average would of course be 90, and it would be heavily weighted to the middle according to pascal's triangle at n=60. If you want an even spread of random values, rather than weighted towards the middle, you can generate a random number of the spread once and either add or subtract it to the DC.



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

    Mar 29 2010, 1:23 pm flagitious Post #13



    Quote from rockz
    Labyrinthos uses a nuclear missile to randomly place enemies throughout the place.

    How is this done? Nuke's on junkyard dog? (Rings a bell but I don't think I've ever seen that done.)



    None.

    Mar 31 2010, 5:38 am rockz Post #14

    ᴄʜᴇᴇsᴇ ɪᴛ!

    I don't actually know. It's either set generic command like a scarab/interceptor or JYD. Either way Nukes are the fastest unit in the game. It's too bad EUD actions are patched. You could make an observer have FFFFFFFF speed with FFFFFFFF acceleration on JYD to make them go anywhere, or a cloaked stacked drone. if you want to limit the area it can move via terrain.



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

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [03:27 am]
    m.0.n.3.y -- Maybe because it's an EUD map?
    [03:27 am]
    m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
    [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
    Please log in to shout.


    Members Online: Roy, lil-Inferno