NPC flight routines upgrades?

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
szaumix
Deadly
Deadly
Posts: 171
Joined: Sun Apr 24, 2022 4:23 am

NPC flight routines upgrades?

Post by szaumix »

Happy I'm-Not-Crunching-Data-At-Work-All-Day Weekend, lads!

Just starting a thread to ask if the Oolite developers or AI writers have a stance of the flight subroutines of NPCs?

Problem: the AI is not dangerous for veterans
I've tried for a long while to make NPCs more dangerous to fight. I can max their accuracy, up their base speeds making them more slippery to shoot down, and pump their weapons. I have upped the role weights of oxp uber fighters here and there, and my pirate packs minimum at 4. I have edited the maneuverability of ships so that player ships are more boatlike (unmaneuverable). I upped a lot of the ships' base speeds, but again this just makes them more slippery in a dogfight (harder to shoot), not more dangerous (deadly, by aim-and-fire subroutines, to my ship). The problem is that even in a (heavily modified for player unmaneuverability) broke Adder + First Finances start I am never, under any circumstances, ever, afraid to venture into a pirate pack of 5, 10 in anything but a hauler. Yes, as soon as I am in any of the haulers these things become extremely difficult to survive without injectors and missiles.) I have exhausted my ideas in tweaking the NPCs so they are able to point at me and fire and hit me. There is no real danger as long as I am not flying straight, it's all just target practice. Non-hauler veterans are unkillable unless they get extremely lazy.

Specific observations:
- NPC packs appear to have one engaged dogfighter at a time. The rest just sit and watch, unengaged until they are specifically engaged. (Solving this alone would increase NPC danger many times, I think).
- I've noticed sometimes NPCs will not fire unless they are in some exact range (5kms, for example)
- The speed up/ slow down of NPCs as they come in and fly away and come in again, makes them ineffective dogfights.

Not an expert writer of AI, just wondering if the developers have any thoughts! Is any of this able to be improved? I expect that, so that non-veteran commanders are not punished by such things were they to change, improvements to AI subroutines could kick in only over certain accuracy levels...
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2687
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: NPC flight routines upgrades?

Post by Redspear »

In no way is this an area of expertise for me so please bear that mind re the following...

A much reported problem was the relative lethality of pirate packs to new players or even old players starting in a new ship.

The oft quoted sell your laser and dodge the spacelane strategy/strategies are actually ways to avoid this problem rather than to solve it, in that neither produces more balanced combat, rather they delay it.

The difference between a poorly equipped and a well equipped vessel however is huge and a bigger indicator of combat success than ship type.

So how to populate the spaceways with an appropriate challenge at all stages of a career? Oh, and don't forget to avoid obvious player-centricity if you can...

The 'legacy' method was to have each government type mark a clear distinction in difficulty, even if only via the stamina required from the player's ship. So there would reliably be systems ranging from very safe to very dangerous that would be clearly indicated as such. I've griped about how this changed before, so moving on...

The other 'extreme' from reliability could be randomness where some ships are just much better than others. This could prove disastrous for the beginner but for the experienced and well equipped pilot might be welcome.

If I can use the assassin role as an example of how this could work...

The player accepts a contract and the juicier it is, the more likely it will attract unwanted (and potentially lethal) attention. Don't accept the contract however and that particular threat doesn't exist : the 'wanted' status does not exist.

It's similar with police and bounty hunters, if the player is clean then they won't trouble you. With pirates however, the stronger your reputation, the more they might leave you alone (again, not my specialty, so corrections welcome), so it's closer to the opposite. The more you act against them, the more likely you'll be left alone.

So I'm imagining a new role, no more or less player centric than that of assassin, one that would target the most dangerous players.

Call it the avenger/the killer/the challenger, or whatever. They're not interested in your cargo or your bounty, they're only interested in your reputation and they simply want you dead (and likely have military lasers suitable for the job). If you're not ranked at least competent then, as far as they're concerned, you're not worth their time.

So essentially the player has to 'qualify' in order to have such encounters and the problem of NPC's wandering around with military lasers still has a significant level of control.

What about taking a contract with a high combat rating then? Wouldn't you have to face them as well as assassins? Maybe they'd rather face you alone, or just with their escorts, especially if they want the kill for themselves. So, they're a way to introduce a kind of contract-independent assassin into the game. The higher your rating, the more capable opponent you'd attract.

They could still be more likely in dangerous systems and, like assassins, the witch point might be an obvious location. That's only one encounter per system but because it's at the witchpoint, taking some equipment damage could make the trip to the station (specifically any combats along the way) much tougher, and military lasers are prone to do that.

I'm aware of the pirate interceptor role but the assassin is closer to what I'm imagining for reasons that I've tried to explain.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: NPC flight routines upgrades?

Post by Cody »

Redspear wrote: Sat Jul 16, 2022 9:08 am
Call it the avenger/the killer/the challenger, or whatever. They're not interested in your cargo or your bounty, they're only interested in your reputation and they simply want you dead (and likely have military lasers suitable for the job). If you're not ranked at least competent then, as far as they're concerned, you're not worth their time.
Call it the Green Gecko?
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!
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2687
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: NPC flight routines upgrades?

Post by Redspear »

Cody wrote: Sat Jul 16, 2022 9:17 am
Call it the Green Gecko?
Double-barrelled military laser :shock:
That's too much for what I'm imagining, although there are similarities I grant you.

If the player takes a dent early enough then the other combats are already made tougher and potentially cumulatively so. Therefore a dangerous witchpoint lingerer (showing up semi-reliably at the higher player combat rankings) could be significant.

They wouldn't be as rare as your creation is described to be.
I rather think the GG occupies its own special (and very particular) niche.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: NPC flight routines upgrades?

Post by Cody »

Redspear wrote: Sat Jul 16, 2022 9:44 am
Therefore a dangerous witchpoint lingerer...
An entity such as you suggest should operate in the aegis occasionally too, where the player feels secure.
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!
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: NPC flight routines upgrades?

Post by Switeck »

I get shredded well enough by 4 or more pirates at once because they do tend to all shoot at me at once, so long as nothing else is around...especially not loose cargo containers.
Back when I was regularly mucking around with AI.plist files, I could semi-easily make a script that would tell other ships in a group to target whatever hit another member and all attack it.
I don't know if core Vanilla Oolite uses that logic now though -- it may be that some hold back precisely because of the difficulty that newer players have.

Paradoxically, I find the biggest challenge from a slow freighter-type pirate than most fighter-types -- but only if it has a rear laser.
(Blackdog Pythons do.)
These freighters come in slow enough to overheat their front laser...then fly by and overheat their rear laser.
They seem a better shot with the rear laser too...

I created a "Blackdog" version of the Boa 2 as well, both as a pirate and hunter which had almost all the equipment that NPCs can use -- and made it rare. I could overheat a military laser on one and not kill it.
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: NPC flight routines upgrades?

Post by montana05 »

szaumix wrote: Sat Jul 16, 2022 6:42 am
I have exhausted my ideas in tweaking the NPCs
Your NPC's actually got shields ? There are some OXP's out there, making them much harder to eliminate.
szaumix wrote: Sat Jul 16, 2022 6:42 am
I upped the role weights of oxp uber fighters
Just curious, which uebers you tired ?
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
szaumix
Deadly
Deadly
Posts: 171
Joined: Sun Apr 24, 2022 4:23 am

Re: NPC flight routines upgrades?

Post by szaumix »

Redspear wrote: Sat Jul 16, 2022 9:08 am
So how to populate the spaceways with an appropriate challenge at all stages of a career? Oh, and don't forget to avoid obvious player-centricity if you can...
The answer to this, and to the disparity between new player and veteran player skill is solved by [EliteWiki] Skilled NPCs, is it not? The newbie can accept all changes that OXPs offer in new ships, uber ships etc and just turn Skilled NPCs levels down, the veteran can max-10 across the board and still never be anywhere near danger of death in anything -- and I do mean anything -- but a hauler. I was not joking when I said that I am utterly unafraid to charge a pirate pack of 10 in a barebones stock adder with pulse laser. I'm never going to wipe the pirate crew out in anything under an hour, but it's not going to kill me either.
Switeck wrote: Sat Jul 16, 2022 1:41 pm
Back when I was regularly mucking around with AI.plist files, I could semi-easily make a script that would tell other ships in a group to target whatever hit another member and all attack it.
Aha! Something like this is probably what I'm after. As I said in the OP, even on maxed out skill, any given party of code-red dogfighters will literally just sit and idle (watch) as only a few "engaged" ships fight, and the idle watchers only engage temporarily if they are engaged/chased. It reminds me what I used to think of Xena Warrior Princess -- "Why do they attack her one at a time so that she can defeat packs of ten with grade school karate? If they attacked her at once they might have her!"

Given what I've been observing (making a studious effort to observe) regarding dogfighting routines, it would be a partial but welcome fix.
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2687
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: NPC flight routines upgrades?

Post by Redspear »

Cody wrote: Sat Jul 16, 2022 12:24 pm
Redspear wrote: Sat Jul 16, 2022 9:44 am
Therefore a dangerous witchpoint lingerer...
An entity such as you suggest should operate in the aegis occasionally too, where the player feels secure.
I've no problem with that. The player will generally be less protected at the witchpoint however and also the conequences will require a longer wait for repair. Depends on how high one thinks 'occasional' should be.

szaumix wrote: Sat Jul 16, 2022 1:49 pm
Redspear wrote: Sat Jul 16, 2022 9:08 am
So how to populate the spaceways with an appropriate challenge at all stages of a career? Oh, and don't forget to avoid obvious player-centricity if you can...
The answer to this, and to the disparity between new player and veteran player skill is solved by [EliteWiki] Skilled NPCs, is it not?
Based on the following, I would say not...
szaumix wrote: Sat Jul 16, 2022 1:49 pm
the veteran can max-10 across the board and still never be anywhere near danger of death in anything -- and I do mean anything -- but a hauler. I was not joking when I said that I am utterly unafraid to charge a pirate pack of 10 in a barebones stock adder with pulse laser. I'm never going to wipe the pirate crew out in anything under an hour, but it's not going to kill me either.
So the NPC can have an accuracy of ten but you've still typically facing a beam laser or worse. Make that laser a military however and it's whole different kettle of fish whether hauler or fighter or whatever. Should the underequipped player face such a ship however then it's not even a contest.

I would suggest that right now you don't fear 'death' because you don't fear a solitary 'hit'. Were it double the strength however, that adder might not seem so safe.

If that too doesn't scare you because they can't hit you (the adder is an agile ship) then I'd explore missile options for the NPCs, even if only as simple as making the ECM cost more energy for the player to use.
User avatar
szaumix
Deadly
Deadly
Posts: 171
Joined: Sun Apr 24, 2022 4:23 am

Re: NPC flight routines upgrades?

Post by szaumix »

Redspear wrote: Sat Jul 16, 2022 2:38 pm
Make that laser a military however and it's whole different kettle of fish whether hauler or fighter or whatever.
Already done this my friend, I went through the entire plist of coreships and beam and military are very common. Almost all coreships have high rates of rear lasers and side lasers, pulse lasers almost do not feature in my list.

Again, the problem is that NPCs can't dogfight (aim and hit a weaving target). I mean at full pitch I can understand reduced accuracy -- but still not complete lack of accuracy, which is the case -- but in between changing directions, moments where we straighten to aim, etc, should be clear shots for NPCs and they arent. NPCs can't hit me it's that simple.
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2687
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: NPC flight routines upgrades?

Post by Redspear »

szaumix wrote: Sat Jul 16, 2022 3:04 pm
NPCs can't hit me it's that simple.
And this is true in any small ship (is that what you mean by non-hauler)?
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: NPC flight routines upgrades?

Post by cbr »

szaumix wrote: Sat Jul 16, 2022 3:04 pm

Again, the problem is that NPCs can't dogfight (aim and hit a weaving target). I mean at full pitch I can understand reduced accuracy -- but still not complete lack of accuracy, which is the case -- but in between changing directions, moments where we straighten to aim, etc, should be clear shots for NPCs and they arent. NPCs can't hit me it's that simple.
Perhaps because I primarily use ships outfitted for trading I do have other experiences...
They can hit me.
They can kill me fast, even in iron assed trader boa/boa-cruiser ( with colo(u)r plating ;) ).
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: NPC flight routines upgrades?

Post by cim »

szaumix wrote: Sat Jul 16, 2022 6:42 am
improvements to AI subroutines could kick in only over certain accuracy levels...
The core game only generates accuracies -5 to +5 so that ones above that can be unlocked by OXPs and made as dangerous as possible.
Moving the cap above +10 for additional core AI capabilities might make sense too.
szaumix wrote: Sat Jul 16, 2022 6:42 am
- NPC packs appear to have one engaged dogfighter at a time. The rest just sit and watch, unengaged until they are specifically engaged. (Solving this alone would increase NPC danger many times, I think).
This is intentional, but may not be working quite as intended: NPCs who you aren't attacking deliberately slow down and hang back a little so that they've got an easier shot at you, rather than trying to joust with a rapidly turning target.

They may well be getting the balance of "too close so your angular velocity is too high" / "too far back to be able to land a shot precisely enough" wrong, of course - especially for a small ship like an Adder. The Adder is fast, agile, and very small: flown with the aim of avoiding fire it's a hard target!

What should happen is you focus on one which is mainly dodging, and the other six are using you as a pincushion. But in an Adder the balance may be off; try flying an Adder but 50% bigger and see what happens.
szaumix wrote: Sat Jul 16, 2022 6:42 am
Is any of this able to be improved?
Certainly could be if someone writes the routines. I don't think they've been touched much since I wrote the accuracy 5-10 ones.

behaviour_attack_target is the core routine which sets it off
https://github.com/OoliteProject/oolite ... ty.m#L4560
... but it's also possible to OXP it without touching the core code by using performScriptedAttackAI
https://wiki.alioth.net/index.php/Oolit ... edAttackAI

Either way the coder needs to handle roll, pitch, yaw, firing timing, etc. fully manually frame-by-frame; the OXP route is probably a lot easier for prototyping to see if it works. Adding some yaw fine-tuning is probably a good starting point.

(There's of course also the "cheat" route available through those routes; once within a certain angular radius where the difference wouldn't look suspicious, "snap" the ship to be dead on target. That'd potentially make things a lot nastier when combined with the "hang back" tactic...)
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: NPC flight routines upgrades?

Post by Cody »

cim wrote: Sun Jul 17, 2022 7:53 pm
The Adder is fast, agile, and very small: flown with the aim of avoiding fire it's a hard target!
<nods> Do Thargoids have an "accuracy" thingy? I took an Adder into interstellar space once, and I seem to recall even they had trouble hitting me.
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!
Post Reply