endless-sky icon indicating copy to clipboard operation
endless-sky copied to clipboard

Pirates are too brave and ignore overwhelming odds

Open ThrawnCA opened this issue 2 years ago • 27 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

The calculations for pirate raid fleets take into account the ratio of player cargo to guns, but they don't take into account the ratio of pirate guns to player guns.

It's all very well to say that big rewards are worth big risks, but the fact that they take player guns into account suggests that they should be smart enough to know that no payout is worth dying for. A merchant fleet that has twenty heavy laser turrets for every one of the attacking ships is not going to be a tempting prize, it's going to be a suicide mission.

Steps to Reproduce

  1. Purchase twenty Bactrians and sixty Boxwings.
  2. Pirate raid fleets attack (and quickly die) every single time you lift off or jump.

Expected Behavior

Pirate frequency should reduce when the total strength of the player fleet is significantly beyond the pirate fleet strength.

Screenshots

No response

Link to save file

No response

Operating System

Ubuntu

Game Source

GitHub Releases

Game Version

0.9.16.1

Additional Information

No response

ThrawnCA avatar Dec 17 '22 06:12 ThrawnCA

Currently, I have a fleet of 196 Bactrians with a full complement of 2 anti-missile turrets + 4 offensive turrets (mostly heavy lasers, plus a handful of Disruptors and Electron Turrets), all of them with at least two guns (Sunbeam + Inhibitor Cannon), plus 26 Shield Beetles armed to the teeth, and my pirate threat is 100%. Cargo: untold riches (+11.4), fleet: unassailable (-10.4). And I was able to get the "N00b ur gonna get raided coz ur loaded" warning when I updated from 0.9.8 to 0.9.16.1.

Untold riches are all very well, but the fact that my fleet is indeed unassailable should have a heavier weighting. A sensible pirate, upon seeing untold riches with very powerful defences, ought to gather a correspondingly large fleet first, or if that isn't possible, acknowledge that it's just not feasible. Wanting the cargo more isn't enough if you can't get more guns.

ThrawnCA avatar Dec 17 '22 12:12 ThrawnCA

Pirate balance is one of those things that makes me weep, and is utterly immersion-breaking. The stream of suicidal interceptors is exhausting.

Other things to improve about it, off the top of my head: They should be disabling and raiding more than they seem to (it DID happen once, which was neat) They should be much more leery of enemy strength than they seem to be (I have yet to see a Sparrow that wasn't willing to suicide run my Dredger with its escorts) They should probably be running away the second their shields drop - you can't spend the money if you're dead They should be appearing in sufficient force or not at all They almost certainly shouldn't get a constant drip of minor reinforcements into a system. That's...not how pirates work. Given the strength pirates are working with, their evaluations of your strength are way, way too optimistic for them. Back when I had a Dreadnought, three Shield Beetles, and a Marauder Leviathan, the game insisted that cargo capacity was only 1 less than the dangerousness of five dedicated warships. 442 tons of cargo isn't worth taking on a Marauder Leviathan for, let alone the rest of that.

SimulatedKnave avatar Dec 17 '22 17:12 SimulatedKnave

I would imagine that pirates, being commercially minded, would tend to baulk at anything harder than an easy mark. They should be very sensitive indeed to the possibility of their target fighting back, because it's better to just wait around for the next mark, rather than potentially getting ships destroyed. A very rich prize would help to some extent in pushing them to attack despite less than ideal odds, but they ought to be usually erring on the side of caution.

ThrawnCA avatar Dec 19 '22 04:12 ThrawnCA

I have a rework planned for this:

  • raids happen up to 10 times, depending on the %,
  • the cost of the weapon is looked at and not just the sheer dps
  • carried ships are considered half as attractive
  • take into account allied/enemy ships in the system before attacking

I also had factored some other things (like speed) in but I think this would be enough? I also wanted to add some proper Unfettered raid fleets in the same time,

Hurleveur avatar Dec 19 '22 19:12 Hurleveur

I also had factored some other things (like speed) in but I think this would be enough?

I don't think that any of that would address the core problem of, "No matter how tempting the prize, there's no way your ragtag collection of misfits can possibly defeat a hundred Bactrians." Weighting player strength against cargo is a good start, but it needs to be weighted a second time against the pirates' strength.

Consider being on the other end, as a player turned pirate. You see a single heavily armed merchant, with a very valuable cargo on board, and you have a fleet of a dozen ships. It's appealing, right? Yeah, it's armed, but you have it heavily outnumbered, so you should be able to take it down and make bank.

Now consider facing thirty merchants with the exact same specifications. Same guns to cargo ratio as before, but suddenly it's a lot less appealing, right? You might consider pulling a sneaky stunt like luring one away from the rest, but you're not going to just make a frontal assault on the whole group. The deterrence factor is much higher because you're outnumbered, even though, purely in terms of the guns-to-cargo ratio, it's the same target profile.

Since large-scale engagements can result in losing individual ships even if you win overall, which is a large expense that pirates won't want, perhaps cargo attractiveness could scale up linearly, while deterrence factor could scale quadratically or similar? So when you have dozens or hundreds of ships, unless you leave them basically unarmed, pirates are just not going to bother; they know it will turn into a killing field.

I also wanted to add some proper Unfettered raid fleets in the same time,

Careful on that one, there are lore reasons involved.

ThrawnCA avatar Dec 19 '22 23:12 ThrawnCA

Careful on that one, there are lore reasons involved.

~~I became de facto faction head so mostly about convincing derpy~~ Still curious what reasons those are I'd eventually like UHai to not be hostile to you but instead to make you pay to land and raid you (in proper raid fleets instead of all rushing on you) + attack you if you have Hai weapons when they scan you. But I'm getting caried away.

Now you seem to have misunderstood, my suggestions does not weight the player strength, yes, it instead weights the strength of all allies and enemies to the raid fleet in the system. That includes the player and navy and free world etc It doesnt look at the detterrence for that but at costs btw (and compares it to the raid fleets costs)

Hurleveur avatar Dec 20 '22 07:12 Hurleveur

I'd eventually like UHai to not be hostile to you but instead to make you pay to land and raid you (in proper raid fleets instead of all rushing on you) + attack you if you have Hai weapons when they scan you.

Why would they care about carrying Hai weapons? I didn't think they felt any particular loyalty toward their peaceful cousins.

Now you seem to have misunderstood, my suggestions does not weight the player strength, yes, it instead weights the strength of all allies and enemies to the raid fleet in the system. That includes the player and navy and free world etc

That could work, yes.

ThrawnCA avatar Dec 20 '22 07:12 ThrawnCA

Well quite the opposite of loyalty they're angered by their cousins handing weapons to everyone like its candy, you need to prove you are to be trusted and can be their ally. That's what they shoot you for.

Hurleveur avatar Dec 20 '22 07:12 Hurleveur

It would be more realistic if "disguised" pirate scouts scanned your fleet, then used the scan results to determine if they should send in a raiding fleet (of predetermined strength based on system and how long they've had to recover from the last raid) to intercept you.

krushia avatar Dec 20 '22 22:12 krushia

Well pirates generally have this kind of info from outfitters but it would be nice to see them pay some merchants to perform scans of your ship. Also the pirates are not one unified government but a ton of independant ones. And realism does not truly matter to that extent but it'd be nice to have merchants scan you anyway.

Hurleveur avatar Dec 21 '22 07:12 Hurleveur

It is no secret that after mid game and with enough escorts pirate is nothing but volunteer suicide group who just want to be killed by our ships and ring your alarm. I wonder what makes them so fanatically want to die for nothing.

binaryspica avatar Dec 23 '22 16:12 binaryspica

Raids definitely should measure the going-to-be-spawned fleet's health and damage values against the player's, and compare the TTK on each end. If the pirates will lose any significant amount in a head-on frontal assault (the only thing the AI is capable of), then spawning the fleet should probably not happen.

If you have 6,000 DPS, no amount of cargo will make that worth taking on!

Ferociousfeind avatar Dec 29 '22 22:12 Ferociousfeind

If you have 6,000 DPS, no amount of cargo will make that worth taking on!

Only 6000? Heh, casuals ;)

But yes, that's my general premise.

ThrawnCA avatar Dec 29 '22 22:12 ThrawnCA

I'll open the PR shortly.

edit: dont wanna overwhelm ppl reviewing those so in a bit but its rd

Hurleveur avatar Dec 30 '22 10:12 Hurleveur

It might also be nice if the conversation where an old pilot rebukes you for having lots of cargo and not enough guns, had a dialogue branch when you have a high combat rating, allowing you to assert that you're sure you can take them.

ThrawnCA avatar Jan 07 '23 20:01 ThrawnCA

In the extreme end of things, where a pilot may have a threat score of 9.8-10.5 but a cargo score of 10.9-11.3, I feel like the likely hood of raid probably still shouldn't be 100%, purely because the required fleet needed to subdue that sort of force would be tremendous, and with constant losses, the morale and resources allocated would quickly decline.

I think that as the threat score goes up regardless of cargo score, the less likely an attack is, but when it does happen, it should be a lot more ferocious, and considering that it's well known that pirates have some alien equipment, it'd sound likely that they'd use it to try even the odds for these sorts of fights.

I also feel that even after a single ship loss, they'd likely cut their losses and run for the hills. Somali pirates are tenacious and clever, and I'd like to think the same of whatever warlord has the ability to amass even the current firepower thrown at the player to date.

Otherwise it just sounds ridiculous having 4 leviathans, 7 ravens and a sprinkling of however many other craft trying to outgun and outplay 100 or so Kar Ik Vots, 150 Met Par Teks. and however many Tek Fars, from both a lore and mechanic perspective. You're not even matching their numbers, and each ship could probably go toe to toe with that fleet alone.

vkr-13 avatar Apr 28 '23 20:04 vkr-13

Otherwise it just sounds ridiculous having 4 leviathans, 7 ravens and a sprinkling of however many other craft trying to outgun and outplay 100 or so Kar Ik Vots, 150 Met Par Teks. and however many Tek Fars, from both a lore and mechanic perspective.

But they really want the cargo! ;)

ThrawnCA avatar Apr 28 '23 22:04 ThrawnCA

Another issue that occurred to me: pirates have limited cargo capacity. If your fleet has 50000 units of cargo and needs a thousand crew to operate it, chances are that the pirates would never be able to take more than a tiny fraction. So "untold riches" should be a less appealing target than it seems.

ThrawnCA avatar May 20 '23 06:05 ThrawnCA

Another issue that occurred to me: pirates have limited cargo capacity. If your fleet has 50000 units of cargo and needs a thousand crew to operate it, chances are that the pirates would never be able to take more than a tiny fraction. So "untold riches" should be a less appealing target than it seems.

Good catch. I don't think that they bring their own cargo ship dedicated to sweep the stolen goods, though, but it is clear that the maximum limit to consider the target's possible goods should be limited to their maximum cargo hold total.

Perhaps it may result devastate consequence, for it may generates more than a ten thousands of Leviathans, which is not only terrifying but also laggy as hell.

binaryspica avatar May 20 '23 06:05 binaryspica

well at least now they consider local fleets before attacking, and can have different levels of fleets, implementing that would already help make them feel smarter I think they should prevent the player from reaching the 50k cargo point

Hurleveur avatar May 20 '23 07:05 Hurleveur

The other point to consider is that you aren't supposed to have 100 Bactrians, you're barely supposed to have one. The game makes it too easy and too attractive (and for some missions, necessary) to become hugely overpowered, but the pirate mechanic stays within the bounds of realism. Four sparrows and a gunned up leviathan should be a fairly scary pirate fleet to any non-military ships.

yafflehk avatar Jun 01 '23 01:06 yafflehk

The other point to consider is that you aren't supposed to have 100 Bactrians, you're barely supposed to have one.

Well, some people enjoy playing that way. And sure, Bactrians may be a poor example, but even a hundred Bulk Freighters would be a poor target for piracy.

It would be simple enough to cap the fleet size if that were really a good approach to take, but I don't think it is.

ThrawnCA avatar Jun 01 '23 03:06 ThrawnCA

You are not supposed to have a hundred of bactrians but it is quite doable if you play the game for some time.

For now I have about two hundreds of bactrians+almost 800 smews, and nearly 1300 deep rivers, and with +14 and -13 rate I can always see(100% to spawn) the pitiful amount of pirates all the times, which are simply clear in a moment but still annoying.

binaryspica avatar Jun 01 '23 04:06 binaryspica

You are not supposed to have a hundred of bactrians but it is quite doable if you play the game for some time.

For now I have about two hundreds of bactrians+almost 800 smews, and nearly 1300 deep rivers, and with +14 and -13 rate I can always see(100% to spawn) the pitiful amount of pirates all the times, which are simply clear in a moment but still annoying.

But at that point you're no longer an individual player, you are essentially a government and piracy is not really something you need to bother about. The pirates are annoying, not because they have any hope of doing you harm, but because they remind you that the mechanic of the game is broken/you broke the game. You have to ask what a pirate fleet that could cause you trouble would look like? The automata would make life uncomfortable I suppose, if they decided to.

yafflehk avatar Jun 01 '23 07:06 yafflehk

There's nothing wrong, from a gameplay perspective, with becoming so strong that the pirates' attitude is "Nope." It's even a built-in mechanic. The algorithm just needs some tweaks for high-end fleets.

ThrawnCA avatar Jun 01 '23 07:06 ThrawnCA

Here's a possible approach. I am not very familiar with the code base, so I don't know how difficult it would be to implement, but what I am describing is built up out of existing AI gameplay and behaviour components.

Fluff

Pirates are keenly aware of balance of power. No matter how tempting a target, they will not attack unless there is decent chance of victory. Typically, if they find themselves in a system with a vastly stronger hostile fleet that is not otherwise occupied, they will retreat and bide their time.

But they are always out there, lurking on the outskirts of the system, ready to swarm in to take advantage of any weakness.

Sometimes, a pirate's greatest virtue is patience. For example, a smart pirate captain parked on a planet with a Navy Carrier in orbit is going to wait until the Navy leaves before going into space.

They are also keenly aware of the alliances and rivalries of their enemies. For example, no matter how much Navy and Militia might hate each other, the pirates know that nothing short of an all-out war will stop them from cooperating against pirates. On the other hand, if the lawmen are actually shooting at each other, the pirates will certainly take advantage!

Crunch

Pirate fleets are spawned in the system as before, but their behaviour depends on the balance of power in the system and is in one of two modes:

  • Lurk: Land on the planet if able and already very close, otherwise move to a certain distance away from the centre of the system and stay there. Avoid combat, and retreat from any hostile ships.
  • Raid: Stay near the centre of the system, and attack any hostile ships, i.e., the current behaviour.

All pirates in the system are in the same mode and shift modes based on a balance of power calculation. The calculation doesn't have to be perfect, as long as it's not too exploitable. A possible heuristic follows.

At any given time, each side present in the system (including the player) has some power metric, possibly the very one that decides whether cargo convoys get attacked. The power of all the sides opposing the pirates is combined, subject to some simple adjustments:

  • Infighting: If their opposition is fighting each other, their powers cancel. For example, if the total Militia power (including the player) is 12 and the total Navy power is 10, then the total power threatening the pirates is 12 + 10 = 22 if they are not engaging in open warfare or are under truce and | 12 - 10 | = 2 if they are. (This is, of course, not an accurate heuristic per Lanchester's Square Law, but pirates are presumably an optimistic bunch.)
  • Planet landing rights: Any side that can ordinarily land on a planet in the system (i.e., without paying a bribe and without mission-specific exceptions) gets a modest multiplier.

Then, pirates all Lurk or Raid based on how their combined power compares to that of their opposition. To keep their behaviour from being too erratic, it might make sense to have the Pirate/Opposition threshold for going from Lurk to Raid be higher than for going from Raid to Lurk.

A similar balance of power metric can be applied to ships within some radius of a planet, and if it exceeds some value, spawning of pirate ships from the planet is suppressed.

Effects on gameplay

Granted, this would be a pretty big change. It's hard to anticipate all consequences, but here are my thoughts:

  • Overall, unless one actively seeks them out, one would fight pirates less frequently; but when one did, it would be far more challenging.
  • Pirate behaviour would feel more organic and intimidating: they would hover and lurk just out of reach, then suddenly swarm once the Lurk->Raid threshold is passed, then retreat if taking too many casualties (which would put them below the Raid->Lurk threshold).
  • If one does seek out pirates, e.g., for the classic starting strategy of capturing bigger and bigger ships, the game would become far more challenging and require far more finesse: either taking more risks using a weaker fleet, or using much faster and more manoeuvrable (and thus more vulnerable) ships to chase pirates down; or carefully positioning ships to ambush pirates on their way into the system, before they have a chance to retreat. That said, I think (and granted, I could be wrong) most players agree that the current ease of capture is a borderline cheat.

krivit avatar Apr 20 '24 14:04 krivit

In love with this

How do we make this happen?

Ferociousfeind avatar Apr 20 '24 15:04 Ferociousfeind