Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. MW3 Modding Releases & Resources
  3. [Preview] Retarded Insane Bots

[Preview] Retarded Insane Bots

Scheduled Pinned Locked Moved MW3 Modding Releases & Resources
26 Posts 13 Posters 5.9k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • rrq1257undefined rrq1257

    Hello everyone. [Post updated]

    Videos first:

    DOME gameplay
    https://www.youtube.com/watch?v=p-s4GAzio9M

    LOOKOUT gameplay
    https://www.youtube.com/watch?v=dIoZ0FlRchs

    AGROUND gameplay
    https://www.youtube.com/watch?v=0psYJKaDwuk

    I've modified AIBots animated movement script by S3VDITO (found here) in order for bots to target and engage the player (and other bots too).
    Save the script as retbots.chai in C:\Users\<your username>\AppData\Local\Plutonium\storage\iw5\scripts folder
    (remove all other chai scripts before running of course)

    UPDATE: now script runs with any count of bots and there was added some kind of player protection after spawn - the bots won't target the player for some random seconds after spawn.

    The bots shoot infinitely and move to the player when see him and engage him (and other bots; only first 9 bots are attacked - set the bots_under_attack_max variable, you may decrease or increase the count but on my system I've got slowdowns if more than 9 bots were attacked by other bots).

    The script works in DM; also I've tried it in Gungame, but only the player has weapon progress, the bots have default weapons as in DM.

    Sorry for bad code, no time to fix it at all. That's just proof-of-concept!

    I don't have deep knowledge of Plutonium MW3 scripts, I am sure there are more experienced devlopers who can improve this code. The bots are still stupid, but they attack you and don't run around like dummies - that's the thing I wanted to have since installed MW3.

    The script is provided AS-IS, no warranties of any kind

    Many thanks to S3VDITO !

    MANUAL:

    1. Works in Deathmatch or Gungame
    2. In order to increase difficulty use Hardcore
    3. You may also edit bot speed in script - gsc.setDvar("testClients_doSpeed", 12) - increase speed to get more insane gameplay
    4. Decrease the number of bots if the game lags or it is too difficult to play
    5. bots_under_attack_max variable - allows to set the number of bots under attack from other bots
    6. BE SURE to enter bot xx command in console BEFORE the countdown before match ends. Do it right after the level loads.

    Download script

    Here is the script source:

    // Retarded Insane bots version 0.0.0.2
    // Feel free to modify this code as you want!
    
    // Many thanks and credits to:
    // AIBots by S3VDITO
    
    
    gsc.setDvar("testClients_doAttack", 1);
    gsc.setDvar("testClients_doCrouch", 0);
    gsc.setDvar("testClients_doMove", 1);
    gsc.setDvar("testClients_doReload", 0);
    gsc.setDvar("testClients_doWatchKillcam", 1);
    gsc.setDvar("scr_dm_playerrespawndelay", 0); // for hardcore
    
    //gsc.setDvarIfUninitialized("testClients_doSpeed", 4);
    gsc.setDvar("testClients_doSpeed", 12);
    
    global bot_speed = to_float(gsc.getDvar("testClients_doSpeed"));
    
    global players_list = [];
    global player_target_list = [];
    
    global bots_under_attack_max = 9;
    
    global protectPlayer = false;
    global protectPlayerInterval = 3000;
    
    level.onNotify("connected", fun(args) {
    	var player = args[0];
    	print(player.getGuid().find("bot"));
    	if(player.getGuid().find("bot") != 0)
    	{
    		print("Player connected");
    		player_target_list.push_back_ref(player);
    		
    		player.onNotify("spawned_player", fun[player](arguments) {
    			protectPlayerOnSpawn(player);
    		});
    	}
    
    	players_list.push_back_ref(player);
    });
    
    level.onNotify("prematch_done", fun(args) {
    	if(gsc.getDvar("g_gametype") == "dm" || gsc.getDvar("g_gametype") == "gun") {
    		for(var entRef = 0; entRef < players_list.size(); ++entRef)
    		{
    			var tempEntBot = gsc.getEntByNum(entRef);
    			if(tempEntBot.getGuid().find("bot") == 0)
    			{
    				var animBody;
    				//var animBody = gsc.spawn("script_model", tempEntBot.getOrigin());
    				//animBody.setmodel("mp_body_delta_elite_assault_ab");
    				//animBody.notsolid();
    				
    				//animBody.LinkTo(tempEntBot, "tag_origin", [-4, 0, -1], [-4, 0, -1]);
    				
    				setInterval(fun[tempEntBot, animBody]() { 
    					botMoveOnPlayer(tempEntBot, gsc.getEntByNum(0), animBody); 
    				}, 1);
    				
    				var bots_under_attack = players_list.size() - 1;
    				if (bots_under_attack > bots_under_attack_max)
    				{
    					bots_under_attack = bots_under_attack_max;
    				}
    			
    				for(var i = 0; i < bots_under_attack; ++i)
    				{
    					var targetBot = gsc.getEntByNum(i+1);
    					setInterval(fun[tempEntBot, targetBot, animBody]() { 
    						botMove(tempEntBot, targetBot, animBody); 
    					}, 1);
    				}
    				
    				//setInterval(fun[animBody]() { 
    				//	animBody.scriptModelPlayAnim("pb_stumble_pistol_walk_forward");
    				//}, 1000);
    			}
    		}
    		
    		setInterval(fun[protectPlayer]() { 
    			protectPlayer = false;
    		}, protectPlayerInterval);
    	}
    });
    
    def botMove(bot, target, animModel)
    {		
    	var bot_weapon_origin = bot.getTagOrigin("tag_weapon_left");
    
    	//HideTestClientParts(bot);
    	
    	if(LockSightTest(bot, target) == false)
    	{
    		// animModel.scriptModelPlayAnim("pb_stand_alert_pistol");
    		return;
    	}
    	else
    	{
    		var angle = gsc.vectorToAngles([target.getTagOrigin("j_helmet")[0] - bot_weapon_origin[0], target.getTagOrigin("j_helmet")[1] - bot_weapon_origin[1], target.getTagOrigin("j_helmet")[2] - 25 - bot_weapon_origin[2]]);
    		bot.setPlayerAngles(angle);
    		
    		// Spaming field bug =(
    		//animModel.set("angles", bot.getPlayerAngles());
    	}
    	
    	var moveTarget = target.getOrigin();
    	var distance = gsc.distanceSquared(moveTarget, bot.getOrigin());
    	if(gsc.distance(moveTarget, bot.getOrigin()) <= 256)
    	{
    		// bot_speed = 0;
    	}
    	else
    	{
    		bot_speed = to_float(gsc.getDvar("testClients_doSpeed"));
    		var normalize = gsc.vectorNormalize([moveTarget[0] - bot.getOrigin()[0], moveTarget[1] - bot.getOrigin()[1], moveTarget[2] - bot.getOrigin()[2]]);
    		bot.setOrigin([bot.getOrigin()[0] + normalize[0] * bot_speed, bot.getOrigin()[1] + normalize[1] * bot_speed, bot.getOrigin()[2] + normalize[2] * bot_speed]);
    	}
    }
    
    def botMoveOnPlayer(bot, target, animModel)
    {
    	// Prevent massive spawn killing of human player! The bots will not lock on player after player spawn
    	if (protectPlayer == true)
    	{
    		return;
    	}
    	
    	botMove(bot, target, animModel);
    }
    
    def HideTestClientParts(bot)
    {
    	bot.hidepart("j_ankle_le");
    	bot.hidepart("j_hiptwist_le");
    	bot.hidepart("j_head");
    	bot.hidepart("j_helmet");
    	bot.hidepart("j_eyeball_le");
    	bot.hidepart("j_clavicle_le");
    }
    
    def protectPlayerOnSpawn(player)
    {
    	protectPlayer = true;
    }
    
    
    // Stolen from _stinger.gsc :)
    def LockSightTest(self, target)
    {
    	var eyePos = self.GetEye();
    	
    	var passed = gsc.SightTracePassed(eyePos, target.getOrigin(), false, target);
    	if ( passed == 1)
    	{
    		return true;
    	}
    
    	var front = target.GetPointInBounds(1, 0, 0);
    	passed = gsc.SightTracePassed( eyePos, front, false, target );
    	if (passed == 1)
    	{
    		return true;
    	}	
    
    	var back = target.GetPointInBounds(-1, 0, 0);
    	passed = gsc.SightTracePassed( eyePos, back, false, target );
    	if (passed == 1)
    	{
    		return true;
    	}
    
    	return false;
    }
    
    PTSD_Gutsundefined Offline
    PTSD_Gutsundefined Offline
    PTSD_Guts
    wrote on last edited by
    #12

    rrq1257 Execellent work my guy! It's so nice to see the community still making mods for such an old game like this, and this is an excellent start for a proper bot mod.

    All that's really needed now is waypointing and a few tweaks / additions to the AI and we'll finally get to see a bot mod for MW3! Very nice.

    1 Reply Last reply
    1
    • w91undefined Offline
      w91undefined Offline
      w91
      wrote on last edited by
      #13

      Hey rrq πŸ™‚ Is there any place where I could contact you in private about the script? Would be much appreciated!

      rrq1257undefined 1 Reply Last reply
      1
      • w91undefined Offline
        w91undefined Offline
        w91
        wrote on last edited by
        #14

        rrq1257

        1 Reply Last reply
        0
        • w91undefined w91

          Hey rrq πŸ™‚ Is there any place where I could contact you in private about the script? Would be much appreciated!

          rrq1257undefined Offline
          rrq1257undefined Offline
          rrq1257
          wrote on last edited by
          #15

          @herodias Sorry, I'm not online often and can't offer support for script in private. Just do everything as written in manual in first post ane the script should work.

          Mr. Androidundefined 1 Reply Last reply
          0
          • rrq1257undefined rrq1257

            @herodias Sorry, I'm not online often and can't offer support for script in private. Just do everything as written in manual in first post ane the script should work.

            Mr. Androidundefined Offline
            Mr. Androidundefined Offline
            Mr. Android
            Plutonium Admin
            wrote on last edited by
            #16

            rrq1257 I can't say much right now but you might be able to work on some smarter bots soon....

            1 Reply Last reply
            3
            • Thanatosundefined Offline
              Thanatosundefined Offline
              Thanatos
              wrote on last edited by
              #17

              it's crazy how even 10 years after the game was released there is still a community enjoying and working on this game !

              1 Reply Last reply
              0
              • VERsingthegamezundefined Offline
                VERsingthegamezundefined Offline
                VERsingthegamez
                wrote on last edited by
                #18

                https://forum.plutonium.pw/topic/9174/release-lua-scripting

                You think you might be able to make better bots now?

                1 Reply Last reply
                1
                • Thanatosundefined Offline
                  Thanatosundefined Offline
                  Thanatos
                  wrote on last edited by
                  #19

                  rrq1257 you should take a look at the new release Lua Scripting (https://forum.plutonium.pw/topic/9174/release-lua-scripting)

                  it might give you more possibility to improve the smart bots

                  1 Reply Last reply
                  0
                  • DerekRTXundefined Offline
                    DerekRTXundefined Offline
                    DerekRTX
                    wrote on last edited by DerekRTX
                    #20

                    Hello, very good job you did with the mod, but one question ... is there any way to increase the difficulty to the bots as shown in the videos? Because when I put them in my private game, the only thing they do It is going around shooting like crazy and from time to time taking a detour around the map. Thank you very much and I hope your answer. PS: Excuse my English, I actually speak Spanish so I had to use the translator to write this.

                    1 Reply Last reply
                    0
                    • DeadEyeQeundefined Offline
                      DeadEyeQeundefined Offline
                      DeadEyeQe
                      wrote on last edited by
                      #21

                      nice bro but bots dozent move normal like bo2.
                      i know it is not black ops but i hope to improve that.

                      1 Reply Last reply
                      0
                      • VERsingthegamezundefined Offline
                        VERsingthegamezundefined Offline
                        VERsingthegamez
                        wrote on last edited by
                        #22

                        If anyone wants bots for this game, download this. create a .iwd from the raw files and boom you got bots for the vanilla maps.
                        https://github.com/ineedbots/piw5_bot_warfare

                        DerekRTXundefined [141]Cpt.Ghostundefined 09nickundefined 3 Replies Last reply
                        3
                        • VERsingthegamezundefined VERsingthegamez

                          If anyone wants bots for this game, download this. create a .iwd from the raw files and boom you got bots for the vanilla maps.
                          https://github.com/ineedbots/piw5_bot_warfare

                          DerekRTXundefined Offline
                          DerekRTXundefined Offline
                          DerekRTX
                          wrote on last edited by
                          #23

                          VERsingthegamez
                          ΒΏEn que lugar se tiene que colocar el archivo descargado y como se usa este Mod?

                          PD:Muchas gracias por compartirlo.

                          1 Reply Last reply
                          0
                          • terrminatedundefined Offline
                            terrminatedundefined Offline
                            terrminated
                            wrote on last edited by
                            #24

                            My Plutonium folder does not have a scripts folder, and creating one and adding the script does nothing.

                            1 Reply Last reply
                            1
                            • VERsingthegamezundefined VERsingthegamez

                              If anyone wants bots for this game, download this. create a .iwd from the raw files and boom you got bots for the vanilla maps.
                              https://github.com/ineedbots/piw5_bot_warfare

                              [141]Cpt.Ghostundefined Offline
                              [141]Cpt.Ghostundefined Offline
                              [141]Cpt.Ghost
                              wrote on last edited by
                              #25

                              VERsingthegamez Thanks Mate

                              1 Reply Last reply
                              0
                              • VERsingthegamezundefined VERsingthegamez

                                If anyone wants bots for this game, download this. create a .iwd from the raw files and boom you got bots for the vanilla maps.
                                https://github.com/ineedbots/piw5_bot_warfare

                                09nickundefined Offline
                                09nickundefined Offline
                                09nick
                                wrote on last edited by
                                #26

                                VERsingthegamez
                                Where does the .iwd file go? The github says in iw4x but I'm really confused right now.

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • 1
                                • 2
                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Donate