Feature request: CoOp mode

Feature request: CoOp mode

SpringRTS Perl Autohost for Dedicated Server

Moderators: Moderators, Lobby Developers, SPADS AutoHost

YokoZar
Posts: 883
Joined: 15 Jul 2007, 22:02

Feature request: CoOp mode

Post by YokoZar »

Hey, thank you for making the autohosts. They're really cool.

I would like to make a feature request that may or may not be easy to do. TheFatController has just about finished implementing CoOp mode for Balanced Annihilation, and we'd like to be able to play it on the autohosts.

It would be really great if players could voluntarily opt in to cooping with eachother. All the autohost has to do is recognize who these players are, put them on the same ally team, and even though they're comm sharing count them as separate members.

I think the most reasonable way to make a first implementation of this is to make it opt-in by a manual command. So if I say "!coop 1", for instance, then I'm telling the autohost to please put me on the first coop team. TheFatController could then say "!coop 1" and the autohost would then know we want to be together. For balancing purposes we could be considered a two person clan. We could then have different, smaller coop teams joined together in one big ally team - a 5 man team could be composed of two players on !coop 1, two players on !coop 2, and one player who didn't opt in to coop, for instance.

That would be enough to play, although we could go further if needed.

For instance, if I don't want to coop on a specific team but would like to coop with whomever I end up with, I could do a command like !coop any - then anyone who had !coop any and was on my same allyteam would be cooped with me as well. So if x and y had !coop 1 and !coop any, I could join their team by doing !coop any.

Anyway, whatever ends up happening, thanks in advance! Also, play multiplayer coop with us some time ;)
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

Thank you, happy to see you enjoy it.

Concerning the !coop <nb> command which lets you choose the ID you want to be in, I think it would be too open to abuse: how would you prevent people you don't want to be with from doing !coop with the same ID number as yours for example ? If you can trust players concerning this, then it may be simpler to just do "!balance" and then adjust your ID (not your ally team) yourself if you want to share ID (just ensure "autoBalance" is set to "off" and "autoBlockbalance" to "0"). That way you will use SPADS auto-balance for ally teams, but you will still be able to change your ID because autoBalance and autoBlockBalance are disabled. And this should already work in current SPADS version (however you will have to use !forceStart to launch the game if there aren't the same number of IDs in each ally team, because SPADS will think teams aren't fair).

If you want to avoid this manual ID selection part (though I'm not sure it's a big deal, because only players who want to coop would need to do it), you can still configure SPADS to auto-balance for comshare, and use clan tags to select players you want to coop with: you just have to set the "nbPlayerById" setting to a value greater than 1 and reduce the "teamSize" setting so that SPADS will have to use shared IDs to comply with the target battle structure (SPADS first tries to fill the ally teams with one player by ID until "teamSize" is reached, then it adds remaining players in the existing IDs if "nbPlayerById" is greater than 1). IDs use the same balancing rules as ally teams: if "balanceMode" is set to "clan" or "clan;rank", SPADS will try to put players of same clan in same ID. So you have some control about which players are sharing their units through clan tags. It's not as flexible as the solution you explained because you have to use clan tags, but it should work in current SPADS version and I think it's less open to abuse.

Finally, I think the manual ID selection command could lead to somple complex cases regarding auto-balancing: for instance, when 2 players do "!coop 1" they must be in the same ally team. But if they have different clan tags then all the players of both clans should be in the same ally team. What if teams aren't big enough to contain the 2 clans ? Should we break the coop or one of the clans ? We would have to add some sort of priorities on all these constraints which could become quite confusing for players... Moreover, it would become even easier for players to trigger totally unbalanced games: currently they have to use clan tags to be sure to be in the same team, and usually players don't rename between each battle just because they saw a good player they want to be with. But with a !coop command all they would have to do is choose the same coop id. I think there would be even more aguing in battle lobby about players totally breaking the balance by using !coop command, and it could take quite long to start a game...
YokoZar
Posts: 883
Joined: 15 Jul 2007, 22:02

Re: SPADS AutoHost beta release

Post by YokoZar »

bibim wrote:Thank you, happy to see you enjoy it.

Concerning the !coop <nb> command which lets you choose the ID you want to be in, I think it would be too open to abuse: how would you prevent people you don't want to be with from doing !coop with the same ID number as yours for example ?
I was originally going to suggest naming your friends but figured this was simpler. As you point out it may be necessary.

So I type: !coop TheFatController, and he types !coop YokoZar, and then we're together. One of us (but not both) types !coop bibim, and you type !coop YokoZar, and then all three of us are together.

That pretty much solves it. I think keeping it to "one person on the team's permission is enough" is ok - If we require every player to type every other player it quickly gets hard.
If you can trust players concerning this, then it may be simpler to just do "!balance" and then adjust your ID (not your ally team) yourself if you want to share ID (just ensure "autoBalance" is set to "off" and "autoBlockbalance" to "0"). That way you will use SPADS auto-balance for ally teams, but you will still be able to change your ID because autoBalance and autoBlockBalance are disabled. And this should already work in current SPADS version (however you will have to use !forceStart to launch the game if there aren't the same number of IDs in each ally team, because SPADS will think teams aren't fair).
Hmm, seeing as it's hard enough to stop people from spamming !cbalance a million times even before the game has enough players, I don't think this is workable unless support for coop is coded in.
Finally, I think the manual ID selection command could lead to somple complex cases regarding auto-balancing: for instance, when 2 players do "!coop 1" they must be in the same ally team. But if they have different clan tags then all the players of both clans should be in the same ally team. What if teams aren't big enough to contain the 2 clans ? Should we break the coop or one of the clans ? We would have to add some sort of priorities on all these constraints which could become quite confusing for players... Moreover, it would become even easier for players to trigger totally unbalanced games: currently they have to use clan tags to be sure to be in the same team, and usually players don't rename between each battle just because they saw a good player they want to be with. But with a !coop command all they would have to do is choose the same coop id. I think there would be even more aguing in battle lobby about players totally breaking the balance by using !coop command, and it could take quite long to start a game...
You could, of course, just treat the !coop id's not as separate clans but instead on a per-team basis. That way if everyone in 6 person clan foo types !coop 1 then there will be two separate coops on the different teams when it's a 4v4. So here you'd balance normally and only afterwards look at the !coop requests. I think that works pretty well, other than the possible "I don't want him in my coop" problem above.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

YokoZar wrote:I was originally going to suggest naming your friends but figured this was simpler. As you point out it may be necessary.

So I type: !coop TheFatController, and he types !coop YokoZar, and then we're together. One of us (but not both) types !coop bibim, and you type !coop YokoZar, and then all three of us are together.

That pretty much solves it. I think keeping it to "one person on the team's permission is enough" is ok - If we require every player to type every other player it quickly gets hard.
From what I understand, the !coop <name> command would then add a player to the list of players who can share ID with you (transitively). But then, wouldn't we also need a !uncoop command to remove a player from this list ? What would you do if you change your mind and finally decide to coop with someone else ? Maybe !coop without any parameter would reset the list ?
YokoZar wrote:
bibim wrote: If you can trust players concerning this, then it may be simpler to just do "!balance" and then adjust your ID (not your ally team) yourself if you want to share ID [...]
Hmm, seeing as it's hard enough to stop people from spamming !cbalance a million times even before the game has enough players, I don't think this is workable unless support for coop is coded in.
Yep, this method only works if you can trust players, which doesn't happen very often unfortunately...
YokoZar wrote:You could, of course, just treat the !coop id's not as separate clans but instead on a per-team basis. That way if everyone in 6 person clan foo types !coop 1 then there will be two separate coops on the different teams when it's a 4v4. So here you'd balance normally and only afterwards look at the !coop requests. I think that works pretty well, other than the possible "I don't want him in my coop" problem above.
Ok so basically you would wait for the battle to be full and balanced, and then you would enter the !coop <nb> commands ? The problem is that usually when the battle is full and balanced, there are still players leaving and joining it, and thus the battle is rebalanced. So I think we would end up with lots of !coop commands each time the battle is rebalanced, with players taking the same numbers by mistake etc...

Personnaly, instead of a !coop command, I'd go for adding a shareId SPADS preference (= by-user setting) and an idShareMode SPADS setting:
When the idShareMode setting is set to auto, current behaviour is used. SPADS tries to respect target battle structure (nbTeams / teamSize / nbPlayerById) as much as possible, regardless of the shareId user preferences.
When the idShareMode setting is set to manual, SPADS ignores the nbPlayerById setting and it only makes players of the same team share ID if their shareId preference contains the same string. So basically, the shareId preference would be like an identifier for the ID, which must be known by the other players if they want to share ID with you.

Players would be able to set their shareId preference like any other SPADS preference: !pSet shareId <value>.
If a player wants anyone to be able to share ID with him, he can say the !pSet command publicly in the battle lobby (or can simply give the current value of his shareId setting in the battle lobby).
If a player wants only some other players to share ID with him, he can say the !pSet command in private to the AutoHost and then give his shareId preference value to selected players.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

bibim wrote:Personnaly, instead of a !coop command, I'd go for adding a shareId SPADS preference (= by-user setting) and an idShareMode SPADS setting:
When the idShareMode setting is set to auto, current behaviour is used. SPADS tries to respect target battle structure (nbTeams / teamSize / nbPlayerById) as much as possible, regardless of the shareId user preferences.
When the idShareMode setting is set to manual, SPADS ignores the nbPlayerById setting and it only makes players of the same team share ID if their shareId preference contains the same string. So basically, the shareId preference would be like an identifier for the ID, which must be known by the other players if they want to share ID with you.

Players would be able to set their shareId preference like any other SPADS preference: !pSet shareId <value>.
If a player wants anyone to be able to share ID with him, he can say the !pSet command publicly in the battle lobby (or can simply give the current value of his shareId setting in the battle lobby).
If a player wants only some other players to share ID with him, he can say the !pSet command in private to the AutoHost and then give his shareId preference value to selected players.
I have implemented this in "unstable" SPADS release. I'm testing it on Spads3 AutoHost. I have also added the "!coop <ident>" alias for "!pSet shareId <ident>".

So to sum up:
If you don't want to coop, you don't have to do anything.
If you want to coop with someone else, both of you have to use the "!coop <ident>" command with the same <ident>. <ident> doesn't need to be a number or whatever, it's just a string of your choice. And you don't need to say "!coop" in the battle, you can use it in a private message to the bot (so you can give the <ident> value only to players you want to coop with).
[oxnull]Lupus
Posts: 101
Joined: 12 May 2009, 14:52

Re: SPADS AutoHost beta release

Post by [oxnull]Lupus »

Playing last time with YokoZar on autohost with coop was a little hard. YokoZar had to autohost himself.
I like the idea, that clans must be in coop. So i modified stable spads a bit for it.
May be it will be interesting to you:
add call to cooperateClans in sub balanceBattle:

Code: Select all

      foreach my $bot (keys %{$ids[$teamNb]->[$subIdNb]->{bots}}) {
        $p_bots->{$bot}->{battleStatus}->{id}=$idNb;
      }
      cooperateClans($p_players);
      $idNb++;
    }
  }
  srand($restoreRandSeed);
and cooperateClans pretty straightforward:

Code: Select all

sub cooperateClans {
  my ($p_players,$p_groups,$avgSkill)=@_;

  my %clans;
  foreach my $player (keys %{$p_players}) {
    if($player =~ /^\[([^\]]+)\]/) {
      my $clan=$1;
      $clans{$clan}=[] unless(exists $clans{$clan});
      push(@{$clans{$clan}},$player);
    }
  }
  foreach my $clan (keys %clans) {
    delete($clans{$clan}) unless($#{$clans{$clan}} > 0);
  }

  my $p_sortedClanNames=randomRevSort(sub {return $#{$_[1]->{$_[0]}}},\%clans);
  my @sortedClans = map {$clans{$_}} @{$p_sortedClanNames};

  while(@sortedClans) {
    my $p_clan=shift(@sortedClans);
    my @clan=@{$p_clan};
    my $id = -1;
    foreach my $player (@clan) {
      if($id < 0) {
        $id = $p_players->{$player}->{battleStatus}->{id};
      } else {
        $p_players->{$player}->{battleStatus}->{id} = $id;
      }
    }
  }
}
It's necessary to check for specific mod(BA6.92+) and mod option(mo_coop).
Also fix balance checking, cause spads counts two players with one id like one.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

[oxnull]Lupus wrote:Playing last time with YokoZar on autohost with coop was a little hard. YokoZar had to autohost himself.
Yeah, that's why I implemented the "shareId" preference (and "!coop" alias) in SPADS unstable, as I said just above.
[oxnull]Lupus wrote:I like the idea, that clans must be in coop. So i modified stable spads a bit for it.
May be it will be interesting to you:
[...]
Also fix balance checking, cause spads counts two players with one id like one.
Thank you, however imo I already implemented all the modifications required for Coop mode in SPADS unstable (the balance check fix you spoke about, among other things...).
[oxnull]Lupus wrote:It's necessary to check for specific mod(BA6.92+) and mod option(mo_coop).
I try to avoid relying on modoptions in SPADS code as much as possible, or it will quickly be filled with mod-specific code sections.
Instead, SPADS uses a "idShareMode" setting, as I explained above.

edit: I recommend not using the "unstable" release of SPADS, as it's the release I use to perform the first "real-life" tests, so it's quite often broken. You can use "testing" instead of "stable" though, if you're interested in trying SPADS modifications before they are fully tested in the "testing" release (most SPADS AutoHosts use "testing" release)
[oxnull]Lupus
Posts: 101
Joined: 12 May 2009, 14:52

Re: SPADS AutoHost beta release

Post by [oxnull]Lupus »

bibim wrote:Yeah, that's why I implemented the "shareId" preference (and "!coop" alias) in SPADS unstable, as I said just above.
That's good, but i'm talking about some battle preference, that automatically coops clans. People will join such server and get involved in coop.
I don't think 90% of players know about preferences :)
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

[oxnull]Lupus wrote:
bibim wrote:Yeah, that's why I implemented the "shareId" preference (and "!coop" alias) in SPADS unstable, as I said just above.
That's good, but i'm talking about some battle preference, that automatically coops clans. People will join such server and get involved in coop.
I don't think 90% of players know about preferences :)
Well, I don't think 90% of clan players want to be forced to coop neither. Anyway, that's why I implemented the "!coop" alias, which sets the preference for you and is quite easy to remember, as YokoZar explained. Furthermore, SPADS preferences are persistent: SPADS will remember all players' preferences between battles, even if it restarts. So basically, if you always want to coop with your clan, you can set your coop preference to your clan name once for all, and if all other players of your clan do the same you will always be automatically coop'ing with them, without having to use !coop everytime.


However, if you still think there is a need for AutoHost admins to be able to force clan players to coop, maybe I will add another allowed value for the "idShareMode" SPADS setting.

As explained here, current allowed values are:
"all" => all players of each team are coop'ing together
"auto" => ID share is managed automatically through "nbPlayerById" and "balanceMode" settings
"manual" => ID share is managed through the "shareId" preference (players can opt-in for coop)

I could add the "clan" value:
"clan" => all clan players are automatically coop'ing, other players can opt-in with "shareId" preference
Last edited by bibim on 17 Aug 2009, 03:42, edited 1 time in total.
[oxnull]Lupus
Posts: 101
Joined: 12 May 2009, 14:52

Re: SPADS AutoHost beta release

Post by [oxnull]Lupus »

If it has 'all' mode, it will be fair to have 'clan' mode i think.
And btw, is it possible to make shareId global across all(some?) spads autohosts? You've made ghost maps, so i think spads can communicate to each other.
For example, i play on different autohosts with my friend and i want to coop on any of them. Why type !coop on each?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: SPADS AutoHost beta release

Post by aegis »

tracking unique user accounts isn't currently easy/foolproof for autohosts
YokoZar
Posts: 883
Joined: 15 Jul 2007, 22:02

Re: SPADS AutoHost beta release

Post by YokoZar »

Thank you bibim, it's working beautifully.

For usability purposes, I would suggest replacing the message the host sends you (your shareid preference has been set to 'foo') with another one-message explanation like:

You are now on coop team "foo". Get other players to say "!coop foo" and you will coop together if you are on the same team.


That should be no less annoying, since it's still one message. To emphasize it's a string, I suggest including the quotes around foo.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

[oxnull]Lupus wrote:If it has 'all' mode, it will be fair to have 'clan' mode i think.
I've just implemented the "clan" mode: clan players who didn't set their "shareId" preference will have their shareId set to their clan tag by default => clan players coop by default, but they can opt-out by setting their shareId preference to another secret value.
[oxnull]Lupus wrote:And btw, is it possible to make shareId global across all(some?) spads autohosts?
I think I will implement an optional database interface for SPADS, so that all autohosts running on same host (or having access to a given database) could share their dynamic data (user preferences, map boxes, bans ...), instead of using .dat files loaded in memory.
[oxnull]Lupus wrote:You've made ghost maps, so i think spads can communicate to each other.
Ghost map system doesn't use inter SPADS communication at all.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

YokoZar wrote:For usability purposes, I would suggest replacing the message the host sends you (your shareid preference has been set to 'foo') with another one-message explanation like:

You are now on coop team "foo". Get other players to say "!coop foo" and you will coop together if you are on the same team.


That should be no less annoying, since it's still one message. To emphasize it's a string, I suggest including the quotes around foo.
I've improved !coop answer messages:

Code: Select all

<bibim> !coop aaa
<Spads3> You are now in coop group "aaa" (other players who enter "!coop aaa" will coop with you if they are in the same team)
YokoZar
Posts: 883
Joined: 15 Jul 2007, 22:02

Re: SPADS AutoHost beta release

Post by YokoZar »

bibim wrote:
YokoZar wrote:For usability purposes, I would suggest replacing the message the host sends you (your shareid preference has been set to 'foo') with another one-message explanation like:

You are now on coop team "foo". Get other players to say "!coop foo" and you will coop together if you are on the same team.


That should be no less annoying, since it's still one message. To emphasize it's a string, I suggest including the quotes around foo.
I've improved !coop answer messages:

Code: Select all

<bibim> !coop aaa
<Spads3> You are now in coop group "aaa" (other players who enter "!coop aaa" will coop with you if they are in the same team)
Thanks, that looks wonderful.

Now I just need to figure out an easy way to vote for the autohost to put me and my coop buddies on the same team even though we don't have clan tags. Doing !rebalance ten times and hoping to get lucky just doesn't quite cut it ;)
[oxnull]Lupus
Posts: 101
Joined: 12 May 2009, 14:52

Re: SPADS AutoHost beta release

Post by [oxnull]Lupus »

bibim wrote:I've just implemented the "clan" mode: clan players who didn't set their "shareId" preference will have their shareId set to their clan tag by default => clan players coop by default, but they can opt-out by setting their shareId preference to another secret value.
Great. I've just updated to testing and was about to apply my handmade patch ;)
But decided to read forum first.
bibim wrote:I think I will implement an optional database interface for SPADS, so that all autohosts running on same host (or having access to a given database) could share their dynamic data (user preferences, map boxes, bans ...), instead of using .dat files loaded in memory.
That would be nice. Maybe integrate it with lobby account somehow?
[oxnull]Lupus
Posts: 101
Joined: 12 May 2009, 14:52

Re: SPADS AutoHost beta release

Post by [oxnull]Lupus »

YokoZar wrote:Thanks, that looks wonderful.

Now I just need to figure out an easy way to vote for the autohost to put me and my coop buddies on the same team even though we don't have clan tags. Doing !rebalance ten times and hoping to get lucky just doesn't quite cut it ;)
Hmm, what's the point of cooping if autohost balances coops as usual? Cooping is an invisible clan tag i think and must be treated the same.
If i liked playing with some guy(ex. YokoZar :) ) but we don't want to append/change clantags, but just wanna play in one team with one id when on one server?
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

YokoZar wrote:
bibim wrote:Finally, I think the manual ID selection command could lead to somple complex cases regarding auto-balancing: for instance, when 2 players do "!coop 1" they must be in the same ally team. But if they have different clan tags then all the players of both clans should be in the same ally team. What if teams aren't big enough to contain the 2 clans ? Should we break the coop or one of the clans ? We would have to add some sort of priorities on all these constraints which could become quite confusing for players... Moreover, it would become even easier for players to trigger totally unbalanced games: currently they have to use clan tags to be sure to be in the same team, and usually players don't rename between each battle just because they saw a good player they want to be with. But with a !coop command all they would have to do is choose the same coop id. I think there would be even more aguing in battle lobby about players totally breaking the balance by using !coop command, and it could take quite long to start a game...
You could, of course, just treat the !coop id's not as separate clans but instead on a per-team basis. That way if everyone in 6 person clan foo types !coop 1 then there will be two separate coops on the different teams when it's a 4v4. So here you'd balance normally and only afterwards look at the !coop requests.
YokoZar
Posts: 883
Joined: 15 Jul 2007, 22:02

Re: SPADS AutoHost beta release

Post by YokoZar »

[oxnull]Lupus wrote:
YokoZar wrote:Thanks, that looks wonderful.

Now I just need to figure out an easy way to vote for the autohost to put me and my coop buddies on the same team even though we don't have clan tags. Doing !rebalance ten times and hoping to get lucky just doesn't quite cut it ;)
Hmm, what's the point of cooping if autohost balances coops as usual? Cooping is an invisible clan tag i think and must be treated the same.
If i liked playing with some guy(ex. YokoZar :) ) but we don't want to append/change clantags, but just wanna play in one team with one id when on one server?
It seems like there are two separate cases here - large groups of willing coopers (who would be fine with being split into separate teams), and small groups of coopers who really want to be together.

It would be nice to have the "preserve coops" balance mode as something that could be voted on. So instead of doing !cbalance I could, say, !coopbalance (possibly requiring a vote), and then the autohost would sort that way. All that's really required is another balance mode in the list (clan, rank, coop); although this does lead to 6 different ways of possibly sorting them.
YokoZar
Posts: 883
Joined: 15 Jul 2007, 22:02

Re: SPADS AutoHost beta release

Post by YokoZar »

YokoZar wrote:
[oxnull]Lupus wrote:
YokoZar wrote:Thanks, that looks wonderful.

Now I just need to figure out an easy way to vote for the autohost to put me and my coop buddies on the same team even though we don't have clan tags. Doing !rebalance ten times and hoping to get lucky just doesn't quite cut it ;)
Hmm, what's the point of cooping if autohost balances coops as usual? Cooping is an invisible clan tag i think and must be treated the same.
If i liked playing with some guy(ex. YokoZar :) ) but we don't want to append/change clantags, but just wanna play in one team with one id when on one server?
It seems like there are two separate cases here - large groups of willing coopers (who would be fine with being split into separate teams), and small groups of coopers who really want to be together.

It would be nice to have the "preserve coops" balance mode as something that could be voted on. So instead of doing !cbalance I could, say, !coopbalance (possibly requiring a vote), and then the autohost would sort that way. All that's really required is another balance mode in the list (clan, rank, coop); although this does lead to 6 different ways of possibly sorting them.
On second thought, you wouldn't need to deal with 6 sorting possibilities if the logic was instead an (optional) "treat coops as clans". That'd keep everything pretty clean, although you'd need to deal with the edge case of two different clans having individual members cross-coop (A1 coop with B1, A2 coop with B2 would need to balance the 1's together rather than clan A together)
Post Reply

Return to “SPADS AutoHost”