Page 11 of 20

Re: The Oolite NPC ecosystem (and other questions)

Posted: Tue Aug 06, 2013 5:52 pm
by Thargoid
Suddenly I feel so victimised :twisted: :D

Re: The Oolite NPC ecosystem (and other questions)

Posted: Tue Aug 13, 2013 5:53 pm
by cim
Right, back with more questions...

I've been putting the finishing touches on the ecosystem changes: all the roles appear to be working well. In the course of this, while I was testing the "witchpoint patrol" AI used by Viper Interceptor wings in rich systems targeted by pirate raiders from nearby systems, an Adder smuggler jumped in. Ten Viper Interceptors immediately went for it ... its meager remaining fuel from the jump ran out ... it kept running ... and the entire police fleet managed to consistently miss it for several minutes.

A bit more testing revealed two reasons. The first was a bug in the pursuit speed selector, but even with that fixed: ships running away, with the traditional non-freighter profile (i.e. very flat Y-axis compared to their size) are really difficult for the AI to hit. No longer quite so much that a single decoy Adder can draw two whole patrol wings hundreds of kilometres off station, but still quite tricky.

Image

Here's a picture of an NPC Cobra III, approximately 5km ahead. That's a pretty easy shot for a player - since it's running, not dodging - even without fancy stuff like Scanner Targeting Enhancement or Target Reticle Sensitive. The NPC AI will probably miss every single time: in 1.77, potentially even at maximised accuracy, due to a bug I'm working on fixing, but even with that fix it will need accuracy >= 7.5 (i.e. nonexistent without OXPs) to hit a fleeing target semi-reliably at that distance. (And the Cobra III is fairly big!). This is because, by default, the NPCs consider their aim "perfect" if it's within 4m per km - and the centre to edge distance of a Cobra III is not large at that orientation, so they'll miss but think they're on target at any range greater than about 4km...

As a result of this, NPC vs NPC fights often take absolutely ages to resolve, because even with overwhelming numeric superiority, they are rarely able to finish a damaged enemy cleanly. Then the player can join in and wipe out one entire side of the fight within a couple of minutes.

What I would like to do is improve the combat aim tracking, to perhaps 2m per km for an accuracy 0 ship, keeping the current 4m per km for accuracy -5, and improving it a little more for accuracy +4.9. This obviously makes attackers much less likely to miss, so some compensation is needed to keep the difficulty balanced. I think there are two areas this can be done in:
1) Downgrade a lot of the lighter ships to pulse lasers. The beam laser is a really big step up in damage output (5x, compared with the ~2x in the original Elite), and a whole pack of them can mean instant death even for a tough ship if they have good aim ... but most pirate ships currently have beam lasers.
2) Pirates now accept dropping goods and surrendering more easily. This means that dying to pirate attacks is easier to avoid in the early game (well, and once you have your ship equipped, too). Similarly there are more ways to avoid a fight with them - follow a bounty hunter in, and most pirate groups will be too busy avoiding the hunter to pay attention to you, for example.

There's an issue here with OXP ships being very likely to have beam lasers, and perhaps using the old "not much quarter" pirate AI, of course: the core game would be possible to balance by playtesting, but many ship OXPs would probably have another jump in power as they did between 1.76 and 1.77.

Thoughts?

Re: The Oolite NPC ecosystem (and other questions)

Posted: Tue Aug 13, 2013 7:14 pm
by JazHaz
One thought is that if you improve the AI aim, you could make the game a lot harder than it is already for the noob player. The difficulty already went up a notch with the release of 1.77...

Re: The Oolite NPC ecosystem (and other questions)

Posted: Tue Aug 13, 2013 8:14 pm
by cim
Difficulty for new players is my major concern too, and I'd certainly want Corporate and Democracy systems to be (at worst, on an unlucky day) no more dangerous than they are now.

That said, in most other space games the early game difficulty curve survives "the NPCs can kill hit you if you fly straight and level when they're close on your six". Having the NPCs not only be worse shots than a skilled human player (fair enough!) but probably worse shots than most beginners seems the wrong solution to game balance, because it means there's nowhere up to go to make the more dangerous systems actually be more dangerous (other than adding ridiculous numbers of ships, which kills the frame rate more than the player)

Re: The Oolite NPC ecosystem (and other questions)

Posted: Tue Aug 13, 2013 9:21 pm
by Commander McLane
cim wrote:
This is because, by default, the NPCs consider their aim "perfect" if it's within 4m per km - and the centre to edge distance of a Cobra III is not large at that orientation, so they'll miss but think they're on target at any range greater than about 4km...

As a result of this, NPC vs NPC fights often take absolutely ages to resolve, because even with overwhelming numeric superiority, they are rarely able to finish a damaged enemy cleanly. Then the player can join in and wipe out one entire side of the fight within a couple of minutes.
I've witnessed many NPC vs NPC fights which took forever because of this. Thanks for revealing the reason. :D
cim wrote:
Thoughts?
Perhaps there's another way to deal with this. The player gets feedback (for instance through the laser sound) whether they hit or missed. So, if I think that I'm on target but actually am not, I'm notified of this with my shot, and can adjust my aim for my second shot.

Isn't the same possible for NPCs? The AI should evaluate whether it actually hit or not for each shot (in fact the engine already does, because we have the shipAttackedOther event handler), and re-aim if it missed, even if the shot arrived inside the 4m-per-km-radius. Thus it would by trial and error finally aim for a point inside the profile of its target.

That wouldn't be as radical a change as the ones you were pondering, with less impact for the player, because the whole trial-and-error process would need to start all over again after each evasive movement of the player. Only when fleeing in a straight line without rolling the chances to be hit would approach 1 after time.

Re: The Oolite NPC ecosystem (and other questions)

Posted: Tue Aug 13, 2013 9:32 pm
by cim
Commander McLane wrote:
That wouldn't be as radical a change as the ones you were pondering, with less impact for the player, because the whole trial-and-error process would need to start all over again after each evasive movement of the player. Only when fleeing in a straight line without rolling the chances to be hit would approach 1 after time.
Definitely worth trying. The whole infrastructure is already there to do it, in fact: misses over hits is already tracked by the AI and used (accuracy >= 0) to tighten the aim circle. It just very quickly runs into the limit here on how small a turning move can be, so doesn't help.

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 7:38 am
by Norby
I think to fix the aim of the AI is important. There are two case which should be investigate separatedly: playing with OXPs and with almost strict mode.

With OXPs I do not fear from the installed strong ships due to the player can install offsetting OXPs also (similar with my [wiki]HardShips[/wiki]) or change some settings by hand to balance it, or ask in the forum if changes needed.

To balance the core game is harder but it is possible and worth to get the fixed aim.
I do not support the laser downgrade, pirates with pulse laser is not so realistic.

Goods dropping are good due to pointless and risky to try to kill a clean ship without cargo, I do not know why pirates do it at all. A pirate should send a message to clarify if you drop it then can leave anytime. An OXP equipment can do auto drop if the last energy bank touched - the auto eject saved me many times so this will be useful also. Pirates should be ignore clean ships with zero or small cargo capacity.

Injectors are cheap and defend the cautious trader if do not make long jumps or go to the sun for refuel. NPCs should use it a bit more and earlier to escape if the aim fixed.

Defending the early game also good. If the best governments are enough safe then a weak clean trader can not disturbed by the better aim and others should be disturbed. ;)

By the way: why must destroy the derelict ship to get the bounty and not get right when the pilot ejected?

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 8:21 am
by DaddyHoggy
Norby wrote:
I think to fix the aim of the AI is important. There are two case which should be investigate separatedly: playing with OXPs and with almost strict mode.

With OXPs I do not fear from the installed strong ships due to the player can install offsetting OXPs also (similar with my [wiki]HardShips[/wiki]) or change some settings by hand to balance it, or ask in the forum if changes needed.

To balance the core game is harder but it is possible and worth to get the fixed aim.
I do not support the laser downgrade, pirates with pulse laser is not so realistic.

Goods dropping are good due to pointless and risky to try to kill a clean ship without cargo, I do not know why pirates do it at all. A pirate should send a message to clarify if you drop it then can leave anytime. An OXP equipment can do auto drop if the last energy bank touched - the auto eject saved me many times so this will be useful also. Pirates should be ignore clean ships with zero or small cargo capacity.

Injectors are cheap and defend the cautious trader if do not make long jumps or go to the sun for refuel. NPCs should use it a bit more and earlier to escape if the aim fixed.

Defending the early game also good. If the best governments are enough safe then a weak clean trader can not disturbed by the better aim and others should be disturbed. ;)

By the way: why must destroy the derelict ship to get the bounty and not get right when the pilot ejected?
As somebody who worked on tracking helicopters to see how easy they are to shoot down with small and medium calibre weaponry and can confirm that even good gunners will have trouble getting a bead on a good helo pilot who is "jinking" lots - straight and flat-out level flight is, as you'd expect, less of a problem for a good gunner - so I don't think it's so bad that ships are actually difficult to hit, especially low profile ones, if the pilot is ducking and weaving, the AI is not so far off reality!

Yes dropping cargo and getting a pirate to break off is a good behaviour to have - but pirates don't know if you're carrying cargo or not - so they can't not attack an empty ship - in RL(tm) - vans that carry the "no tools are left in this vehicle overnight" - still get broken into, overnight.

There are so very good trade routes in "safe" systems within a 7ly jump of Lave, I think they should be heavily protected by Police - perhaps artificially so, so newbies can trade in relative safety - but leaving those safe systems should come as a noticeable step change - a shock to the pre-emptively cocky and over confident pilot.

The bounty is attached to the ship not the pilot, bounties are paid on destroyed ships - simple, but effective.

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 8:27 am
by Tichy
Norby wrote:
Goods dropping are good due to pointless and risky to try to kill a clean ship without cargo, I do not know why pirates do it at all. A pirate should send a message to clarify if you drop it then can leave anytime.
I think that a pirate could think that a small fighter ship like the asp, or other similar ships with very small or no cargo space, is a bounty huter and see it as a threat. If the pirate is alone, he might prefer to run away, but if it's in a group, he could decide to attack the bounty hunter. A hunter is a danger to the pirate gangs, so the attack could be seen as a form of defense.
(Or, maybe, a single pirate could call the others to do a group attack.)

Otherwise, I fear that a player with a ship like the asp, or fer-de-lance, could find the game boring... because all the pirates tries to avoid him.

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 8:28 am
by Smivs
DaddyHoggy wrote:
There are so very good trade routes in "safe" systems within a 7ly jump of Lave, I think they should be heavily protected by Police - perhaps artificially so, so newbies can trade in relative safety - but leaving those safe systems should come as a noticeable step change - a shock to the pre-emptively cocky and over confident pilot.
This sounds very sensible to me.
On a general note, I think the NPC aim probably should be improved - I too wondered about those interminable NPC dogfights.
As for causing ship OXPs to need updating, well, I'm getting used to doing that :wink: :lol:

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 8:50 am
by cim
Norby wrote:
I do not support the laser downgrade, pirates with pulse laser is not so realistic.
Realism ... needs to be careful. A typical pirate pack of 4 lightly armed ships could at current prices become a pirate pack of 3 ships fully loaded with shield boosters, military lasers, hardened missiles, and so on, and still have plenty of money to spare. Similarly a trader group could do the same by selling one escort ship.

I tend to view the situation as ships actually being very cheap - a few hundred to a few thousand credits - so equipment upgrades cost a significant fraction of the ship price, and are not obtained lightly. The ship prices actually being what they are to the player (who is the only pilot who needs to directly care about them) is a necessary evil for game balance.

An upgrade from pulse to beam laser then costs possibly more than the ship did for a light fighter like a Sidewinder or a Mamba - perhaps better to buy another ship instead. Similarly for injectors, or ECM (ECM especially: you don't need that on every ship so long as the ones that have it cover the ones which don't).
Norby wrote:
Goods dropping are good due to pointless and risky to try to kill a clean ship without cargo, I do not know why pirates do it at all. A pirate should send a message to clarify if you drop it then can leave anytime. [...] Pirates should be ignore clean ships with zero or small cargo capacity.
All of these are already in the new pirate AI: ships without cargo are ignored, cargo demands are made explicit and work, pirates won't attack a group they don't outnumber. NPC traders will surrender without a fight if they're badly outnumbered.
Norby wrote:
By the way: why must destroy the derelict ship to get the bounty and not get right when the pilot ejected?
For an in-universe explanation, try capturing the pilot but not destroying the ship in the Constrictor mission. (Here's a save file just before mission start)

Out of universe, I think it's only worth making that change if there are things to do with derelict ships other than blow them up. Towing them back as salvage is a possibility, as is capturing them and bringing them back online, but those involve quite substantial changes (especially if the player can capture ships!)
DaddyHoggy wrote:
As somebody who worked on tracking helicopters to see how easy they are to shoot down with small and medium calibre weaponry and can confirm that even good gunners will have trouble getting a bead on a good helo pilot who is "jinking" lots - straight and flat-out level flight is, as you'd expect, less of a problem for a good gunner - so I don't think it's so bad that ships are actually difficult to hit, especially low profile ones, if the pilot is ducking and weaving, the AI is not so far off reality!
Oh, certainly, if you try to dodge it'd be nice if it worked - but dodging only comes in for NPCs at accuracy >= 5 (i.e. out of core game bounds) and for the player at the moment dodging is actually a good way to get shot! In a Cobra III (or most of the smaller wedge-fighters) if you pitch up you're actually increasing your target cross-section relative to a pursuer, and furthermore you're moving your angular position outside the 40/10000 zone so they will then adjust their aim and might hit you.

I don't think this change will make them much better against dodging targets - anything making serious attempts to dodge should either have an angular speed much greater than 40/10000 anyway, or be at sufficient range that 10/10000 isn't likely to get a hit either.
DaddyHoggy wrote:
There are so very good trade routes in "safe" systems within a 7ly jump of Lave, I think they should be heavily protected by Police - perhaps artificially so, so newbies can trade in relative safety - but leaving those safe systems should come as a noticeable step change - a shock to the pre-emptively cocky and over confident pilot.
In the current experimental setup, Leesti is naturally very safe: as a high-tech corporate state it doesn't have many pilots, and it can afford Interceptors for anti-piracy measures. It's (just!) too far from Riedquat for raiders, and it doesn't get many from Orerve.

Diso is a little less safe - raiders from Riedquat do occasionally attack its shipping lanes - but it's used as a base for bounty hunters heading into Riedquat, and it has plenty of police patrols even without Interceptors, so it's still pretty clear.
Tichy wrote:
If the pirate is alone, he might prefer to run away, but if it's in a group, he could decide to attack the bounty hunter.
At the moment I have three types of pirates:
- independents (who always flee from bounty hunters if it's practical, though they'll defend themselves if attacked)
- gangs (who will avoid bounty hunters unless they have an overwhelming force advantage, and then preemptively attack)
- thugs (who actively seek out bounty hunters and destroy them)

I haven't yet got as far as determining whether the player should be treated as a trader or a bounty hunter at a particular moment.

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 9:40 am
by Disembodied
A couple of ideas for consideration:

1) New equipment (or at least a refinement of existing equipment): the in-game explanation is that it's a tweak to the scanner which measures, or at least estimates, a ship's mass and can make a good guess, for common ship-types anyway, of how much cargo there is on board. This is of primary use for pirates, so it's not something that's on offer in main stations. Perhaps there could be a mission where a player could get it, though. Anyway, the main function of this is to allow pirates to ignore ships with little or no cargo in them - so they won't (or will be much less likely to) harass a player who's running empty.

Now, as this stands, there is an obvious exploit for bounty hunters, who usually fill their holds from what they take from pirates. So an additional check would be, is the ship (principally the player, here) Harmless or Mostly Harmless? If so, they are unlikely to be a bounty hunter, and can be ignored by the pirates as probably not worth the bother.

Basically, this is a way to allow a player to survive a pirate attack by dropping cargo if they have to, even if it means losing nearly all their money. They can then take a few parcel deliveries more-or-less safely to get enough cash to start trading again.


2) Give hostile ships the option to give up a pursuit. The example of two patrol wings chasing an Adder half-way across the system is a good one; similarly, a flock of pirates shouldn't really want to get drawn too far from their hunting grounds for the sake of a single (and possibly lightly loaded) Cobra III who's refusing to co-operate. Maybe every so often (60 seconds? Some other number?) the pirate/police/hunter could make a check and decide whether the pursuit was worthwhile (a pack or wing would need to make a single decision). This could be based on how long the pursuit has gone on for, how hungry the pursuer is (how much cargo the pirate has on board/how much bounty the target is carrying), and how much damage the pursued ship has taken (increasing the hunger) or has dealt out (reducing it).


These changes might allow pirates, and hostile ships in general (Thargoids excepted), to behave a bit more intelligently, while making life a little easier for new players.

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 10:39 am
by Norby
cim wrote:
Realism ... needs to be careful.
I agree and I suggest to avoid making independent pirates with pulse laser. In a large gang the small escorts maybe imaginable with weak lasers, in this case please make separated definition to the escort variants and leave the original ships with beam laser also in the game.
cim wrote:
All of these are already in the new pirate AI: ships without cargo are ignored, cargo demands are made explicit and work, pirates won't attack a group they don't outnumber. NPC traders will surrender without a fight if they're badly outnumbered.
Well done, you are pretty fast! :)
cim wrote:
Towing them back as salvage is a possibility, as is capturing them
Capturing a nearly destroyed ship is not a good idea: based on the vehicles of the planet Earth the fixing cost will be more than a working second-hand one, and any light security (ignition key) can prevent the instant usage. But gain salvage is a very good idea, similar with the asteroid mining: ship-mining should be a well payed work!
cim wrote:
40/10000
Reducing this constant sounds like a quick and good fix.

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 1:01 pm
by Cody
cim wrote:
... thugs (who actively seek out bounty hunters and destroy them)...
Oi! Who are you calling a thug? Moi?

Re: The Oolite NPC ecosystem (and other questions)

Posted: Wed Aug 14, 2013 1:43 pm
by Cody
cim wrote:
... determining whether the player should be treated as a trader or a bounty hunter at a particular moment.
If the player instigates an attack (lands the first hit?) on a pirate, then the player should be treated as a bounty-hunter.