Tom Clancy's Rainbow Six 3: Gold Edition

Tom Clancy's Rainbow Six 3: Gold Edition

Schmuddel Dec 4, 2016 @ 11:19am
Improving teammate AI without mods
I'm sure anyone visiting the forum for this game is probably playing Raven Shield 2.0 or has otherwise modded their game, but for those who haven't, I've been looking through the game's source code (which leaked quite a few years back) and I've found a way to make many of the improvements to the teammate AI from 2.0 and other mods using only console commands. The process is as follows:

1. Create a text file with a name of your choosing in the "system" folder. I've used the name "scripts.txt." This file will contain the console commands that need to be executed each time when the mission starts (this is a good way to batch execute console commands in general for those who haven't looked into that yet, such as manually adjusting the mouse sensitivity below the base minimum).

2. Within that file, paste the following:
set R6Engine.R6Rainbow PeripheralVision -0.5 set R6Engine.R6RainbowAI m_fAttackTimerRate 0.15 set R6Engine.R6RainbowAI m_fAttackTimerCounter 0 set R6Engine.R6RainbowAI m_fFiringAttackTimer 0
These commands will set the teammate AI's FOV to 120 (default is 80), reduce the attack interval to every 0.15 seconds (default is every 0.5 seconds), and reduce the reaction time to 0 (default is 0.2 seconds; for reference, terrorist AI has a 1 second reaction time on Recruit, 0.5 on Veteran, and none on Elite).

3. Save the file and find your "user.ini" file in the "save" folder.

4. Within it, edit the "W" entry under "[Engine.Input]" so that it looks like this:
W=MoveForward | exec scripts.txt

5. Now the teammate AI will be significantly improved as soon as you hit the W key (if you have "MoveForward" bound to something else then that should be the key you edit instead).

I'm looking into other means of improving the AI through use of console commands but I haven't come up with anything yet, I'll post those here if I find anything.
Last edited by Schmuddel; Dec 4, 2016 @ 11:20am
< >
Showing 1-15 of 30 comments
Indy409 Dec 4, 2016 @ 3:35pm 
sounds great keep up the great work.
Schmuddel Dec 10, 2016 @ 2:39pm 
Well, I've figured out how to force single fire on the AI through console commands, but it comes with some problems. This is what you would use:
set R6Weapons m_eRateOfFire ROF_Single set R6Weapons m_stWeaponCaps (bThreeRound=0,bFullAuto=0)
The first line manually sets all weapons in the game world to single fire, the second removes the burst fire and autofire properties from those weapons. Normally, when the AI engages the enemy, they will immediately set their weapons to autofire (or whatever the closest to autofire is, like the M16A2's burst fire). Removing the burst fire and autofire capabilities from the weapons entirely is the only way to keep them from doing that.

One problem: the code as is will force all weapons in the game world to use single fire and remove their other firing modes. This includes your weapons and the weapons of terrorists. The only way around this is to force those changes only on specific weapons. For instance, you could force it only on the MP5SD5 by replacing "R6Weapons" with "R63rdWeapons.SubMP5SD5." Other than that, I'm at a loss as to how to force it only on the teammate AI's weapons. It shouldn't really be a problem if you're only interested in having AI-only executed plans. If you personally fire all your weapons in single fire, you won't really notice the difference either. Conceivably, if you really wanted single fire without complications, you could give them only pistols, which works decently in my testing. Note that the P228 with extended mags will get you the most amount of pistol ammo possible, whereas the SPP is always the largest pistol mag (good for vanilla bots who have a tendency to reload at inopportune times).

Four other smaller commands you could use:
set R6Engine.R6RainbowTeam m_bSniperHold False
This will force snipers to automatically engage targets without you having to signal the "snipers free" code. In my experience, this one can be a little buggy so feel free to experiment.

set R6Engine.R6RainbowAI m_bIgnoreBackupBump True
This will cause teammates to no longer "bump" out of the way when other NPCs walk into them. This could be a problem or beneficial depending on the circumstances, so again, experiment. If you regularly use plans that require more than one team to use the same paths then I would strongly consider this one.

set R6Engine.R6RainbowAI c_iDistanceBumpBackUp 40 set R6Engine.R6RainbowAI C_fMaxBumpTime 0.1
Alternatively, the above two commands should change the distance the AI will back up when bumped and how long they will stay in the bumped state before returning to normal. The normal value for the distance is 80 and the normal value for the time is 1. Tweak these as you see fit.

set R6Engine.R6RainbowTeam m_iFormationDistance 50
This command will change the distance the teammate AI will maintain between each other when moving in formation. The default is 100. So, conceivably, by cutting the formation and bump distances in half, the bots will stay in a tighter group and will be able to navigate smaller areas more effectively. Finding the right values will, of course, require experimentation on your part.
Last edited by Schmuddel; Dec 10, 2016 @ 2:59pm
Indy409 Dec 11, 2016 @ 3:31pm 
Here is my issue with the commands if I have to hit w Everytime how would I know which commands where issued...Also ai have terrible time stacking a door correctly think most the time they die is entering a door way all bunched up any fix for that?... Is there a way to make a init file instead of w commands thanks for great findings.
Schmuddel Dec 11, 2016 @ 4:05pm 
Originally posted by Indy:
Here is my issue with the commands if I have to hit w Everytime how would I know which commands where issued...Also ai have terrible time stacking a door correctly think most the time they die is entering a door way all bunched up any fix for that?... Is there a way to make a init file instead of w commands thanks for great findings.
The way it's set up, all commands in the txt file you specify will be executed every single time you hit W. You could bind any other key to execute the file to avoid numerous console commands being used every single time. A good option would be the key for your primary weapon, since that isn't pressed very often. Unfortunately, I don't think there's a way to autoexecute these commands, and even if there was, they would need to be executed upon the start of each mission, not when the game actually launches.

As far as fixes for the team's movement goes, I've been experimenting quite a bit and have found a good combination for keeping the formation tighter while also avoiding unnecessary crowding up. Try this:
set R6Engine.R6RainbowAI c_iDistanceBumpBackUp 50 set R6Engine.R6RainbowAI C_fMaxBumpTime 0.1 set R6Engine.R6RainbowTeam m_iFormationDistance=60 set R6Engine.R6RainbowTeam m_iDiagonalDistance=50 set R6Engine.R6Rainbow CollisionRadius 25 set R6Engine.R6Rainbow m_fAttachFactor 0.1
There are three commands here I haven't mentioned before. "m_iDiagonalDistance" affects the formation size in much the same way as "m_iFormationDistance" (default is 80). "CollisionRadius" affects, as the name implies, the radius within which the game will register the teammate colliding with something (default is 38). I've found that lowering this value greatly helps the formation in smaller areas and prevents lots of bunching up in front of doorways and the like. Bear in mind that lowering this value too much will cause issues with their pathing, since it also affects whether the game registers them colliding with walls and doorways and such. The last command, "m_fAttachFactor," affects how rigidly your teammates follow behind one another (default is 0.909091). Smaller formation distances than this usually result in your teammates being right on top of each other and it looks awkward, but feel free to tweak as you like.

Although this is not related to the teammate AI, I've personally never liked how the weapons are positioned in the right corner of the screen, I strongly prefer the Ground Branch style of placing the viewmodel in the center. After tweaking Z-Maniac's 3D Irons mod, I've determined that you can't get accurate ironsights just by repositioning the viewmodels in-game, but you can still move them from the corner of the screen to the center. The command you need for that is as follows:
set R63rdWeapons.SubMP5SD5 m_vPositionOffset (Y=-5)
The "m_vPositionOffset" command accepts X, Z, and Y coordinate inputs. X determines how close or far away the viewmodel is from the crosshair (think of it as moving the weapon toward and away from you), Z determines the up and down angle of the weapon (in other words, closer to the top of the screen or closer to the bottom), and Y determines the weapon's position along the bottom. The X and Z coordinates don't matter too much for the purpose of centering the viewmodel, but the Y definitely does, so that's the only one changed here. Each weapon will require a different Y value, as each model is slightly different. You can determine the exact position very precisely, but I personally prefer to use whole integers for it. What numbers you choose is up to you. If you wanted to change the X and Z values as well, the code would look like this instead:
set R63rdWeapons.AssaultFAMASG2 m_vPositionOffset (X=5,Y=-7,Z=-5)

If you want the specific data on this, you can get the source code for version 1.56 (the 1.6 changes were almost exclusively multiplayer changes so the info from 1.56 is still good) from Twi's Raven Shield SDK.
Last edited by Schmuddel; Dec 11, 2016 @ 4:09pm
Indy409 Dec 12, 2016 @ 10:08am 
4. Within it, edit the "W" entry under "[Engine.Input]" so that it looks like this:
W=MoveForward | exec scripts.txt

How can I use a different letter other than w or is it not possible. See I use w for my movement and that would be a pain to change.
Schmuddel Dec 12, 2016 @ 5:40pm 
Originally posted by Indy:
4. Within it, edit the "W" entry under "[Engine.Input]" so that it looks like this:
W=MoveForward | exec scripts.txt

How can I use a different letter other than w or is it not possible. See I use w for my movement and that would be a pain to change.
Oh, that's easy, just scroll through that section until you find the letter you want. For instance, if you wanted to use M (which I don't think is used at all by default), you would do this:
M=exec scripts.txt

If you wanted to bind your primary weapon key to it, it would look like this:
1=PrimaryWeapon | exec scripts.txt

Pretty simple stuff, I think there's even keys in there that you normally can't bind in-game, such as the numpad keys (trying to bind, say, numpad 0 in-game will cause the Insert key to be bound instead).
Jones181 May 27, 2017 @ 6:45pm 
Made the game much much much more fun to play. Thank you for sharing this :)
Last edited by Jones181; May 27, 2017 @ 6:49pm
Originally posted by J0n3z:
Made the game much much much more fun to play. Thank you for sharing this :)

Added you to our Steam Group https://steamcommunity.com/groups/ALLR6

Check out www.r6chat.com dude =D
400 of us on there. Voice and text community 99% of us play this game.
And of course many others. I run the ALLR6.com servers.

Schmuddel? Are you on our Discord in r6modding?

Get the app from www.discordapp.com/download
Last edited by Legacy | Tactical-Gaming.net; May 28, 2017 @ 5:46am
Indy409 May 28, 2017 @ 7:31am 

3. Save the file and find your "user.ini" file in the "save" folder.

4. Within it, edit the "W" entry under "[Engine.Input]" so that it looks like this:
W=MoveForward | exec scripts.txt

[/quote]

is this the user engine you are talking about ..[Engine.PlayerInput]
MouseSmoothingMode=1
MouseSensitivity=3.000000
MouseSamplingTime=0.011064
DoubleClickTime=0.250000
Schmuddel May 28, 2017 @ 7:38am 
Originally posted by Indy:
is this the user engine you are talking about ..[Engine.PlayerInput]
MouseSmoothingMode=1
MouseSensitivity=3.000000
MouseSamplingTime=0.011064
DoubleClickTime=0.250000
No, that stuff is related to the mouse input settings, the settings I'm referring to are related to the keybindings. An easy way to find it would be to use CTRL+F to bring up the "find" menu in Notepad and search for "W=MoveForward." If you use a different control scheme like ESDF, then it would be "E=MoveForward" instead.

Also it's been a while since I posted here and I'm sure this isn't a terribly new tweak, but for those who don't know, when you're in your "user.ini" file, you can change the leaning behavior to toggle instead of the usual press-and-release by finding these lines:
Aliases[6]=(Command="Button m_bPeekLeft",Alias="PeekLeft") Aliases[7]=(Command="Button m_bPeekRight",Alias="PeekRight")
Change "Button" to "Toggle" so that it looks like this:
Aliases[6]=(Command="Toggle m_bPeekLeft",Alias="PeekLeft") Aliases[7]=(Command="Toggle m_bPeekRight",Alias="PeekRight")
I find this is a lot more comfortable and easy to use than the usual leaning behavior. You can lean and then slowly peak around a corner without much issue, it almost makes fluid lean obsolete.

I might make a Steam guide with this and other tweaks because pretty much every other resource for this game is a decade old and full of broken links.
Indy409 May 28, 2017 @ 8:09am 
ok so as far as stacking commands do I still need to hit P which is my command button I am using for them to be less bunched up or do I just put it in a txt. doc then in a folder and name it script.txt confused sorry.
Schmuddel May 28, 2017 @ 8:15am 
Originally posted by Indy:
ok so as far as stacking commands do I still need to hit P which is my command button I am using for them to be less bunched up or do I just put it in a txt. doc then in a folder and name it script.txt confused sorry.
If those commands are in your script.txt file and you have P bound to execute those commands then they're all executed at the same time. And yes, you do need to execute them each and every time you start up a mission, hence using a key that you would probably use all the time anyway to execute them. Just leaving the script.txt file in your "system" folder won't do anything. Also bear in mind that the file does need to be in the "system" folder, not just any folder.

Also I should mention that those stacking commands require a LOT of tweaking to get right, try not to get too frustrated with it. If push comes to shove and a mission still has stacking SNAFUs then I say use teams with three operatives max. I personally rarely use four operative teams anymore for that reason.
Last edited by Schmuddel; May 28, 2017 @ 8:18am
Indy409 May 28, 2017 @ 8:18am 
yeah I got it in my sys folder..But is the text doc suppose to be in a yellow folder which is named script or just leave the text doc named script.txt in the sys folder?
Indy409 May 28, 2017 @ 8:21am 
[Engine.Input]
p=MoveForward | exec scripts.txt
Aliases[0]=(Command="Button bFire | Fire",Alias="PrimaryFire")
< >
Showing 1-15 of 30 comments
Per page: 1530 50