Page 1 of 1

Fixing the agro of the AI

Posted: Mon Feb 08, 2016 11:33 am
by ocz
Maybe it already has been mentioned somewhere, but I couldn't find it.

The AI get aggressive to fast, when a ship is grazed or hit by a shot. There are traders flying right into firefights. Of course there is a realistic chance for them to be hit. They could respond with a serious warning and turn enemy if a second hit lands after 0.25 seconds. 0.25 seconds, because there is a certain chance to hit several times within a few ms, when firing a beamlaser for example.

Also there are sometimes firefights in proximity to stations and stations are big targets. You can easily hit them by mistake.

Also there should be an option to surrender to a GalCop viper, maybe by deactivating the weapon systems and being fined on the spot.

I fear this would mean much messing with the AI scripts for only little gain for an OXP. (Causing only incompatibilities.) Therefore a modification in the next oolite main release would make more sense.

Could most of this be archived be modifying the AI scripts in the resource folder without changing the Obj-C code?

Re: Fixing the agro of the AI

Posted: Mon Feb 08, 2016 11:36 am
by Cody
As I said, there is something in the code to allow friendly fire:
cim wrote:
You can even friendly-fire police ships a little bit without penalty in some situations. (You have to have a good enough record, clearly have been aiming at a legitimate target, and only give them a glancing blow)

Re: Fixing the agro of the AI

Posted: Mon Feb 08, 2016 11:43 am
by ocz
Oh, okay.

Re: Fixing the agro of the AI

Posted: Mon Feb 08, 2016 2:40 pm
by Anonymissimus
Cody wrote:
As I said, there is something in the code to allow friendly fire:
cim wrote:
You can even friendly-fire police ships a little bit without penalty in some situations. (You have to have a good enough record, clearly have been aiming at a legitimate target, and only give them a glancing blow)
Never noticed it. Reputations decay way too quickly in general. It's just dead easy to hit the station in heated Aegis fights.
I got a few times a message from another hunter in a fight against pirates with hunter allies though which sounded like a complaint about friendly fire and they didn't attack me.
The good thing is it works against your enemies as well; deactivate weapons and dodge around near to a station and the aggressors are soon fugitives.

Re: Fixing the agro of the AI

Posted: Mon Feb 08, 2016 5:38 pm
by cim
The basic algorithm is this:
- if anyone hits a ship they have targeted, they meant to do it
- if an NPC hits an untargeted ship, they didn't mean to do it (and it either gets shrugged off or they're already on the "I was going to shoot them next anyway" list)
- if you hit a ship you don't have targeted, we can't treat that unconditionally as an accident because of the obvious exploit, so it checks if you have a good reputation with that ship's type and if you do it accepts it as friendly fire. (In practice this means sometimes you get away with it and sometimes you don't, but you get away with it more if you're consistent about which side of the fights you join in on)

Stations just hate being shot and go for you anyway. Really, if you can't notice that your shot might intersect a large highly-visible stationary object and hold fire, you're exactly the sort of person they want to discourage from firing high energy lasers nearby in future.