Author Topic: AI teamkilling in tanks  (Read 710 times)

Offline mft004

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
AI teamkilling in tanks
« on: 14-01-2022, 11:01:56 »
Hello,
sorry it's me again with another question stemming from my singleplayer sub-mod attempt. Basically it seems that the ai when driving a tank ignores checking whether there are any friendly vehicles in the way of a shot to hit an enemy vehicle; the common scenario is that two tanks are firing away at each other and a third tank from one side then joins in, but approaches behind the other friendly tank and fires a shot that teamkills the buddy, which would otherwise have hit the enemy.
I don't see this issue in terms of small arms fire; its rare to see a bot accidentally kill me or another bot with a rifle or machine gun etc, they tend to dodge or just hold fire. Would anyone know what rule is different when they're in vehicles, causing them to be clumsy? I'm guessing it's something to do with their awareness of the hit boxes for the friendly vehicles, but would welcome any input wizards out there might have. If I could find a fix it would make tank battles a bit better.
At first I thought that the fault could lie with the weaponTemplate.deviation and weaponTemplate.allowedDeviation lines pertaining to vehicle weapon ai instructions, with the idea that the bots aren't intending to hit their friend's tank but the deviation causes it instead. However this seems less likely as based on what I've seen ingame, one tank may be driving right behind the friendly tank and point-blank shoots it assuming there's nothing in the way between it and my tank opposing it.
I did ask the ai whether they'd like to comment on their actions but they said nothing.

Kind regards,
Mark
« Last Edit: 14-01-2022, 14:01:41 by mft004 »

Offline SadCamelion

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: AI teamkilling in tanks
« Reply #1 on: 14-01-2022, 16:01:04 »
This is a good question I also always wondered about. That they included kind of a failsafe for infantry, but not for tanks... I think not even the devs know either, but you might want to ask in the discord about it as it is more popular.
There aren't enough Italian tanks.

Offline mft004

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: AI teamkilling in tanks
« Reply #2 on: 06-02-2022, 21:02:57 »
My bad, I wasn't thinking straight; it was just a case of turning off friendly fire in the in-game server settings!

Kind regards,
Mark

Offline SadCamelion

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: AI teamkilling in tanks
« Reply #3 on: 08-02-2022, 18:02:56 »
alright, but that still does not explain why they stop firing as infantry when you stand in front of them but not when driving a tank
There aren't enough Italian tanks.

Offline mft004

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: AI teamkilling in tanks
« Reply #4 on: 10-02-2022, 11:02:05 »
Ya my gut feeling there is that it's an oversight by bf2 developers; as soon as a bot enters a vehicle, the only thing which the eyes of an ally bot sees are the entry points for that vehicle.