splewis / get5

CS:GO Sourcemod plugin for competitive matches/scrims
GNU General Public License v3.0
557 stars 176 forks source link

Add custom veto logic support + Rename VETO to BAN #962

Closed nickdnk closed 1 year ago

nickdnk commented 1 year ago

This allows the match configuration to come with a veto_mode key that takes an array of strings in order to allow a custom veto mode.

Closes https://github.com/splewis/get5/issues/643.

In this example, we do a default "each team bans one, then picks one, last one played" with a pool of 5 maps. Providing a logically impossible setup will result in an error, but aside from that, you can do whatever you want.

We also now allow providing map_sides even when vetoing, so in this case, team2 will start CT on the first map and team1 will start CT on the second map, because the other team picked. Of course, you can omit this and let the team pick a side as well, like before.

{
  "num_maps": 3,
  "maplist": [
    "de_dust2",
    "de_mirage",
    "de_inferno",
    "de_ancient",
    "de_vertigo"
  ],
  "veto_mode": [
    "team1_ban",
    "team2_ban",
    "team1_pick",
    "team2_pick"
  ],
  "map_sides": [
    "team2_ct",
    "team1_ct",
    "knife"
  ],
  "team1": {
    "name": "Team A Default",
    "players": {
      "76561197996413459": "PlayerAName1"
    },
    "coaches": {
      "76561197996426735": "CoachAName1"
    }
  },
  "team2": {
    "name": "Team B Default",
    "players": {
      "76561197996413459": "PlayerBName1"
    },
    "coaches": {
      "76561197996426735": "CoachBName1"
    }
  }
}

I still need to test it and update the docs.

stranden commented 1 year ago

Will #920 be included in this?

nickdnk commented 1 year ago

Will #920 be included in this?

Maybe. It requires a fair amount of adjustments to translations as "veto" is mentioned in all languages, so it really depends on whether or not we can get people to make this change.

TandelK commented 1 year ago

@nickdnk So with this feature we can configure any place of ban and pick with any Best Of ?

nickdnk commented 1 year ago

@nickdnk So with this feature we can configure any place of ban and pick with any Best Of ?

Yes, you can create any config that's logically possible.

nickdnk commented 1 year ago

I have tested it and fixed some problems. We now also aim to close #920 with this.

nickdnk commented 1 year ago

Russian translation

Adjusted. Thanks!

https://github.com/splewis/get5/pull/962/commits/c7c7b8b72bacbbe05c77f4b901837cb540a55710

nickdnk commented 1 year ago

@Saph1s I think maybe you should capitalize "BAN" in the confirm translations, as it's capitalized for "PLAY":

    "MapSelectionPickMenuText"
    {
        "ru"        "Выберите карту для ИГРЫ:"
    }

For consistency.

nickdnk commented 1 year ago

I have tested this pretty extensively and also added a bunch of unit tests. Only translations are missing now, or some feedback. I will merge this PR so it can be released as prerelease, and we can update the translations in another PR.

deLuXe83 commented 1 year ago

Hi! Just tested the new veto/pick system.

It comes out, that esp. when playing workshop maps, the pick <mapname> command is very unhandy, because captains sometimes do not know the correct map name (eg. map is called de_cobblestone(workshop), but you have to type de_cbble).

Would it be possible to get back the old votring system, so you can vote via numbers? (maybe as an option)

Thanks! Bests!

nickdnk commented 1 year ago

Hello

The old system is not returning. It longer exists. What we can do is add an option to disable formatting the names, so it just prints out de_cbble and you can !ban cbble (or whatever the map name is) in that case.

Alternatively, we can make it convert known map names to their actual-name equivalent, i.e. de_cbble would also match "Cobble" or "Cobblestone".

Edit: Also, de_cobble would be matched if you typed !ban cobble, as it matches on a subset, and cobble is a subset of de_cobble. Not sure how that would not be working. If you have a reproducible case, please open an issue with examples. There is no situation where you would have to type de_cbble if the map name is de_cobble.

nickdnk commented 1 year ago

@deLuXe83 https://github.com/splewis/get5/pull/1005/files This should fix your problem, right?

deLuXe83 commented 1 year ago

Hi! Thx for your reply. Yeah, cbble might be the most difficult map. As i mentioned I would assume workshop-maps are making the problems.

In our case the system prints out "Cobblestone" but you had to type de_cbble. Maybe as well case-sensitivity should be turned off?

WhatsApp Image 2023-04-07 at 21 10 45

deLuXe83 commented 1 year ago

Just came up with another question.

What happens, if following values are set "veto_first" "random" "veto_mode" { "team1_ban" "" "team2_ban" "" "team1_ban" "" "team2_ban" "" "team1_pick" "" "team2_pick" "" }

Would always team1 ban the first map, because the veto_mode overrules the veto_first value? Because it would be nice if the first team would be random, if the 'veto_first random' mode is set :)

nickdnk commented 1 year ago

The Cobblestone issue has been fixed in 0.14. See https://github.com/splewis/get5/releases/tag/v0.14.0 and remember to read the breaking changes. This is only a problem because Cobblestone is misspelled in the filename; it has nothing to do with it being a workshop map. It should work fine in 0.14.

Edit: Case sensitivity is turned off in map selection.

Just came up with another question.

What happens, if following values are set "veto_first" "random" "veto_mode" { "team1_ban" "" "team2_ban" "" "team1_ban" "" "team2_ban" "" "team1_pick" "" "team2_pick" "" }

Would always team1 ban the first map, because the veto_mode overrules the veto_first value? Because it would be nice if the first team would be random, if the 'veto_first random' mode is set :)

veto_first is ignored if you provide a custom veto mode. If you don't set a custom veto mode, veto_first just (optionally) inverts the default veto mode listed here: https://splewis.github.io/get5/latest/veto/#default

nickdnk commented 1 year ago

I've updated the documentation to clarify the questions you had about veto first.

nickdnk commented 1 year ago

@deLuXe83 You may want to disable https://splewis.github.io/get5/latest/configuration/#get5_format_map_names - I added this to 0.14.1. If you have many workshop maps, it's preferable to not format any map names for consistency.

deLuXe83 commented 1 year ago

allright i will check it out this week! thank you very much 🙏🏻

deLuXe83 commented 1 year ago

Hi! Veto System is working fine.

But now we have the issue that - after voting workshop maps - we get the error "invalid file id". then when i change the map manually, then our cvars in the config file (eg. mp_maxrounds) are not getting executed.

any ideas? thx!! Unbenannt2

nickdnk commented 1 year ago

Please open an issue and fill out the issue template.