Skip to content
  • 0 Unread 0
  • 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 10.3k 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.
  • RektInator Offline
    RektInator Offline
    RektInator
    Plutonium Admin
    wrote on last edited by
    #6

    rrq1257 said in [Preview] Retarded Insane Bots:

    (remove all other chai scripts before running of course)

    Nice work!

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

      Do you plan on expanding on this further?

      1 Reply Last reply
      0
      • rrq1257 Offline
        rrq1257 Offline
        rrq1257
        wrote on last edited by
        #8

        UPDATE: I've modified the code. 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.

        I don't know how to make the script better. Maybe someone else will be able to develop a true bot script.

        VERsingthegamez 1 Reply Last reply
        1
        • rrq1257 rrq1257

          UPDATE: I've modified the code. 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.

          I don't know how to make the script better. Maybe someone else will be able to develop a true bot script.

          VERsingthegamez Offline
          VERsingthegamez Offline
          VERsingthegamez
          wrote on last edited by
          #9

          rrq1257 One day. Does this mod now work on all maps? I had some maps where the bots acted like they normally do.

          rrq1257 1 Reply Last reply
          0
          • VERsingthegamez VERsingthegamez

            rrq1257 One day. Does this mod now work on all maps? I had some maps where the bots acted like they normally do.

            rrq1257 Offline
            rrq1257 Offline
            rrq1257
            wrote on last edited by
            #10

            VERsingthegamez Should work on any map, but better results will be on smaller maps - on large maps the bots don't see each other and don't attack each other.

            1 Reply Last reply
            0
            • S3VDITO Offline
              S3VDITO Offline
              S3VDITO
              wrote on last edited by
              #11

              Try to add waypoints πŸ™‚

              If bots cannot see each other, then they will move along these points to find someone

              1 Reply Last reply
              0
              • rrq1257 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_Guts Offline
                PTSD_Guts 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
                • w91 Offline
                  w91 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!

                  rrq1257 1 Reply Last reply
                  0
                  • w91 Offline
                    w91 Offline
                    w91
                    wrote on last edited by
                    #14

                    rrq1257

                    1 Reply Last reply
                    0
                    • w91 w91

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

                      rrq1257 Offline
                      rrq1257 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. Android 1 Reply Last reply
                      0
                      • rrq1257 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. Android Offline
                        Mr. Android 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
                        • Thanatos Offline
                          Thanatos 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
                          • VERsingthegamez Offline
                            VERsingthegamez 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
                            • Thanatos Offline
                              Thanatos 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
                              • DerekRTX Offline
                                DerekRTX 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
                                • DeadEyeQe Offline
                                  DeadEyeQe 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
                                  • VERsingthegamez Offline
                                    VERsingthegamez 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

                                    DerekRTX [141]Cpt.Ghost 09nick 3 Replies Last reply
                                    3
                                    • VERsingthegamez 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

                                      DerekRTX Offline
                                      DerekRTX 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
                                      • terrminated Offline
                                        terrminated 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
                                        • VERsingthegamez 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.Ghost Offline
                                          [141]Cpt.Ghost Offline
                                          [141]Cpt.Ghost
                                          wrote on last edited by
                                          #25

                                          VERsingthegamez Thanks Mate

                                          1 Reply Last reply
                                          0

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better πŸ’—

                                          Register Login
                                          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
                                          • Unread 0
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Donate