Announcement

Collapse
No announcement yet.

All humans on one team. Uneven teams mutator.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    I guess I already checked the Mission Game (that's what the campaign is called codewise). If I recall correctly, it is using a combination of NumPlay and BotRatio.

    I created a public repo where you can follow the changes here:
    https://github.com/RattleSN4K3/UT3-Mutator-BotBalancer

    The mtuator shouldn't be too much code and code be really simple.

    Releases will likely be available on the GitHub releases section but also (if it is in a beta/final stage) on this forum. Check this page:
    https://github.com/RattleSN4K3/UT3-M...ancer/releases

    You can always download/checkout the code and make the mutator for yourself on your own to try out alpha versions (early code). For now, I just have to think how to implement exactly what. And if a mutator is really needed. Before the first working mutator is up, it also needs some testing on my side. So, don't expect a fully working mutator within the first couple of commits.

    Comment


      #32
      Quick update. I checked why UT3 is constantly removing and adding players in a loop (and crashes). It's based on the call of TooManyBots(UTBot) which fails when the other team has a differnt size.

      UTTeamGame
      Code:
      function bool TooManyBots(Controller botToRemove)
      {
          local TeamInfo BotTeam, OtherTeam;
      
             // We only auto-manage bots if we are not in single player mode.
          if ( SinglePlayerMissionID == INDEX_NONE )
          {
              if ( bForceAllRed )
                  return false;
              if ( (!bPlayersVsBots || (WorldInfo.NetMode == NM_Standalone)) && (UTBot(botToRemove) != None) &&
                  (!bCustomBots || (WorldInfo.NetMode != NM_Standalone)) && botToRemove.PlayerReplicationInfo.Team != None )
              {
                  BotTeam = botToRemove.PlayerReplicationInfo.Team;
                  OtherTeam = Teams[1-BotTeam.TeamIndex];
                  if ( OtherTeam.Size < BotTeam.Size - 1 )
                  {
                      return true;
                  }
                  else if ( OtherTeam.Size > BotTeam.Size )
                  {
                      return false;
                  }
              }
              if ( (WorldInfo.NetMode != NM_Standalone) && bPlayersVsBots )
                  return ( NumBots > Min(16,BotRatio*NumPlayers) );
              if ( bPlayerBecameActive )
              {
                  bPlayerBecameActive = false;
                  return true;
              }
              return ( NumBots + NumPlayers > DesiredPlayerCount );
          }
          return false;
      }
      The problem with that, we can bypass that with the single flag bForceAllRed but that sets bot orders to defend for both teams
      Code:
      function SetBotOrders(UTBot NewBot)
      {
          local UTSquadAI HumanSquad;
          local name NewOrders;
      
          if ( Objectives == None )
              SetObjectiveLists();
      
          if ( UTTeamGame(WorldInfo.Game).bForceAllRed )
              NewOrders = 'DEFEND';
      That flag as several issues as it is used several times. Settings SinglePlayerMissionID to any value isn't working as well. So this problem is really hard to solve. I could not find a proper solution to that yet.

      Comment


        #33
        Tried everything and also with much debugging (in UDK) and so one. Nothing really works well so I use an approach of disabling bots being added automatically and implement a custom mechnasm to add bots. I also worked on several things to prevent bots being destroyed/kicked once in a while when they die (as TooManyBots is often called). Working on that iteratively.

        Comment


          #34
          I had originally thought you could use the "card" system to get extra bots in there. UTMissionSelectionGame.uc
          Creating a mutator that has a "ironguard" card being used at all times. In the "TacticalDiversion" code it says the extra bots are related to kismet in each map. So maybe you could use that one to lessen the red team members instead of adding.

          Code:
          function ProcessModifierCard(name GameModifierCard, UTProfileSettings Profile, out string URL, out EMissionInformation Mission)
          {
          	local int i,j,r, OldNum, RemoveCount;
          	local array<string> Pool;
          
          	URL = URL$Class'UTGameModifierCard'.static.GetURL(GameModifierCard);
          
          	CardCharacters.Length = 0; // reset the CardCharacters
          
          	if ( GameModifierCard == 'IronGuard' )
          	{
          		if ( Profile.HasPersistentKey( class'UTGameModifierCard'.static.GetAltKey(GameModifierCard)) )
          		{
          			i = CardCharacters.Length;
          			CardCharacters.Length = i + 2;
          
          			CardCharacters[i] = "Lauren";
          			j = Rand(IronGuardEnhancedPool.Length);
          			CardCharacters[i+1] = IronGuardEnhancedPool[j];
          		}
          		else
          		{
          			i = CardCharacters.Length;
          			CardCharacters.Length = i + 2;
          			for (j=0;j<2;j++)
          			{
          				r = Rand(IronGuardPool.Length);
          				CardCharacters[i+j] = IronGuardPool[r];
          				IronGuardPool.Remove(r,1);
          			}
          		}
          	}
          MapMixer has no such feature for uneven teams, that I can see.

          Comment


            #35
            MissionGame is a completely different game type and cards solely works there. A similar system will be added once the very basic is set. Non-MissionGames are not working with imbalanced teams (for bots).

            If you check UTTeamGame::TooManyBots you can see it only checks whether there are too many bots if there's no singleplayer mission id.
            Code:
            function bool TooManyBots(Controller botToRemove)
            {
                local TeamInfo BotTeam, OtherTeam;
            
                   // We only auto-manage bots if we are not in single player mode.
                if ( SinglePlayerMissionID == INDEX_NONE )
                {
                    if ( bForceAllRed )
                        return false;
                    if ( (!bPlayersVsBots || (WorldInfo.NetMode == NM_Standalone)) && (UTBot(botToRemove) != None) &&
                        (!bCustomBots || (WorldInfo.NetMode != NM_Standalone)) && botToRemove.PlayerReplicationInfo.Team != None )
                    {
                        BotTeam = botToRemove.PlayerReplicationInfo.Team;
                        OtherTeam = Teams[1-BotTeam.TeamIndex];
                        if ( OtherTeam.Size < BotTeam.Size - 1 )
                        {
                            return true;
                        }
                        else if ( OtherTeam.Size > BotTeam.Size )
                        {
                            return false;
                        }
                    }
                    if ( (WorldInfo.NetMode != NM_Standalone) && bPlayersVsBots )
                        return ( NumBots > Min(16,BotRatio*NumPlayers) );
                    if ( bPlayerBecameActive )
                    {
                        bPlayerBecameActive = false;
                        return true;
                    }
                    return ( NumBots + NumPlayers > DesiredPlayerCount );
                }
                return false;
            }
            This method is always called in a Timer (every seconds) but also when a players dies, is idling and checks for a new order but also on some other occasions. This forces the bot immediately leave the game. I kinda have a working alpha, gonna release it soon.

            Comment


              #36
              I've released the first alpha version:
              https://github.com/RattleSN4K3/UT3-M...es/tag/Alpha-1
              (for referencing problems, always check the main releases page)

              It is only a very basic mutator without any fancy UI (or even a configurable scene). You have to edit the ini manually to change settings (close UT3 and restart if you want to change settings). It is a quite complex process of setting the specific variables sequentially to allow bots being in the game without having them removed. I got a another possible method to just subclass UTBot and remove some specific calls... this might be more reliable.

              The mutator doesn't feature that much of balancing options but all following option are realized:
              - Possible to have uneven teams
              - Preferable player on 1 side bots on the other
              - For every player there should be X bots

              In addition you can set UseLevelRecommendation to always use the recommended player count (given by the map info itself).

              What I would really appreciate if you play-test that mutator in every gametype if you see problems with AI and so one. I basically tried to prevent any bugging so it would always re-setup the proper bot order once I force a player into a specific team. The current algorithm to set bots on a specific team is very basic and based on the BotRatio value, otherwise it just balances the team player count (if BatRatio is 1.0). Can you think of different options? I already have some options in mind but these are not really related to the player-count-balancing but to teams being overpowered which should e adjusted automatically (by changing bot skill or the team balance).


              *Awaiting response*

              Comment


                #37
                Everything works as you stated above in all the team based games i tried. Jailbreak, CTF, Greed, WAR.

                Custom chars for bots doesn't work, I select them in "Setting" "bots". They pop up as ironguard, all characters do. Even if I select Krall as opposing faction.
                AI seems to be stuck on defend especially for Greed (Adept bots). The bots never scored in a 10 min game and never crossed the bridge in FacingWorlds at all. They seem to follow each other around in a imaginary line.
                AI(Adept bots) in Warfare is okay when there are vehicles in the maps. But without they still seem to hover around doing nothing. Red bots have to be order to attack, once killed have to re-order them.
                TDM they work good, they move but I believe it is more responding then attacking.

                Ideas: Red team bots are "Insane" difficulty vs Blue "Adept" in a 4red vs 14blue game.
                Set one/two random bots to "insane" if one team get too ahead (losing squad). Levels back down after catching up.

                Comment


                  #38
                  Hmm. I thought AI would break the functionality. I couldn't test/debug the code in UDK properly as all these game types don't exist. (using UDK as it allowed break points in the original code).

                  Where do you select bots? In general, prevent all the original bot-adding code, this includes the team settings etc. for now. All these functionality will be added feature by feature.

                  Comment


                    #39
                    Where do I add bots? I add bots here:
                    Click image for larger version

Name:	Bots.jpg
Views:	1
Size:	71.6 KB
ID:	3250999

                    Even if you have the above section blank, your mutator will still use the bot selections you had from the last time you loaded a map. Ex. I play a map with 10 Akasha clones. I re-start, take out any bot selections, save as blank. Start a new map it will have the 10 Akasha clones from b4. If I redo the bot selection then the revised saved bot selections will be fine.

                    Code:
                    	UseLevelRecommendation=True
                    	BotRatio=4.0
                    When I use this feature it overrides what # of bots I select but then puts in a different number then the level recommendation. I did my testing on facingworlds, it turned out to be 2 red vs 6 blue. When the Levelrecommendation is 10-16 players.

                    Comment


                      #40
                      Yes. You're right. Started a match on Greed and all the bots have "Defend" as orders and without mutator all were on "Attack".

                      Not sure about this bot selection. I'm not changing anything regarding that.

                      The recommended player count is hardcoded into the CTF-FacingWorlds map and is set to minimum 6 and maximum 10 players. The description is stating something different. The level recommended player count is the arithmetic mean ((6+10)/2).

                      It is currently intended to overwrite the player count if UseLevelRecommendation is set.

                      Comment


                        #41
                        I've released a new alpha:
                        https://github.com/RattleSN4K3/UT3-M...es/tag/Alpha-2

                        This alpha mostly fixes the bot order bug but also some player balancing. There are 2 more options for balancing the players (AllowTeamChangeVsBots to disallow/allow changing teams when Players-vs-Bots is played; bPlayersBalanceTeams are used to balance out the real player without the bots - just like the stock settings).

                        About the bot faction/selection problem, I couldn't reproduce any of that problems. I selected Krall for instance, and ll the opposing team was Krall (my own team has the same family/faction as my own character, that's how UT3 handles it by default). The bot selection didn't work out on my side, not sure why. Selecting Akasha in Available bots didn't work any no Akasha was playing with 10 players.

                        Btw. all these config options are not final. The way to act could change in upcoming versions, also the name.

                        Comment


                          #42
                          bPlayersBalanceTeams are used to balance out the real player without the bots
                          What do you mean balance?

                          UseLevelRecommendation=False
                          PlayersVsBots=False
                          PlayersSide=0
                          BotRatio=2.000000
                          AllowTeamChangeVsBots=False
                          bPlayersBalanceTeams=True

                          With the above settings I was allowed to change teams (Red to Blue), this happened when I change from Blue to Red. AllowTeamChangeVsBots=False I thought that this would stop changing teams completely(?). Or does PlayersVsBots=False have to be PlayersVsBots=True in order for no team changing?
                          Click image for larger version

Name:	Untitled.jpg
Views:	1
Size:	14.6 KB
ID:	3251000
                          This is the cust char glitch I mentioned. You pick some random cust chars for your team or the other team and "models" do not get inserted in game (stock ironguard) and they repeat like this:
                          Click image for larger version

Name:	Untitled2.jpg
Views:	1
Size:	15.4 KB
ID:	3251001
                          Bots still seem to be on defend, I will keep testing.

                          Comment


                            #43
                            bPlayersBalanceTeams is only used for real players (= net players, local players, human beings). It means that any connected guy will be put into the team with lower real players. It won't ever happen that when 3vs2 real players are playing, that the next joing player will b e put into the 3-players team. It will balance the teams out. So it would be 3vs3 (if bPlayersBalanceTeams is set to true).

                            AllowTeamChangeVsBots only works in combination with PlayersVsBots (if PlayersVsBots=true). In this case, human players are not able to switch to the bot team and everyone will join the human team on connection.

                            Regarding "cust char glitch":
                            I don't do anything regarding bot selection or what specific bot can be loaded, this is all stock UT3. The only thing I do is prevent loading bots automatically on game start and within the game (for instance by console command or WebAdmin). I detect that desire and add bots manually. I don't force any specific bots chars. You can use the console command "addbots 1" (or any number) without the mutator and check if that "glitch" happens there as well. Other than that, I don't see a reason why there is a glitch. It isn't on my side and I don't change anything related code-wise.


                            Regarding that first image (imbalance):
                            Can you explain what you setup for this game and when you did change? In general, the bots should balance the teams accordingly to the BotRatio (and any related variable) once a player switches teams, leaves or joins (I did not check switch to spectator mode; which isn't supported by stock UT3 but by custom mutators).


                            Btw. regarding PS3:
                            Is a PS3-compatible mutator wanted? I mean, I got another option to try which can support config scene (configurable mutators).


                            Yes, please keep testing. I generally wait before your input to try out new things regarding the balancing code or the bot-order stuff. I mostly checked Greed and Team games in InstantAction and checked the bot order (by "showdebug AI") and all the bots were on "Attack" and they were actually scoring.

                            Comment


                              #44
                              Regarding that first image (imbalance):
                              Can you explain what you setup for this game and when you did change? In general, the bots should balance the teams accordingly to the BotRatio (and any related variable) once a player switches teams, leaves or joins (I did not check switch to spectator mode; which isn't supported by stock UT3 but by custom mutators).
                              Btw. regarding PS3: Is a PS3-compatible mutator wanted? I mean, I got another option to try which can support config scene (configurable mutators).
                              I would love too, but your original mutator I cooked and did not work properly on PS3. It loaded properly/activated but when I pressed start no bots on either red or blue team (I was on red though and map played correctly). Can you try again put hard code everything? No ini, no int, no extra options beside just the 2 extra bots. Everything else will not work for PS3, no multiplayer at all for PS3. There is no real demand for PS3 stuff besides me, ever since multi lost support.

                              Regarding that first image (imbalance): Can you explain what you setup for this game and when you did change? In general, the bots should balance the teams accordingly to the BotRatio (and any related variable) once a player switches teams, leaves or joins (I did not check switch to spectator mode; which isn't supported by stock UT3 but by custom mutators).
                              Greed, 14 players, 100 points, your mutator with the default settings. I tried to change at beginning of match, repeated switched never got me back to 2 more blue bots then red.

                              "showdebug AI"
                              I will try this.

                              Comment


                                #45
                                Originally posted by euchreplayer23 View Post
                                I would love too, but your original mutator I cooked and did not work properly on PS3. It loaded properly/activated but when I pressed start no bots on either red or blue team (I was on red though and map played correctly).
                                Which one did you cook? PS3 UI is different to PC and I only check PC version for now. PS3 might use different "command line" to start a map. Not sure if Alpha2 would work on PS3. The default settings for the mutator (hardcoded but config flagged) are using 2.0 as BotRatio and no Level recommendation.


                                Originally posted by euchreplayer23 View Post
                                Can you try again put hard code everything? No ini, no int, no extra options beside just the 2 extra bots. Everything else will not work for PS3, no multiplayer at all for PS3. There is no real demand for PS3 stuff besides me, ever since multi lost support.
                                INT is only shipped for translation. Everything is hardcoded. It's just my framework. Ini file is only used for letting the engine know the mutator is existing (the UTUIDataProvider_Mutator section is also used for PS3), the other config section is hardcoded by default but flagged config so it will be read on object creation (that's how config system works on PC). I do have a orking method to maybe support configurable mutator. With my other mutator MutateSpec, I already created a fully properly working UIScene but it doesn't get saved/loaded properly ingame (not sure what the last try was all about). A new working method would be not quite persistent but configurable on runtime... open the Configure scene, change values and start the game. If you shutdown PS3, these settings won't be saved and restored once you startup the console again. I tried that system on PC, and it worked and there's no indication that this won't work for PS3. Let me know if really like to have this as this would actually double up the work as I would create a branch for PS3.

                                Comment

                                Working...
                                X