[SM Plugin] Draft Pick

Discussion in 'Coding' started by Mikleo, Apr 19, 2017.

  1. Mikleo

    Mikleo Member

    Messages:
    43
    Likes Received:
    21
    Trophy Points:
    0
    !draft <0/1>
    enable disable draft mode

    !setcaptain <name>
    Sets the player as a captain, will assign to random team if both slots are free.

    !removecaptain<name>
    !leavecaptain

    !reloadteams
    Reloads the draft teams from the last game

    !setdraftteam [player] <nf/be>
    Sets the team of a player

    !swapteams
    Swaps BE and NF

    !saveteams [optional file name]
    !loadteams [optional file name]
    by default saves to sourcemod\data\draftpick\teams\default.txt
    The players are referenced by the last number in their unique_id or steamID3
    You could compile a list manually from a steam group and websites like steamidfinder.com if you wanted to.


    Captain Vote Stage
    Either admins assign captains or they will be voted in by the commander vote. If the captains are later kicked it will return to this stage

    Pick Wait Stage
    The captains are assigned, a short cooldown before the picking begins. Warns players they must join a team

    Pick Stage
    Once you first enter this stage the draft has begun. This means you can't use !reloadteams and players not already in NF can't join until two minutes after the game starts. Captains pick using what is essentially a chess clock. Both captains get a certain amount of total time at the start and a small amount of additional time every pick phase.
    If you run out of time it will autopick players for you.

    Picking players is done on the commander vote gui. Once they are picked the will be removed from the list.

    The number of picks you get is equal to the number of players in the opposite team + 1.
    This means that in most scenarios the picks will go 1-2-2-2-2 etc.
    However, if an admin swaps the teams of players or a captain gets voted that was already drafted. This may be different, so don't always assume you will get a certain number of picks.

    Once all the players have been drafted the players are put in the correct teams the original vote time is set for the game to begin.

    This is in very early stages at the moment. Help with testing would be appreciated.

    Plugin depends upon the latest versions of both squadcontrol and votetime.
     

    Attached Files:

    Last edited: Apr 22, 2017 at 12:43 PM
    complete_ and Neoony like this.
  2. Paradox

    Paradox I am a gigantic asshole who loses people's hard wo

    Messages:
    6,794
    Likes Received:
    136
    Trophy Points:
    0
    Man, can we give mikleo a titel he deserves.
    Like PLUGIN god? Off the books dev?
    Something real swagger and deserving of his genius
     
  3. Mikleo

    Mikleo Member

    Messages:
    43
    Likes Received:
    21
    Trophy Points:
    0
    So we had some productive testing.
    Thanks to Mr.x and everyone else for helping me test.
    There are still quite a few issues I need to look into in the next few days.
    But as a proof of concept I think it went really well.
     
  4. Mikleo

    Mikleo Member

    Messages:
    43
    Likes Received:
    21
    Trophy Points:
    0
    v0.2
    Bug Fixes
    Added !swapteams
    Added !saveteams and !loadteams
    Added sounds for picking
     
  5. Paradox

    Paradox I am a gigantic asshole who loses people's hard wo

    Messages:
    6,794
    Likes Received:
    136
    Trophy Points:
    0
    We just tried this draft plugin out.
    Got to say, such a fucking enjoyable experience to draft using the commander menu
     
    D.D.D. Destroyer likes this.
  6. Mikleo

    Mikleo Member

    Messages:
    43
    Likes Received:
    21
    Trophy Points:
    0
    I'm just going to comment on the confusion of not being able to join a team until 2 minutes after the game starts, if you miss the draft.

    I don't think there's any point of having a draft if people can just ignore it, stay in spec/unassigned and then just join a team. That kind of eliminates the point.

    The main problem was that for some strange reason draftwait time was set at 20 seconds. This meant only 20 seconds of warning to players not in nf. Plus captains were assigned almost immediately. Extending the pickwait time using votetime is a good idea if people haven't joined yet. The main point is to get everyone involved in the draft.

    Next there was certainly an issue with people rejoining the server without their points/skills. This is probably related to the changeclientteam stuff I used to solve an earlier issue where I would for some reason be placed into nf when i rejoined when i was drafted for be and the teams had already been set up. I don't know exactly why the game put me in the wrong team. But I'm assuming that most of the time that doesent happen. So i'll just check if the teams match and if so I just wont use that.

    Edit: didn't have much time to work on this today. I just added more time to pickwait and hopefully solved the points thing in .22 .
     
    Last edited: Apr 23, 2017 at 5:29 PM
  7. Mikleo

    Mikleo Member

    Messages:
    43
    Likes Received:
    21
    Trophy Points:
    0
    I'm just going to post an update, although I haven't tested the new version enough to release it at this moment.

    I can understand why people were annoyed with the two minutes after game start thing. They want to get in to the game and It can cause players to leave etc. The main problem was that even autoassign can be abused to stack teams after the draft has ended. You just wait till someone is autoed to the team you don't want, click autoassign and you're in the team you want. To fix this, when you attempt to join a team and you are not drafted there is a ten second cooldown and then you are automatically autoassigned to a team. Players may have autoed before you, players may leave teams, so there is no reliable way to stack with this mechanic. With this mechanic it means I can move it so players can join 60 seconds after the draft has ended instead of 2 minutes after the game begins.

    Next we found an issue where when you need to use the scroll bar in the commander vote gui, the very bottom player is not visible in sundays case it was PYA. There is nothing much I can do about that so I'm introducing a fallback pick method. So you just use !pick <name> in chat to get that bottom player or to get around a selection bug.

    I'm introducing an autopick command that will automatically draft the rest of the players or even draft all the players on a team. Before randomly picking players this command will look through the default.txt autopick list and pick players from that where possible. So it will pick Security first then Tony then Mr.x etc. So if you !autopick in the middle of the draft it will pick up the rest of the average players before randomly picking players. I need to introduce slight randomisation in this list to avoid teams always looking the same. Note this also applies to when a captain runs out of time so that it wont ruin the game, so its good to have a comprehensive and accurate list.

    Here is my current autopick list: https://pastebin.com/Ndb0cSL7

    I'm obviously not the best at picking players, which is why i didn't try to captain on Sunday.
     
    Last edited: Apr 25, 2017 at 1:00 PM
  8. D.D.D. Destroyer

    D.D.D. Destroyer Member Staff Member

    Messages:
    9,070
    Likes Received:
    46
    Trophy Points:
    0
    Dear Sir,

    I am too low on the autopick list.

    Yours sincerely,
    DDD's ego


    I have a bit of an extravagant request and I'm not sure how feasible it would be. Can you somehow implement a way of drafting full/partial squads? The only way to do it under the current version is to have a gentleman's agreement between captains and that is hardly ideal.

    Perhaps it could work via a chat command where the squad leader declares the amount of players in their squad and then picks them from a list akin to the map nominate/vote list? Then drafting the leader would automatically draft the rest of the players and the other team would need to pick a squad of their own or an appropriate amount of players to counterbalance that.


    This sounds really complicated. Oh well, one can dream.
     
  9. Mikleo

    Mikleo Member

    Messages:
    43
    Likes Received:
    21
    Trophy Points:
    0
    I have been thinking about it but it would be very complicated.
    My main thought was you just lock squads during the draft so they cant leave or join.
    But yea there is a lot of stuff to it.

    I think that if you pick the squad leader in the draft it will automatically pick the remaining players when you have available picks. So say you pick alpha turn 1 and it has 5 players. your first 5 picks would be forced to alpha. Where the other team could choose 5 random players. So a good captain would wait till kind of the average skill of a squad before picking them. Of course i would have to add a prefix to the sl's name like [Alpha] or something.

    It would have to be a separate mode though. Because 5 of the best players could join the same squad and it would be crazy imbalanced.

    I could have it so that they rejoined their respective squads if they get swapped to BE after the draft.
     
    Last edited: Apr 25, 2017 at 3:10 PM
  10. D.D.D. Destroyer

    D.D.D. Destroyer Member Staff Member

    Messages:
    9,070
    Likes Received:
    46
    Trophy Points:
    0
    I can't think of a way around the skill problem. There isn't much to be done to automate stack prevention in that, the best thing I can think of is having squad drafting be a togglable option.
     

Share This Page