Team System

Discussion in 'Plugin Development' started by Burnett1, Jul 11, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Burnett1

    Hey,

    Currently I'm trying to finish the Sky-Block Wars plugin and have got most of it done. What i am trying to do now is the team system. I'm trying to make it even and fair but cant get my head around the best way to do it. Can someone maybe help me out. Code is up on github. I know how to do one if i hard coded max players per team but i have it so they can customize it. Game class is where most of the stuff is. I am trying to split them between 4 teams.

    Thanks for any help.
     
  2. Offline

    Sessional

    Burnett1
    Can you better explain what it is you can't get at? What do you mean by even and fair?
     
  3. Offline

    Burnett1

    Sessional
    Well i need to split the players between 4 teams while allowing them to choose a team and still have the teams even so its not an unfair battle. So i cant have 6 people choose team red and 1 player get put in blue.
     
  4. Offline

    Sessional

    Burnett1
    Only add them to a new team if the size isn't bigger then the rest? Should just be an if statement.
    if team1.length < team2.length && team1.length < team3.length && team1.length < team4.length
    then add them to team 1
    else
    tell the player they can't join this team at the moment.

    You could use an ArrayList or a LinkedList to accomplish dynamic sized teams.
     
  5. Offline

    Burnett1

    Sessional
    I have done this but then comes the fact people can choose a team. Lets say the max per team is 4, 8 people join a game, 4 of those people choose to go in red and the other 4 get split by the game into yellow, green and blue. Doing that system would make two of them have 1 player and the other one have 2 players. Teams are then uneven.
     
  6. Offline

    Sessional

    Only put them in a team/allow them to join the team if the rest of the teams are the same size - these 4 people can't all join the same team unless the other teams happen to have players joining them.
    Say player 1 joins team 1.
    Player 2 can not join team 1 until someone joins team 2, 3 AND 4 to keep them even, so he joins 2
    Player 3 can only join player team 3 and 4 then
    Player 4 can only join whichever Player 3 can't join
    Correct?
     
  7. Offline

    Burnett1

    Ok, ill try something out and see if it works.
     
Thread Status:
Not open for further replies.

Share This Page