endless-sky / endless-sky

Space exploration, trading, and combat game.
https://endless-sky.github.io/
GNU General Public License v3.0
5.68k stars 1.02k forks source link

"Arresting" personality #580

Open natangold opened 8 years ago

natangold commented 8 years ago

I'm working on a plot line that would introduce a knockout gas (not as powerful as nerve gas and only available with a Navy license), and think it'd be neat if NPC ships equipped with it had a new personality type similar to "plunders," but where they attempt to board and capture disabled pirate ships rather than simply obliterating them. "Boards" or "arrests" or "captures"...

Such a personality trait would obviously need some sort of crew comparison algorithm - a fighter pilot should never attempt to board a Protector or Korath Raider, but a Cruiser or Carrier might. A ship with a scanner might compare actual fighting percentages (i.e., including weaponry and Security Stations), whereas a ship without a scanner might only attempt a capture if they have an overwhelming default crew advantage (like a Frigate against a Raven). Then, if a given ship 'decides' against capping an enemy, they'd revert to other personality traits (the Free Worlders would leave disabled pirates floating, Navy and Militia would shoot to kill, and Merchants would take pot shots only if they happened to be close enough to a disabled ship). Perhaps those underlying traits could also play into the "arresting" personality - a heroic or plundering boarder might attempt a more difficult capture than a frugal or timid one, for example.

Such a personality would make Security Stations a somewhat more worthwhile purchase if the player is going up against the Republican Navy - who would presumably prefer to put a war criminal on trial rather than simply blow them to pieces. (Or even just against pirates, who must be getting their ships from someone.)

Thunderforge commented 8 years ago

To clarify, you are asking for a behavior that results in an NPC trying to capture a certain faction? It's possible, but there are a lot of factors to consider like how they manage crew so that they don't wind up with crippled ships.

natangold commented 8 years ago

@Thunderforge Yeah, at some point. Observationally, it seems that the game already puts more than the minimum required crew on most ships, so it would just be a matter of making sure a ship wouldn't attempt to capture a ship that it couldn't control.

I'd imagine that capturing mechanics could be significantly simplified where the player isn't involved. Assume for a moment that Navy Ship A requires X crew and currently holds Y crew and that Pirate Ship B requires M crew and currently holds N crew. If Y - N * (N / Y) >= 0.95 (X + M) then auto-capture, put M crew on B and (Y - N * (N / Y) - M) crew on A, and then have both A and B either land [on a friendly planet] or leave the system. (So a Cruiser with 96 [84 required] looks at a Raven with 9 [6 required]. Since the Cruiser has the Raven vastly outgunned, it attempts a capture, all pirates perish, 6 Navy crew members take over the Raven, 1 Navy crew member dies, and 89 remain on the Cruiser.)

Or... if both a "captures" and "arrests" personalities were added, you could use that sort of simplified mechanic for pirates capturing merchants and then an even simpler one for the Navy arresting pirates: If (a) the crew on board the arresting vessel is more than is necessary to pilot both ships and (b) the crew on board the arresting vessel is maybe 125% that of the disabled vessel and (c) between both ships there is enough "passenger space" for all crew members of the disabled vessel then the Navy auto-captures the pirate ship, and all of the pirate crew become prisoner "passengers" aboard the two ships. (So using the same Cruiser/Raven scenario, the Cruiser loses 6 crew and gains 9 passengers while the Raven loses 3 crew and switches factions.)

frameworld commented 8 years ago

A ship with 80% required crew is still usable. I wouldn't go below 50%.

The crew above that mark is "risk-able", the crew below only helps keeping causalities lower (overwhelming force).

If (risk < risk-able crew) and (capture chance > required) than attempt one.

There are 3 limits/cases:

Imagine a graph though f( x{1,2,3} ) = y{24, 25, 29}. The right side of a parable. 3 results, 1 for each case stated above.

Personalities can raise the lower limit or lower the upper limit by a percentage of the range.

For example: