Announcement

Collapse
No announcement yet.

All humans on one team. Uneven teams mutator.

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

    #16
    You could use NotifyLogin and NotifyLogout to add/remove bots automatically.

    Comment


      #17
      that's just a normal setting for the server bot:human ratio 1:2

      Comment


        #18
        Originally posted by RattleSN4K3 View Post
        PlayerVsBots as a limit of 16 players. So it can only be Xvs16 (X=real player count).
        BotRatio works but as said it doesn't allow more players than 16 in the opposing team.

        Comment


          #19
          i would appreciate some more assistance here. Just really lost. All i want is a mutator that adds 2 bots to the blue team (disabling team autobalancing) w/ correct AI. I have broken AI now and no extra bots.

          Comment


            #20
            2 bots per 1 player? Or just 2 bots total? Are you asking for a complete working code? This might needs several playtests (as seen in the previous code which broke the AI code). However - as suggested - you can start with the Notify functions and add/remove bots when a player connects:

            Code:
            function InitMutator(string Options, out string ErrorMessage)
            {
                super.InitMutator(Options, ErrorMessage);
                if (UTGame(WorldInfo.Game) != none)
                {
                     UTGame(WorldInfo.Game).DesiredPlayerCount = 0; // remove the desired bot count on start
                     UTGame(WorldInfo.Game).bPlayersVsBots = true; // disabling autobalance in TeamGames
                }
            }
            
            function NotifyLogin(Controller NewPlayer)
            {
                local UTGame G;
                super.NotifyLogin(NewPlayer);
            
                G = UTGame(WorldInfo.Game);
                if (G != none && PlayerController(NewPlayer) != none)
                {
                    // add 2 bots to blue team
                    G.AddBot("", true, 1);
                    G.AddBot("", true, 1);
                }
            }
            
            function NotifyLogout(Controller Exiting)
            {
                local UTGame G;
                local UTBot B;
                local array<UTBot> Bs;
                local int i;
            
                super.NotifyLogout(Exiting);
            
                G = UTGame(WorldInfo.Game);
                if (G != none && PlayerController(Exiting) != none)
                {
                    // remove 2 random bots
                    foreach WorldInfo.AllControllers(class'UTBot', B)
                    {
                        Bs.AddItem(B);
                    }
            
                    if (Bs.Length > 0)
                    {
                        i = Rand(Bs.Length);
                        G.KillBot(Bs[i]);
                        Bs.Remove(i, 1);
                    }
                    
                    if (Bs.Length > 0)
                    {
                        i = Rand(Bs.Length);
                        G.KillBot(Bs[i]);
                        Bs.Remove(i, 1);
                    }
                }
            }
            You can extend the code quite easily and make it configurable. I did not run any tests so i'm not sure if it works.

            Comment


              #21
              It did not work as intended. What I wanted was selecting 8 total players in the select screen. Then adding a mutator that adds 2 blue bots, so the end result would be 4 red (1human 3bots) vs 6 blue (6 bots or 8 etc...).

              I tried adding more, it didn't work the notify login stuff I can add much later. Always 1 vs 2 a sit is now.
              G.AddBot("", true, 1);
              G.AddBot("", true, 1);
              G.AddBot("", true, 1);
              G.AddBot("", true, 1);

              Thank you for the help.

              Comment


                #22
                "4 red (1human 3bots)" bots in the same team as humans?

                It sounds like all you want is what BotRatio is doing.

                Code:
                var float BotRatio;
                
                function InitMutator(string Options, out string ErrorMessage)
                {
                    local UTGame G;
                    super.InitMutator(Options, ErrorMessage);
                
                    G = UTGame(WorldInfo.Game);
                    if (G == none) return;
                
                    G.BotRatio = BotRatio;
                    G.bPlayersVsBots = (G.BotRatio > 0);
                }
                
                defaultproperties
                {
                    BotRatio=1.5
                }

                Comment


                  #23
                  Nope, that doesn't work either.

                  BotRatio=1.5 equals u vs 1 bot
                  BotRatio=5 equals u+2 red bots vs 3 blue bots

                  Can I do a team bot ratio? So if red team has 4 human/bots then blue team would have 8 bots.

                  Comment


                    #24
                    That would be a BotRatio 2.0. The logic of BotRatio only counts bots.

                    Comment


                      #25
                      Been at this mutator for months. I don't get it. Programming is an art, and I am not an artist. All fails here. Hopefully someone will pick this up. I will keep trying.

                      Comment


                        #26
                        i did not know it was left unsolved sorry, but anything to do with online/ replication i think wormbo has tutorials, i would help if i could.

                        - i am sure (100%) that i have played on servers that had all players on red.

                        Comment


                          #27
                          Okay, going to finish this one. euchreplayer23, please write everything down in short words what you want/this mutator shoud do. And please also write a short comprehension about the problems you had with the previous code snippets.

                          Comment


                            #28
                            I want a mutator that can add more bots to the opposite/bot team. So I can have a 4 (bots or players) red team vs a 8 bot blue team. No console commands.

                            In a dream situation, I would like all humans on the same team vs all bots on the blue team. TKBS mentioned above your post that this was done somewhere b4(?) ex. Red(2 players + 2 bots) vs Blue (4 or more bots).

                            Did nothing.
                            Code:
                            function InitMutator(string Options, out string ErrorMessage)
                            {
                                local UTGame G;
                                super.InitMutator(Options, ErrorMessage);
                            
                                G = UTGame(WorldInfo.Game);
                                if (G == none) return;
                            
                                G.BotRatio = BotRatio;
                                G.bPlayersVsBots = (G.BotRatio > 0);
                            }
                            
                            defaultproperties
                            {
                                BotRatio=1.5
                            }
                            AI messed up. Bots in CTF/Greed don't leave the flagstand and WAR they move a little but eventually just stand where they spawn. They still attack when you are close by but nothing else. Do not pick up skulls or flags.
                            Code:
                            class VsBotsMutator extends UTMutator;
                            
                            function InitMutator(string Options, out string ErrorMessage)
                            {
                                local UTTeamGame G;
                                
                                super.InitMutator(Options, ErrorMessage);
                                
                                G = UTTeamGame(WorldInfo.Game);
                                if (G != none)
                                {
                                    // We need to force red team to be filled
                                    // in order to bypass team balancing with bots
                                    G.bForceAllRed = true;
                                    G.bCustomBots = true;
                                }
                            }
                            
                            function bool AllowChangeTeam(Controller Other, out int num, bool bNewTeam)
                            {
                                if (AIController(Other) != none)
                                    num = 1;
                                else
                                    num = 0;
                            
                                return super.AllowChangeTeam(Other, num, bNewTeam);
                            }
                            
                            function NotifyLogin(Controller NewPlayer)
                            {
                                local TeamInfo NewTeam;
                                local int ForceTeamIndex;
                                local UTBot B;
                            
                                super.NotifyLogin(NewPlayer);
                            
                                if (WorldInfo.Game.bTeamGame && WorldInfo.GRI.Teams.Length > 1 && UTTeamGame(WorldInfo.Game) != none)
                                {
                                    ForceTeamIndex = INDEX_NONE;
                                    if (AIController(NewPlayer) != none)
                                        ForceTeamIndex = 1;
                                    else if (PlayerController(NewPlayer) != none)
                                        ForceTeamIndex = 0;
                            
                                    if (ForceTeamIndex != INDEX_NONE && NewPlayer.PlayerReplicationInfo != none && 
                                        NewPlayer.PlayerReplicationInfo.Team != none && NewPlayer.PlayerReplicationInfo.Team.TeamIndex != ForceTeamIndex)
                                    {
                                        NewTeam = WorldInfo.GRI.Teams[ForceTeamIndex];
                                        UTTeamGame(WorldInfo.Game).SetTeam(NewPlayer, UTTeamInfo(NewTeam), true);
                                    }
                            
                                    // manually fix balancing bots as we forced red 
                                    if (ForceTeamIndex == 0)
                                    {
                                        foreach WorldInfo.AllControllers(class'UTBot', B)
                                        {
                                            if (WorldInfo.Game.NumBots + WorldInfo.Game.NumPlayers > UTGame(WorldInfo.Game).DesiredPlayerCount)
                                            {
                                                B.Destroy();
                                            }
                                            break;
                                        }
                                    }
                                }
                            }
                            Per my IM i thought your were going to fix the AI in the Mutant gametype, so that the bots would actively hunt for the "mutant" instead of attacking every one (non-mutant). I guess that was not you, never mind.

                            Comment


                              #29
                              Okay. Going to try something new from scratch. Also, have you been testing MapMixer (the mutator for instance)? The menu allows to setup such games.

                              Let me summarize:
                              - Possible to have uneven teams
                              - Preferable player on 1 side bots on the other
                              - For every player there should be X bots

                              Such list must be very simple and not in conflict (which some of your statements are; not clear enough). It is hard to guess what you really want.

                              Comment


                                #30
                                Mapmixer? I will find it and check it out.

                                - Possible to have uneven teams, YES
                                - Preferable player on 1 side bots on the other, YES but I want some bots on my team.
                                - For every player there should be X bots, not necessarily. Would be cool though.


                                See attached pic from the campaign mode of UT3. I just want to do the below with a mutator in any GT i select in the menu screen (CTF or WAR etc). Just 2 or more extra blue bots.
                                Click image for larger version

Name:	Uneven2.jpg
Views:	1
Size:	55.4 KB
ID:	3250994
                                Click image for larger version

Name:	Uneven.jpg
Views:	1
Size:	18.4 KB
ID:	3250993

                                Comment

                                Working...
                                X