Fixing the agro of the AI

An area for discussing new ideas and additions to Oolite.

Moderators: another_commander, winston

Post Reply
ocz
Deadly
Deadly
Posts: 175
Joined: Tue Nov 10, 2015 1:59 pm

Fixing the agro of the AI

Post 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?
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16058
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Fixing the agro of the AI

Post 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)
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
ocz
Deadly
Deadly
Posts: 175
Joined: Tue Nov 10, 2015 1:59 pm

Re: Fixing the agro of the AI

Post by ocz »

Oh, okay.
Anonymissimus
---- E L I T E ----
---- E L I T E ----
Posts: 299
Joined: Mon Apr 27, 2015 9:03 pm

Re: Fixing the agro of the AI

Post 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.
warning sound if a missile is inbound: Missile warning
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Fixing the agro of the AI

Post 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.
Post Reply