Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); In-development patch notes for Starsector 0.98a (2/8/25)

Author Topic: AI Controlled Ship won't Attack  (Read 7056 times)

Psiyon

  • Admiral
  • *****
  • Posts: 778
    • View Profile
AI Controlled Ship won't Attack
« on: February 03, 2012, 07:14:32 PM »

I have a ship that only uses missiles for weapons (One weapon group, two weapon slots using alternating fire). When I command the ship, it works perfectly fine, however, when controlled by the AI, it refuses to attack anything. It'll just nudge up real close to an enemy ship and sit there as it gets destroyed. I did notice a ship fire once or twice, but after firing off a few missiles it never attacks anything again, like the ship's crew was suddenly replaced by hippies.

Any ideas as to what the problem could be? Because I'm absolutely clueless. I've combed through all the relevant files and nothing seemed to stand out to me, and numerous changes in many areas had no affect at all.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25139
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #1 on: February 03, 2012, 07:20:38 PM »

What types of targets is the ship fighting against? Frigates, or something larger? What "ai hints" did you specify in the spreadsheet for it? DO_NOT_AIM sounds like one you might need, if the missiles are guided (and don't need to be fired directly at the target). You probably don't want STRIKE.

Ahh, also - did you set the "range" on the weapon, in the spreadsheet? For missiles, even though they are governed by speed and flight time, the AI uses the "range" column as a hint for when to fire the weapon.

How much ammo do the missiles have? If it's low, the AI will be very conservative about firing them, waiting for a good opportunity (shields down if the missiles are HE, shields up if they're kinetic, etc).


Edit: the Pilum LRM sounds like the best missile to copy from for your purposes.
« Last Edit: February 03, 2012, 07:28:48 PM by Alex »
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 778
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #2 on: February 03, 2012, 07:47:18 PM »

Ah, thank you--yes, setting the DO_NOT_AIM hint did the trick perfectly. Don't know why I didn't think to try that, seems like an obvious choice. I guess I'm just used to the ass-backwards nature of modding Homeworld 2. :P
Logged

Kilvanya

  • Commander
  • ***
  • Posts: 115
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #3 on: February 04, 2012, 08:52:56 AM »

FTW!!!
Logged

megal00t

  • Commander
  • ***
  • Posts: 209
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #4 on: February 04, 2012, 10:08:26 AM »

so psiyon was the guy behind orbit of god xD
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25139
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #5 on: February 04, 2012, 10:15:56 AM »

Ah, thank you--yes, setting the DO_NOT_AIM hint did the trick perfectly. Don't know why I didn't think to try that, seems like an obvious choice. I guess I'm just used to the ass-backwards nature of modding Homeworld 2. :P

Oh, anything is ass-backwards if you look at it the right way :) Glad you got it working - I remember having similar trouble with a new missile I was adding a while back, except in my case it was forgetting to set the range.
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 778
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #6 on: March 01, 2012, 07:14:38 PM »

This problem cropped up again: this time with a fighter wing. I'm trying to make a bomber that fires unguided rockets, however, I can't get it to work in the slightest. It fires other weapons just fine--but as soon as I give it a missile, it won't do a thing. I've tried setting the role in wing_data.csv from Bomber, to Assault, to Fighter, but none of them worked. Even though the missile weapon had DO_NOT_AIM, it still wouldn't fire even with an arc of 360.

Any help would be appreciated.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25139
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #7 on: March 01, 2012, 07:23:10 PM »

Did you set the range for the missile in weapon_data.csv? That's what the AI uses to figure out when to fire it - not the actual flight time + top speed.
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 778
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #8 on: March 01, 2012, 07:52:31 PM »

The weapon range was set to about 850, I think. Ammo was also changed to infinite from a previous value of 20, and neither worked.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25139
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #9 on: March 01, 2012, 08:19:37 PM »

Hmm. Not sure what it could be, but I just tried fitting a Piranha with an Annihilator Rocket Launcher, and it used that - might be a good place to start.
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: AI Controlled Ship won't Attack
« Reply #10 on: March 01, 2012, 11:16:45 PM »

Set the fighter`s flux above 300.

For some reason AI wont fire missiles if it has lower flux values (even if missiles have no flux generation).

jocan2003

  • Lieutenant
  • **
  • Posts: 96
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #11 on: March 02, 2012, 02:15:41 AM »

Good catch!
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 778
    • View Profile
Re: AI Controlled Ship won't Attack
« Reply #12 on: March 02, 2012, 10:20:07 AM »

Set the fighter`s flux above 300.

For some reason AI wont fire missiles if it has lower flux values (even if missiles have no flux generation).
That's... interesting. I'll see if it works when I get home, but I'm guessing that it will, as the fighter has a flux value of 80.
Logged