Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Random Team Chooser
Random Team Chooser
May 3 2009, 3:17 pm
By: newton2ii  

May 3 2009, 3:17 pm newton2ii Post #1



Hi,

I'm looking to make melee maps that have random team selection.

Everyone starts out like they normally would, split, build probes. Then within a few seconds even teams are chosen. You will automatically be allied and visioned by your team mates.

Any help is appreciated.

Thank You

Post has been edited 1 time(s), last time on May 3 2009, 4:57 pm by newton2ii.




May 3 2009, 4:59 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

The only way I see is brute forcing it. Maybe the process can made more efficient, but I don't know how right now...
Triggers and idea in details:


Post has been edited 3 time(s), last time on May 5 2009, 9:37 am by NudeRaider.




May 3 2009, 5:37 pm newton2ii Post #3



Thanks for the quick reply. I'm actually a nooby at this stuff. I'm going to try and wrap my head around it.

Thanks Alot



None.

May 3 2009, 5:44 pm Madroc Post #4



Alternatively, could you check the "random start locations" and put them all in one force? Then when you build the probe or whatever, set alliance status for the players in team one to enemy for the players in team two, and vice versa.

That would be much much easier if you only have to randomize the teams once.




None.

May 3 2009, 5:55 pm newton2ii Post #5



Alright,

First confusion:
All Players
C: Always
A: Set Current Player's death counts of "I'm here" to 1

is A: Set Deaths? If so I am not able to set death for unit "i'm here"
however I am able to set switch 1

Or do you mean that I should assign something like a "Flag" to stand in for "I'm here" and "Uraj Crystal" for "Teams Assigned"

??



None.

May 3 2009, 5:56 pm Pigy_G Post #6



I think you overcomplicated it a bit nude..

You could just run a single random switch for each player and depending on weather its set, team A or cleared team B. Once there are 4 players on team A or B, send all players without a team to the opposite team.



None.

May 3 2009, 5:59 pm newton2ii Post #7



Quote from name:Mallard Fillmore
Alternatively, could you check the "random start locations" and put them all in one force? Then when you build the probe or whatever, set alliance status for the players in team one to enemy for the players in team two, and vice versa.

That would be much much easier if you only have to randomize the teams once.

I do only have to randomize teams once a game; at the begining. But locations are already randomised and all in one force. What then? How does this work to randomize teams?



None.

May 3 2009, 6:17 pm Wormer Post #8



Quote from newton2ii
I do only have to randomize teams once a game; at the begining. But locations are already randomised and all in one force. What then? How does this work to randomize teams?

If you have all players in one force with the "Random Start Locations" flag checked then make the first four players be in the first team and the others at the second. As far as locations are randomized noone knows what player number would be the particular player in lobby.



Some.

May 3 2009, 8:31 pm NudeRaider Post #9

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from name:Mallard Fillmore
Alternatively, could you check the "random start locations" and put them all in one force? Then when you build the probe or whatever, set alliance status for the players in team one to enemy for the players in team two, and vice versa.

That would be much much easier if you only have to randomize the teams once.

Quote from Pigy_G
I think you overcomplicated it a bit nude..

You could just run a single random switch for each player and depending on weather its set, team A or cleared team B. Once there are 4 players on team A or B, send all players without a team to the opposite team.
To both of you, how do you determine teams when everyone is in the same force?
You have to set a dc and dependent on that dc set the alliances. That's what I'm doing.
Or is there an easier way for a trigger that allies everyone with everyone that has the same dc count / switch / whatever variable to define teams?


Quote from newton2ii
Alright,

First confusion:
All Players
C: Always
A: Set Current Player's death counts of "I'm here" to 1

is A: Set Deaths? If so I am not able to set death for unit "i'm here"
however I am able to set switch 1

Or do you mean that I should assign something like a "Flag" to stand in for "I'm here" and "Uraj Crystal" for "Teams Assigned"

??
Do you know what death counts are? And how to use them as variables? If not, read the wiki.
Just so much ahead: Switches are global binary variables and dcs can have more than only 0/1 values and every player has its own count. Just rename an unused unit like neutral -> neutral -> cantina to "I'm here" and you got yourself a fully customizable variable.
If after reading the wiki you still have questions, shoot ahead.


Quote from Wormer
If you have all players in one force with the "Random Start Locations" flag checked then make the first four players be in the first team and the others at the second. As far as locations are randomized noone knows what player number would be the particular player in lobby.
That was what I thought of first, but then I thought P1 in the lobby must also be P1 in the game or triggers would get confused. Well, then I guess my massive trigger system was for nothing. lol




May 3 2009, 10:57 pm newton2ii Post #10



I was actually understanding Nude's method but I have pressed refresh and he has removed the post.

Wormer; I don't know how to do what you are saying. If it's that simple can you lay it out more clearly?

I already have everyone under "Force 1" and I have "Random Start Locations" checked.

Now what?

How do I put anyone on any team?



None.

May 4 2009, 5:56 am Wormer Post #11



After you have done this.
Quote from newton2ii
I already have everyone under "Force 1" and I have "Random Start Locations" checked.
You simple have to make triggers which put P1-4 into the first team and others into the second.

For example:
Quote
TRIGGER
OWNERS: P1, P2, P3, P4
CONDITIONS:
Always()
ACTIONS:
Set Player 1 to Allied Victory.
Set Player 2 to Allied Victory.
Set Player 3 to Allied Victory.
Set Player 4 to Allied Victory.

Run AI script 'Turn ON Vision for player 1'.
Run AI script 'Turn ON Vision for player 2'.
Run AI script 'Turn ON Vision for player 3'.
Run AI script 'Turn ON Vision for player 4'.
ENDT

TRIGGER
OWNERS: P5, P6, P7, P8
CONDITIONS:
Always()
ACTIONS:
Set Player 5 to Allied Victory.
Set Player 6 to Allied Victory.
Set Player 7 to Allied Victory.
Set Player 8 to Allied Victory.

Run AI script 'Turn ON Vision for player 5'.
Run AI script 'Turn ON Vision for player 6'.
Run AI script 'Turn ON Vision for player 7'.
Run AI script 'Turn ON Vision for player 8'.
ENDT
But this method essentialy requires 8 players, so you can put a failsafe:
Quote
TRIGGER
OWNERS: All Players
CONDITIONS:
Elapsed scenario time is at most 2 game seconds.
All Players command At Most 7 Buildings.
ACTIONS:
Display text message: "\x013Full house required to play".
End the scenario in a draw for all players.
ENDT
This is the limitation of the simple method. The The Nude Raider's method with "Randomizing via Triggers" could be improved to randomize teams depending on number of players starting the game. So that this will be an 1v1 game when two players joined, 2v2 when there are 4 players, 3v3 when 6 and 4v4 when full house.

Also this system doesn't force players the alliance status and vision. They could change alliances and vision afterwards (as in a melee game though). This everything could be done if you need.

Also there could be done a system which puts a defeated player as an observer. Alive players from the other team could ban observers via setting enemy and from home team via unallying.

Post has been edited 7 time(s), last time on May 4 2009, 6:06 am by Wormer.



Some.

May 4 2009, 7:07 am killer_sss Post #12



Quote from Wormer
This is the limitation of the simple method. The The Nude Raider's method with "Randomizing via Triggers" could be improved to randomize teams depending on number of players starting the game. So that this will be an 1v1 game when two players joined, 2v2 when there are 4 players, 3v3 when 6 and 4v4 when full house.



Also there could be done a system which puts a defeated player as an observer. Alive players from the other team could ban observers via setting enemy and from home team via unallying.

or you could just do it your way and put player 1,3,5,7 on a team and 2,4,6,8 on a team that way if less that a full house comes in they will be allied no matter what. Or you could just tell them to move down to slots 5678 when less than full house.

Quote
Also this system doesn't force players the alliance status and vision. They could change alliances and vision afterwards (as in a melee game though). This everything could be done if you need.

mmmmm fun. Back stabbing time lol!



None.

May 4 2009, 7:24 am Wormer Post #13



Quote from killer_sss
or you could just do it your way and put player 1,3,5,7 on a team and 2,4,6,8 on a team that way if less that a full house comes in they will be allied no matter what. Or you could just tell them to move down to slots 5678 when less than full house.
That does not matter as far as locations are randomized.



Some.

May 4 2009, 1:23 pm Oo.DaMeiN.oO Post #14



You could set it according to their minereals if you want actual even teams.

I was thinking something like this..

( I don't re-call the exact amount it is that you get from 4 minereal returns so x will represent that number. Also the unit will be labeled as U )

Code
P1 Accumalates at least x Minereals
P2 Accumalates less than x Minereals
P3 Accumalates less than x Minereals
P4 Acculamates less than x Minereals


Modify death counts for current player Set To 1 (Anything. IE; Marine. For this it will be just U )


Code
P1 has suffered at least 1 deaths of (U)
P2 Accumalates At Least x Minereals
P3 Accumalates less than X Minereals
P4 Accumalates less than X Minereals

Modify death counts for current player set to 2 (U)


Code
P1 has suffered at least 1 deaths of (U)
P2 has suffered at least 1 deaths of (U)
P3 Accumalates at least X Minereals
P4 Accumalates less than X Minereals

Modify death counts for current player set to 3 (U)


Code
P1 has suffered at least 1 deaths of (U)
P2 has suffered at least 1 deaths of (U)
P3 has suffered at least 1 deaths of (U)
P4 Accumalates at least X Minereals

Modify death counts for current player set to 4 (U)


Code
P1 Has suffered exactly 1 (Unit)
P4 Has Suffered Exactly 4 (Unit)

Share Vis/Ally


Do this accordingly for your players, you'll have to use a lot of triggers, but it will be pretty accurate if you set teams up according to split timing.

Post has been edited 1 time(s), last time on May 4 2009, 1:51 pm by Oo.DaMeiN.oO.



None.

May 4 2009, 2:05 pm newton2ii Post #15



Wormer: I do need it to recognize 1v1 2v2 3v3 4v4. Also I'm adding a feature where people who lift within first 10 seconds become observers.

Oo.DaMeiN.oO: Excellent. I was thinking along these lines but I'm having a tough time figuring it out as I've never done these things before; so figuring out the logic is kinda fun.

I'll start working on it after work today; In about 11 hours.



None.

May 4 2009, 2:11 pm NudeRaider Post #16

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from newton2ii
I was actually understanding Nude's method but I have pressed refresh and he has removed the post.

Wormer; I don't know how to do what you are saying. If it's that simple can you lay it out more clearly?
I already have everyone under "Force 1" and I have "Random Start Locations" checked.
Now what?

How do I put anyone on any team?
I haven't removed it. It's in a collapse box. Press on the small '+' icon on the right inside the post.

And actually I still recommend using parts of what I did when you go for Wormer's suggestion because should still have some kind of player number detection, so you know how many to put in a team.
Then a simple matter of allying P1 with P2 and P3 with P4 for 2v2, P1 with P2 & P3 and P4 with P5 & P6 and so on. Preserve this trigger if you want to prevent backstabbing.




May 4 2009, 2:42 pm Oo.DaMeiN.oO Post #17



Also, I forgot to add that you'll need to make triggers incase of ties ( Which in public games shouldn't happen TOO often )



None.

May 4 2009, 5:01 pm Wormer Post #18



Quote from NudeRaider
Then a simple matter of allying P1 with P2 and P3 with P4 for 2v2, P1 with P2 & P3 and P4 with P5 & P6 and so on. Preserve this trigger if you want to prevent backstabbing.
No Nude, in this case
Quote from newton2ii
I do need it to recognize 1v1 2v2 3v3 4v4.
he needs your system (or similar) with improvements, because you never know what player numbers would be with random start locations. It can happen that P1, P3, P5, P8 are playing a 2v2 game though they were number 1-4 in the lobby. Everything gets more complex in this case.

EDIT:
Ah, finally I remembered what is bad with random start locations! With random start locations noone knows who will be the particular player number in game and thus the starting position, but the particular player number (whoever it will be) will always start on the same spot! That way team arrangements are predefined, which is not good! That why we need in-game randomization via triggers.

Post has been edited 3 time(s), last time on May 4 2009, 5:12 pm by Wormer.



Some.

May 5 2009, 3:36 am newton2ii Post #19



Quote
EDIT:
Ah, finally I remembered what is bad with random start locations! With random start locations noone knows who will be the particular player number in game and thus the starting position, but the particular player number (whoever it will be) will always start on the same spot! That way team arrangements are predefined, which is not good! That why we need in-game randomization via triggers.


Exactly. That's a problem I had with this method all along.



None.

May 5 2009, 7:44 am Wormer Post #20



I written triggers that will randomize teams in-game accordingly on number of players. I used DaMeiN's ideas of randomization via resources. Unfortunately I haven't got enough time to explain everything now. Also I'm not 100% sure this has no errors. I written triggers in MacroTriggers syntax which I specify below. If you're hard at reading this syntax I also have it written in SCMD text triggers syntax: download SCMD text triggers file.

Triggers in MacroTriggers syntax

Download MacroTriggers file.

Hope this will help.

EDIT: I've realized there is an error. I suggest you find and fix it.

Post has been edited 6 time(s), last time on May 5 2009, 9:00 am by Wormer.



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
Please log in to shout.


Members Online: RIVE, Roy, O)FaRTy1billion[MM], 3gabriellae243wh1