Page 1 of 1

Intelligence variable for NPC

Posted: Thu Jun 03, 2010 2:05 pm
by UK_Eliter
Dear all

Perhaps someone has suggested this before. And it may be (somewhat) in the code already. Still:-

How about each NPC (non-player character, i.e. ship) having an intelligence value, set randomly within paremetres determined by such things as ship type, equipment, and legal status. The intelligence of a ship (and I am thinking particularly, perhaps, of pirates) would affect how it responded to such things as mines, cloaking, being outgunned, and having cargo dropped in its path.

I imagine that implementing this would be involved, though. But it might improve the game significantly. Just a thought. (But - to go on - once we have an intelligence value we could have other values such as hostility and even greed. .)

Posted: Thu Jun 03, 2010 2:48 pm
by DaddyHoggy
I think basically, when this has come up before, is that the current AI is quite simple and couldn't cope with this - i.e. smarter NPCs would require smarter/new programming of AI...

..

Posted: Thu Jun 03, 2010 2:55 pm
by Lestradae
I think something like that exists - you can set an "accuracy" value for NPC ships that determines how fast & well they hit with weapons methinks.

The people in the know can agree or correct me here, at least it works that way for missiles.

Posted: Thu Jun 03, 2010 3:13 pm
by Disembodied
I think an "accuracy" variable is fine, but any variability on the "intelligence" on the AI would be very hard to manage. There's a limit to how thin you can slice something that's very very thin to begin with!

For pirates, perhaps the most interesting variable would be "aggression", e.g. at what point in a combat might they cut and run, or how easily distracted they are by some nearby cargo canisters. I have been ignored by pirates, who preferred scooping loose cargo to attacking me (although that changed when I attacked them – I had dibs on that loose cargo first!), but don't know if many pirates would break off a fight if some cargo canisters suddenly popped into view. It would be good if they did, as it would mean that dumping a few tons of cargo might be enough to keep pirates off your back. It would be realistic, since it's the cargo they're after, and it would give players a non-violent option to escape a pirate attack. Maybe give them a % chance of moving into scoop mode per nearby canister?

Posted: Thu Jun 03, 2010 4:06 pm
by UK_Eliter
Dear Disembodied

I think that pirates can already break off combat when cargo is dumped in front of them. That's something that's been implemented in trunk, I think. I haven't tested it, though.

Posted: Thu Jun 03, 2010 4:22 pm
by Eric Walch
UK_Eliter wrote:
Dear Disembodied

I think that pirates can already break off combat when cargo is dumped in front of them. That's something that's been implemented in trunk, I think. I haven't tested it, though.
Yes, every pirate is signalled about the cargo dumping in trunk. Currently the chance is set to 25% to get distracted by this. But the chance is set in the AI and everyone can make a custom AI with different chance. When fleeing for a bunch of pirates, dumping 2 pods should on average take half of the group from your tail. :lol:

Just one problem left for the player. When he starts attacking the remainders, they will get help of group members, resulting in some of the pirates you had shaken of will return their attention to you.

Posted: Thu Jun 03, 2010 4:37 pm
by Switeck
The shot-up fleeing pirates also need a better strategy.
Straight-and-level may work if they're 10+ km away, but when they're <2 km away and I'm on their tail, they need to be turning-and-burning.

Posted: Thu Jun 03, 2010 5:22 pm
by Smivs
Disembodied wrote:

For pirates, perhaps the most interesting variable would be "aggression", e.g. at what point in a combat might they cut and run...
An "Aggression" factor would be really good, and the current AIs only allow for this in a small way. For example in the Pirate AI a pirate with an incoming missile will Flee, whereas a Thargoid in the same situation will turn and fight back.
To have more variety in responses would presumably require a much more complex set of rules and actions, something that Oolite, basically a lean and simple game, may not be able to support.

Posted: Thu Jun 03, 2010 6:44 pm
by Thargoid
When AI's are extended by coupling them with a javascript then a lot more can be done (as JS can be more flexible and make more choices). You can do a lot more rules and possibilities there if it's written cleverly.

The problem comes with the "actions" that AIs do, mainly performAttack in terms of aggressiveness. Currently there's nothing that can be done there as it's all in trunk. But things like performFlee and performIdle can be "simulated" within JS and the action there can be adjusted.

Posted: Fri Jun 04, 2010 9:01 am
by Disembodied
UK_Eliter wrote:
I think that pirates can already break off combat when cargo is dumped in front of them. That's something that's been implemented in trunk, I think. I haven't tested it, though.
Excellent! 8)