Changing AI behavior

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Changing AI behavior

Post by wishihadaname »

Is there a way to make the AI shoot their guns at tanks instead of spam grenades? That stupid behavior is killing my sfx memory pool and making things like the flame thrower and EMP launcher look bad.
501st_commander
Master Bounty Hunter
Master Bounty Hunter
Posts: 1570
Joined: Wed Dec 10, 2008 7:48 pm

Re: Chaning AI behavior

Post by 501st_commander »

kinetosimpetus wrote: Short answer: No.
Long answer: Noooooooooooooooooooooooo.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Chaning AI behavior

Post by Maveritchell »

501st_commander wrote:
kinetosimpetus wrote: Short answer: No.
Long answer: Noooooooooooooooooooooooo.
Short answer: Wrong.
Long answer: Wrong. You can adjust what each weapon individually is used for with the "AITargetXXX" .odf parameters. E.g.:

Code: Select all

AITargetPerson        = "1"
AITargetAnimal        = "1"
AITargetDroid         = "1"
AITargetVehicle       = "0"
AITargetBuilding      = "0"
That's the easy way, to just tell the AI not to throw grenades and to shoot their guns (regular blasters should disable vehicle targeting by default). You can also tool around with the range parameters in the weapon .odfs to give a wider range in which the AI use their guns and a smaller range in which they throw grenades (if you want them to use both).
501st_commander
Master Bounty Hunter
Master Bounty Hunter
Posts: 1570
Joined: Wed Dec 10, 2008 7:48 pm

Re: Chaning AI behavior

Post by 501st_commander »

Maveritchell wrote:
501st_commander wrote:
kinetosimpetus wrote: Short answer: No.
Long answer: Noooooooooooooooooooooooo.
Short answer: Wrong.
Long answer: Wrong. You can adjust what each weapon individually is used for with the "AITargetXXX" .odf parameters. E.g.: ....
Ah, sorry, i thought it was hard-coded for some reason :?
kinetosimpetus
Imperial Systems Expert
Imperial Systems Expert
Posts: 2381
Joined: Wed Mar 25, 2009 4:15 pm
Projects :: A secret project
Games I'm Playing :: Warframe STO

Re: Chaning AI behavior

Post by kinetosimpetus »

Nope not hardcoded. :)

I made AI shoot rocket launchers at infantry once, mifht do it again...
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Chaning AI behavior

Post by Eggman »

Maveritchell wrote:
501st_commander wrote:
kinetosimpetus wrote: Short answer: No.
Long answer: Noooooooooooooooooooooooo.
Short answer: Wrong.
Long answer: Wrong. You can adjust what each weapon individually is used for with the "AITargetXXX" .odf parameters. E.g.:

Code: Select all

AITargetPerson        = "1"
AITargetAnimal        = "1"
AITargetDroid         = "1"
AITargetVehicle       = "0"
AITargetBuilding      = "0"
That's the easy way, to just tell the AI not to throw grenades and to shoot their guns (regular blasters should disable vehicle targeting by default). You can also tool around with the range parameters in the weapon .odfs to give a wider range in which the AI use their guns and a smaller range in which they throw grenades (if you want them to use both).
Logic agrees with that post, but for some reason I've never been able to prevent AI from tossing grenades at tanks. Definitely try that first though, since it is supposed to be the correct solution.
mswf
Master Bounty Hunter
Master Bounty Hunter
Posts: 1674
Joined: Tue Mar 31, 2009 3:40 pm
Location: Twello, The Netherlands
Contact:

Re: Chaning AI behavior

Post by mswf »

[guess]That could be because grenades have splash damage and because of the AI not being able to see where an obstruction (= hull of vehicle) is.[/guess]
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Chaning AI behavior

Post by Teancum »

If that's killing your effects pool I strongly suggest trimming down the overall level. If you're getting issues there then the level will likely never work online.
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Chaning AI behavior

Post by Eggman »

mswf wrote:[guess]That could be because grenades have splash damage and because of the AI not being able to see where an obstruction (= hull of vehicle) is.[/guess]
Nope, it's definitely hordes of bots running up to the vehicle and deliberately throwing grenades at point-blank range.
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Chaning AI behavior

Post by wishihadaname »

I did that but they still aren't shooting. I changed the common files for each type of blaster vehicles so the AI targets vehicles but they still only spam grenades.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Chaning AI behavior

Post by Fiodis »

Did you change the grenade odfs as well?
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Chaning AI behavior

Post by wishihadaname »

Nevermind, it is working, I just didn't notice it before. The AI will only target a tank if it shoots at them, otherwise they just ignore it. Is there a way to make them more noticable?
501st_commander
Master Bounty Hunter
Master Bounty Hunter
Posts: 1570
Joined: Wed Dec 10, 2008 7:48 pm

Re: Chaning AI behavior

Post by 501st_commander »

I believe that is hard-coded. They will only shoot of it bumps into them or shots at them.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Chaning AI behavior

Post by Maveritchell »

wishihadaname wrote:Nevermind, it is working, I just didn't notice it before. The AI will only target a tank if it shoots at them, otherwise they just ignore it. Is there a way to make them more noticable?
You can also tool around with the range parameters in the weapon .odfs to give a wider range in which the AI use their guns and a smaller range in which they throw grenades (if you want them to use both).
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Chaning AI behavior

Post by wishihadaname »

I know about the range thing and I fiddled arround with that too. I'm wondering though, what if I changed their unit type to assault? Don't assault units attack vehicles?
Post Reply