I have a map where I randomly place enemy structures and units (the structures can spawn enemies and/or give rewards) over time. The placements are meant to be random to increase replayability and unpredictability each time. Ignoring edge cases (like not spawning inside someone's base), the simplest solution I've found is Junk Yard Dog with a small air unit, like Protoss Observer, that flies around the map and periodically drops these random units.
I know Warcraft 3/JASS for example solves this by allow you to simply generate random points within a region/location/radius. I wouldn't be surprised if EUDs allowed a similar approach, but for this discussion no EUD solutions.
That can work decently, but it has some flaws because players can follow the observer to find out where things will go, and I've heard that the Junk Yard Dog script isn't actually true random movement but tends to clump units in a certain direction (correct me if this isn't the case).
One alternative I've been considering is to have a set of "evenly" spaced locations around the map (e.g. think like N points evenly spaced out along/within a circle/location). At some interval T, go through each point and do the following:
* flip a (weighted) coin to decide if a unit should be spawned near that location
* if heads, create a small fast air unit like Scourge or Protoss Observer
* randomly choose another point/location as the destination for that air unit
* start a small death counter timer (you could randomize this too for added variability)
* when the timer ends, drop the payload at the air unit's location (e.g. move the spawned structure)
So I'm wondering if this sort of system has been used before. It's more complicated and requires tuning a lot of things: the weight of the coin flip, the terrain of the map (hard to place terrain is essentially making the coin flip more weighted in the tails/no spawn outcome), delay/time to allow air unit to move, which locations a source location can target, etc.
But I could see this solving the issue with the Junk Yard Dog / Protoss Observer approach.
What are other approches or thoughts here?
I did some "simulations" with Gemini. It's clearly not random but it does seem to cover many different places as shown in the diagram:
Attachments:
Post has been edited 1 time(s), last time on Apr 27 2025, 11:14 pm by sethmachine.
None.






