Hack request - give AI benefits of MUZZLE_CONE_ANGLE constant
-
gun_fire_accuracy_cone_angle defines the accuracy angle that NPCs fire their guns or auto_turrets with - for example, if you define a cone of 20, they will purposefully miss up to 20* around the target. Set it to something silly like 180 and they’ll fire their guns all over the place including backwards - this seems to ignore the MUZZLE_CONE_ANGLE entry altogether. This adds with a weapon’s dispersion_angle, so AI with an accuracy cone of 10* firing a weapon with a 5* dispersion_angle would be like firing a weapon with a 15* dispersion_angle.
Anyways, I did some tests with weapons set to both auto_turret = true and false. It seems that AI only fire their a weapon when a valid target is actually in front of the weapon itself (auto_turret or plain gun), no matter what the MUZZLE_CONE_ANGLE or accuracy_fire_cone_angle is set to. This is probably what’s stopping AI from gaining the bonus firing arc?
-
That would explain the NPC’s pilot setup, always wondered why they afterburn away, engine kill, rotate and fly straight at you like a kamakaze. They’ve got to look you dead in the eye to shoot at you.
-
It’s actually the literal gun itself that needs to see a target to be able to fire (regardless of rather the gun is an auto_turret or not). How the AI actually fly is just how you set them up to do so with the BuzzPassBy, HeadTowards, etc. blocks under the pilot.
-
Interesting, so what you’re saying then, is that if for example you mounted rear facing guns on ships the NPC’s would be able to shoot at you when they’re flying away from you, they’re not relying on line of sight with a crosshair like a player, just line of sight from the gun?
-
Timmy51m wrote:
Interesting, so what you’re saying then, is that if for example you mounted rear facing guns on ships the NPC’s would be able to shoot at you when they’re flying away from you, they’re not relying on line of sight with a crosshair like a player, just line of sight from the gun?They already do that in Plain FL, the ships with rear-facing turrets always shoot at us.
-
This “issue” is something I’ve noticed as well. The AI’s guns must have direct line of sight to their target in order to fire. Due to the above research it appears to be some sort of inherent AI behavior more than anything else. The AI most definitely does not use the bonus given to players for whatever reason.
-
As far as I can tell, everything uses MUZZLE_CONE_ANGLE. It’s only used in CEGun::CanFire, which makes no distinction between player and NPC. Hacking it to prevent firing works with everyone, so whatever you’re experiencing, it’s not due to MUZZLE_CONE_ANGLE.
-
My next question would be:
So can the NPC’s track multiple targets and fire on them all at the same time, or are they restricted to targetting and firing on one target at a time?
i.e can a fighter use it’s forward guns to target one ship and use a rear facing gun to track another, can battleships track several targets, they’re just a flying gun platform afterall?
-
If you’ve ever watched a station for more than five minutes, you’ll know they can fire at more than one target at once.
-
I guess that means you have, must have been boring!
-
You’re telling me you’ve never fought nearby an enemy station with other people? You’re the one who must have a boring FL life
-
Touche!
P.S - you must be good if you’ve got time to observe the behaviour of station guns and duke it out in pvp at the same time. Don’t tell me, you had one hand tied behind your back, were flipping burgers with your left foot and glugging a beer with the other!
-
Cloak and admin powers?
Nah seriously, just did so much dev for so many things that I ended up noticing a lot of things
(When you respawn NPCs 1000 times to debug a Hook plugin, you notice things out of sheer boredom)
-
FF’s dead true… when testing things for extended periods of time… one can start to notice things they would otherwise plain miss…
Pain in the ass if you ask me… ignorance is bliss 8-) at least then you can claim…“ive never seen it”…