Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Unit Randomization and then mimic it
Unit Randomization and then mimic it
May 22 2017, 12:36 am
By: LoveLess  

May 22 2017, 12:36 am LoveLess Post #1

Let me show you how to hump without making love.

So I have 100+ units pre-placed in an area that make up a "small" grid. What I want to do is go through these and randomly select four of them to remain.

However, there are four conditions.

The first of them is that the first is limited to the outer edge of the grid, no big deal. I did this by just giving away everything besides the outermost units and then randomize among them.

The second is that they can never be next to each other, which again I solved by removing all the neighboring locations when the last unit is chosen.

The third is aimed to achieve a more broad spectrum of random units and as such only units that are intended to be skipped cannot be removed (aside from condition two) and reused again in the next cycles. Only remove the remaining units once all four have been selected.

The final is that I want the results of this randomization to be duplicated for four other sets of 100+ units. Not that big of a deal... but-

I am having issues with getting what feels like a pure random result. They always seem to wind up on the same few results. Without posting my long list of inefficient triggers that I have made now out of frustration, how would you go about achieving this?



None.

May 22 2017, 3:28 am rockz Post #2

ᴄʜᴇᴇsᴇ ɪᴛ!

Start with your grid of units, which I assume are the same.

Count the number of units with countoffs and store it in a DC.

Generate a random number from 0-DC.

Repeat the random number generation if it's bigger than DC. Save this number in DC4 for use later.

Give random number units to player 2 and make the next one owned by a player 3.

Remove all units owned by player 2 around player 3.

Give all units owned by player 3 to player 4.

Repeat until player 4 has 4 units.

Copy DC4 into DC3, DC3 into DC2, DC2 into DC1.

You can likely save players through other methods like a burrowed zergling, or other logic.

Post has been edited 1 time(s), last time on May 22 2017, 3:49 am by rockz.



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

May 22 2017, 8:08 pm Moose Post #3

We live in a society.

Is there a requirement that this randomization be done in a maximum number of trigger cycles?




May 22 2017, 8:42 pm CecilSunkure Post #4



OK, this is going to be a very weird way to do this... But. If you generate a lot of triggers with a higher level language, it can be pretty easy to pick 4 spots and then spawn those units. If you have 128 locations, get a random DC from 0-127. Then hand this DC off to the "spawner" triggers, which are all very similar to one another. Basically 128 triggers, each will spawn the individual unit. I'm assuming you've already worked out a way to spawn the units? 128 burrowed zerglings would work perfectly fine. Each zergling can act as a unique location via the Give Units action.

Can be done in a single trigger cycle.



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: Ultraviolet