Tricking the AI

Missile Behavior

I was wondering if there was a way to make the AI undercalculate a weapon's range. It seems to easy with the default A.I. behavior to sit at the edge of it's guided weapons range and let it run itself out of ammo before closing for the kill. It would make for more interesting fights if you actually had to do something more complicated to fight ships armed wit guided weapons.

I suppose it would make for easier monty-pythoning if the guided weapons were the longer range class of armament, but the cases I'm looking at right now are close range fighter-to-fighter missiles.

You can overcalculate the range with dummy subs. Don't think you can undercalculate though.

What about short-range missiles that sub into the real thing after 2 or 3 dummy subs (1-frame subs). Would that do anything?

I don't think so; the AI always seems to use the sum of the subs' ranges as its "fire" trigger.

Yeah, I tried all sorts of sub-munitions ranging from negative velocity ones, freefall bombs or beams with 0 length (though when used as subs they act like normal projectiles, and the AI accounts for that), amongst other things. One thing I did find though, was that if you make any weapon submunition into a point defense turret projectile, it will still take out missiles; it doesn't need to start as a PD turret. So I made myself a secondary fire "decoy flare" weapon that can be deploy to block missiles on your tail. So it wasn't a total waste of time.

Of course that leads to a totally different question, is there a way to use a series of require bits, crons, bits, etc. to switch out an AI variant of a weapon (In this case a PD turret with the flare sprite and can't fire forward/sides checked) with the player variant in a reasonably timely fashion? Immediate would be great, within a day reasonable I suppose.

EDIT: So I've played with it a bit more... figuring out how to make them switch in a day is easy, simply put a cron with an iterative OnStart Gxxy Dxxx with a 100% activation chance when the proper reuire bit, granted by the AI outfit, is set. I can't seem to figure out a way to use the OnCapture field to switch the outfits only when the player chooses to take the ship as their own, though. The best I can do is add an increment a day mission on capture. Though I'm not sure if that's any less kludgy than just having the cron.

This post has been edited by Keldor Sarn : 08 June 2008 - 07:04 PM

Edit: Your edit said pretty much what mine said.

As far as I know, there's no way to distinguish between using a ship as your ship and your escort, so the crön would probably be the best way of going about it.

This post has been edited by Archon : 08 June 2008 - 07:08 PM

Try putting a bit (G/K (i think)) in the Onpurchase/oncapture field to remove the AI only outfit. That should make an escort version of this ship not have the user only weapon.

That works for purchasing the ship, but not for capturing. That requires missions/cröns.

Ah but that gave me an idea... why not give the AI version of the ship both types of weapons, and then Dxxx away the AI one on capture? The AI will only use the AI version of the weapon and the player will only ever see the player version. The AI version will have to have commensurately less in the free mass field, or an additional outfit that removes mass when the player gets it, so it doesn't end up with more free mass than it should. Or, I suppose, just make the AI one mass 0. I think it should work, though.

That works, but how do you get the AI not to use the player's version

Oh yeah, "AI Ships Will Not Use." Why did I never think of that before. :rolleyes:

@keldor-sarn, on Jun 8 2008, 11:19 PM, said in Tricking the AI:

Yeah, I tried all sorts of sub-munitions ranging from negative velocity ones, free-fall bombs or beams with 0 length (though when used as subs they act like normal projectiles, and the AI accounts for that), amongst other things. One thing I did find though, was that if you make any weapon sub-munition into a point defense turret projectile, it will still take out missiles; it doesn't need to start as a PD turret. So I made myself a secondary fire "decoy flare" weapon that can be deploy to block missiles on your tail. So it wasn't a total waste of time.

Ooo.

You ought to put that in the "Cool Nova Hacks" thread (if it isn't listed already).