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.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: lizethetyler