[Preview] Retarded Insane Bots
-
Hello everyone. [Post updated]
Videos first:
DOME gameplay
https://www.youtube.com/watch?v=p-s4GAzio9MLOOKOUT gameplay
https://www.youtube.com/watch?v=dIoZ0FlRchsAGROUND gameplay
https://www.youtube.com/watch?v=0psYJKaDwukI'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:
- Works in Deathmatch or Gungame
- In order to increase difficulty use Hardcore
- You may also edit bot speed in script - gsc.setDvar("testClients_doSpeed", 12) - increase speed to get more insane gameplay
- Decrease the number of bots if the game lags or it is too difficult to play
- bots_under_attack_max variable - allows to set the number of bots under attack from other bots
- BE SURE to enter bot xx command in console BEFORE the countdown before match ends. Do it right after the level loads.
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; }
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.
-
Hey rrq
Is there any place where I could contact you in private about the script? Would be much appreciated!
-
-
Hey rrq
Is there any place where I could contact you in private about the script? Would be much appreciated!
@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.
-
@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.
rrq1257 I can't say much right now but you might be able to work on some smarter bots soon....
-
it's crazy how even 10 years after the game was released there is still a community enjoying and working on this game !
-
https://forum.plutonium.pw/topic/9174/release-lua-scripting
You think you might be able to make better bots now?
-
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
-
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.
-
nice bro but bots dozent move normal like bo2.
i know it is not black ops but i hope to improve that. -
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 -
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_warfareVERsingthegamez
ΒΏEn que lugar se tiene que colocar el archivo descargado y como se usa este Mod?PD:Muchas gracias por compartirlo.
-
My Plutonium folder does not have a scripts folder, and creating one and adding the script does nothing.
-
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_warfareVERsingthegamez Thanks Mate
-
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_warfareVERsingthegamez
Where does the .iwd file go? The github says in iw4x but I'm really confused right now.