Classic Battlefield Modding Wikia
Advertisement

Bot's viewdistance, and some other misc bot targeting info

[IMTH} The max distance that bots will fire at an enemy seems to be capped at ~250 meters, and the max view distance is whatever the "GameLogic.MaximumLevelViewDistance #" is set too. You can change the distance that bots want to fire at enemys at with the 2 lines,

weaponTemplate.maxRange ###
weaponTemplate.optimalRangePercentage ##

Yes, there is a remed out "aiSettings.setViewDistance ###" line in a map's ai.ai file, but it doesn't seem to do anything. So ignore it. However, Outsider says that adding that line in the "mods/(mod)/levels/LEVEL/AI/ai.ai", file, will work.



[Outsider] aiTemplatePlugIn.setIsAntiAircraft used to be a boolean value, but it was changed during BF2 development to be an enumeration. The following values are valid for aiTemplatePlugIn.setIsAntiAircraft:

0 = Do not attack vehicles that are marked with ITAir and are more than 5m above ground and/or moving faster than a certain speed. This is the default, and hence there is no need to actually put this in a file. 1 = Treat airborne vehicles as any other vehicle. Attack them at will. 2 = The unit is allowed to take opportunity shots at airborne enemies if it gets the chance. For instance, if a tank gets attacked by a helicopter head on, and the helicopter is close enough to where the tank is already aiming, then the tank can try and take out the helicopter, but if it misses, and the helicopter passes, then the tank is not allowed to chase after the helicopter.



[Outsider] The bot skill is used to see how big a part of the ai weapon deviation is used (there is a default value that most weapons use, so that's why you don't normally see it). Time is also involved. A bot that keeps shooting at the same target will have its deviation decreased. A bot skill of 1 results on no additional bot deviation.

The bots target the point that they see. They first try to see the centre of an object, if that fails, they try for the camera, and if that fails they try for a random position.

What's the difference between an AI.ai file in the 'map' and an AI.ai file in the levels/AI folder?


the map settings override the default mod ones, so you can have the ai set up on a custom per-map basis.

the pathfinding commands let you set different navmesh brush widths, plus specifying clusters for boats on water maps etc. as well as being a handy spot to launch any command line items you want to affect the gameplay, like maxBots or teamRatioPercent or other similar adjustments

[Outsider] The bot skill is used to see how big a part of the ai weapon deviation is used (there is a default value that most weapons use, so that's why you don't normally see it). Time is also involved. A bot that keeps shooting at the same target will have its deviation decreased. A bot skill of 1 results on no additional bot deviation.

The bots target the point that they see. They first try to see the centre of an object, if that fails, they try for the camera, and if that fails they try for a random position.

[outsider] To increase weapon accuracy: 

Open the tweak file for the weapon and you'll find this (RPK74 is the example):

ObjectTemplate.deviation.setFireDev 0.8 0.4 0.02 Recoil for standing, crouching, lying, that is your deviation will increase by this amount everytime you fire a bullet.

ObjectTemplate.deviation.minDev 0.8 Minimum deviation, deviation will never get less than this.

ObjectTemplate.deviation.setTurnDev 0 0 0 0 How much quick turning will affect deviation, not sure about the numbers.

ObjectTemplate.deviation.setSpeedDev 4 0.6 0.6 0.1 How much forward speed affects your deviation, probably max - min for unzoomed and zoomed mode.

ObjectTemplate.deviation.setMiscDev 3 3 0.1 I belive at least one of these mdifiers are for jumping.

ObjectTemplate.deviation.devModStand 2 ObjectTemplate.deviation.devModCrouch 1.5 ObjectTemplate.deviation.devModLie 0.8 Basic deviation for each pose.


[Outsider] For changing the number of mags, go into the weapons tweak file and change this value:

ObjectTemplate.ammo.nrOfMags 8

To get more shots in each mag, change this line instead:

ObjectTemplate.ammo.magSize 15


[Das roach] those tweak files are goldmines for stuff to alter

NB: all these files are located in the Objects_server.zip file

for instance, to change the damage on the m24 sniper rifle, goto Weapons\handheld\usrif_m24\ and open the usrif_m24.tweak file with notepad.

scroll down towards the bottom half of the file and find the bit that says

CODE

rem ------------------------------------- ObjectTemplate.addTemplate S_usrif_m24_Projectile_Looping rem ------------------------------------- ObjectTemplate.timeToLive CRD_NONE/1/0/0 ObjectTemplate.material 38 ObjectTemplate.hasOnTimeEffect 1 ObjectTemplate.minDamage 1 ObjectTemplate.damage 95


you can increase the value of ObjectTemplate.damage to increase the damage that each bullet does... i asume the numerical value is the number of hitpoints damage done by each bullet that hits..

because i only play SP, i changed the sniper rifles damage to 150 on all of them and they are 1 shot kill weapons... unbalanced, but fun i enjoy climbing to the top of the crane and pretending to be the sniper from "navy seals"

for instance, the SA80 causes 32 damage with each bullet ....

if you look in the tweak files for the shotguns, you will see this piece of code (this piece was copy/pasted from the remmington)

CODE

rem ------------------------------------- ObjectTemplate.addTemplate S_usrif_remington11-87_Projectile_Looping rem ------------------------------------- ObjectTemplate.timeToLive CRD_NONE/0.15/0/0 ObjectTemplate.material 41 ObjectTemplate.minDamage 8 ObjectTemplate.damage 30 ObjectTemplate.distToStartLoseDamage 30 ObjectTemplate.distToMinDamage 100


i gather that this is the bit that configures the range/damage for a shotgun.... each pellet does 30 points damage if the target is under 30 meters away but the damage figure tapers down to a minimum damage of 8 per pellet @ 100 meters

i assume BF2 measure in meters?

theres alot more interesting stuff hidden away in there has anyone figured out what needs to be changed in order to force the player to manually unzoom with the scope? i dont particularily like having to hold down the right mouse button in order to watch a kill when i am sure its quite easy to make it a toggle

This post has been edited by DasRoach: Jun 22 2005, 05:35 AM

[Outsider] Yes, the BF engines use the SI-system (so diststances are measured in meters).

Advertisement