Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: creating units at random locations
creating units at random locations
Jul 2 2009, 5:20 am
By: crutex  

Jul 2 2009, 5:20 am crutex Post #1



here's a fun question
what's the best way to go about creating units at random locations across a map or within an area?
i suspect that i'm not going to like the answers to this :C



None.

Jul 2 2009, 6:11 am FatalException Post #2



Randomize lots of switches, and, depending on the outputs, create units. It's pretty simple, really. For example:

Randomizing switches
PLAYERS
  • Anyone
CONDITIONS
  • Always
ACTIONS
  • Randomize Switch 01.
  • Randomize Switch 02.
  • Wait x milliseconds.
  • Preserve trigger.

Creating units
PLAYERS
  • Unit haver
CONDITIONS
  • Switch 01 is cleared.
  • Switch 02 is cleared.
ACTIONS
  • Create 1 Terran Marine at Location 0.
  • Preserve trigger.

Creating units (location 1)
PLAYERS
  • Unit haver
CONDITIONS
  • Switch 01 is cleared.
  • Switch 02 is set.
ACTIONS
  • Create 1 Terran Marine at Location 1.
  • Preserve trigger.

And so on.

Post has been edited 3 time(s), last time on Jul 2 2009, 6:19 am by FatalException. Reason: Thanks for not fixing [trigger], IP :(



None.

Jul 2 2009, 6:27 am Falkoner Post #3



Generate a random number using Single Switch Randomization, then have several triggers give away zerglings until that number reaches 0, and place burrowed zerglings all over the map, then center the creation location on the next zergling, once the random number reaches 0.



None.

Jul 2 2009, 6:29 am Vrael Post #4



Alternately you could combine randomization of switches with existing locations and mobile grid movements, just to save a few locations.

Something like
•Series of randomization triggers to determine which pre-existing location to pick
•Series of randomization triggers to determine which mobile grid movement to make
•Series of spawn triggers



None.

Jul 2 2009, 10:19 am JaFF Post #5



So far you've been given three possible solutions. Please note that:

FatalExceptions solution works only if the area you want to create units in is not too big and you can spend a location per spawning point.

Falkoners solution (even though not described in too much detail :P ) requires only one location, which is much better than a location per spawning point. However, if you are planning on spawning large amounts of units constantly and over a large area, this method will be quite lag-intensive. Not saying that it will definitely cause lag, but it will make your map more prone to lag (say, if you add another lag-prone system that would not lag on its own, the combination of those two systems may cause real lag).

Vraels solution is location effective also. However, it is lag-prone when used on big maps with constant spawns and it is incompatible with air units (meaning that you cannot have any air units in the area of the spawns). I must say that it adds a bit more flexibility and potental coolness to the system, as it allows to spawn enemies at random locations with tile accuracy.

So you must tell us what is the environment of the map, so we can pick (and then explain in more detail) the best solution for you.



None.

Jul 2 2009, 1:25 pm crutex Post #6



I know the basic (weak) solutions like FatalException's but I'll have a look at Falkoner's. I just remembered that junkyard dog could come into play perhaps but I wouldn't want too many units even cloaked just randomly wandering around the map. I was trying to avoid exactly what FatalException proposed (set spawn points that are randomly chosen from) because I wanted to not cover my map in spawn points, but distribute the units over the map.

edit: falkoner's just looks like the same thing but with 1 switch.. how would it require only 1 loc?

I don't even remember why I asked this question I think I was just curious :bleh:

Post has been edited 2 time(s), last time on Jul 2 2009, 2:00 pm by crutex.



None.

Jul 2 2009, 4:32 pm Pyro682 Post #7



You could just have Observers all over the map, and have a location cycle through (Via Giving) and then just put those observers on Junkyard Dog AI.



None.

Jul 2 2009, 6:10 pm Falkoner Post #8



Quote
edit: falkoner's just looks like the same thing but with 1 switch.. how would it require only 1 loc?

Sorry, I was in a hurry when explaining it.

So, you place burrowed units all over your map, wherever you want a spawning point to possibly be, so let's say you place 64 burrowed units, you'd then use Single Switch Randomization to put a random number between 0 and 63 into a death count. Then you'd have a trigger something like this:

Conditions:
If Player x has suffered at least 1 death of "Random Number"
Switch "Create Unit" is set
Actions:
Set Deaths for Player x of "Random Number": Subract 1 death.
Give 1 "Burrowed Unit" owned by Player x at Anywhere to Player y
Preserve Trigger

Of course, if you wanted it to happen instantly, you'd have to copy the above trigger 63 times, which isn't very space effective, and causes lag, so you'd probably want to use Binary Countoffs instead, here's how they would look:

Collapsable Box


And that should give away your random number of burrowed units from Player x to Player y, you'd then have a trigger to center a location on the next unit, the one that you would be spawning at, and to reset the entire system, like this:

Conditions:
Switch "Create Unit" is set
Actions:
Center location "Spawn Point" on "Burrowed Unit" owned by Player x at "Anywhere"
Create 5 "Monster" at location "Spawn Point" for Player m
Give All "Burrowed Unit" owned by Player y at Anywhere to Player x
Preserve Trigger

And that's how the system would work, it'd only use one location, one switch, and one death, and a burrowed unit for every possible spawn point.

If you're having problems with the unit limit, or the players might see the burrowed units, I would recommend using Vrael's system, although it may cause issues with terrain.



None.

Jul 2 2009, 8:54 pm FatalException Post #9



Well, you should have specified what you weren't looking for in your first post... I interpreted locations as meaning locations that you had placed, not just places on your map.

Personally, I would use Pyro682's solution, as it wouldn't just be choosing from pre-existing areas, so players couldn't figure out where things can spawn (you said in your last post that you didn't want that). Also, it's rather simple, and I usually go with simple being best. You could also merge Pyro682's and Falkoner's ideas to make it so a random number of randomly moving observers would spawn units...



None.

Jul 3 2009, 1:16 am crutex Post #10



Quote from FatalException
Well, you should have specified what you weren't looking for in your first post... I interpreted locations as meaning locations that you had placed, not just places on your map.
No big deal I appreciate your post anyways. I'll consider the other methods when I remember why I wanted this :bash:



None.

Jul 5 2009, 4:55 pm Conspiracy Post #11



Quote from crutex
Quote from FatalException
Well, you should have specified what you weren't looking for in your first post... I interpreted locations as meaning locations that you had placed, not just places on your map.
No big deal I appreciate your post anyways. I'll consider the other methods when I remember why I wanted this :bash:

You could always use a location grid with randomized coordinates in a specified area, this would allow creation of units anywhere on the map, very nearly instant.

The Pros:
Fast Creation. Giving units takes some time (Falks Way)*
Randomization. This can place anywhere within a specified area, without the need for constraints to a specific location to randomly spawn (Burrowed Zerglings).

The Cons:
Lots of locations (usually about map size [ex: 64x64 would require about 64 locations])
Complicated.

*unless you did this in 1 trigger cycle.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
[2024-5-04. : 1:05 am]
Vrael -- that's better
[2024-5-04. : 12:39 am]
NudeRaider -- can confirm, Vrael is a total madman
[2024-5-03. : 10:18 pm]
Vrael -- who says I'm not a total madman?
[2024-5-03. : 2:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
Please log in to shout.


Members Online: Ultraviolet, O)FaRTy1billion[MM]