• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Feature Request NPC Pirates to Use False Flags

Mere_Mortal

Free Like a Radical
Storm Modder
[THREAD SPLIT]

NPC pirates using false flags. Has this ever been looked into?

I doubt it would be compatible/logical with encounters, but coastal traffic might work differently.
 
Last edited:
NPC pirates using false flags. Has this ever been looked into?
Until half a year ago, false flags never worked properly at all so there was never any point to look into that.
That is a thing of the past now though, so sounds interesting to me. :doff

Not entirely sure how exactly it should work.
But at least I can point you towards the right code, since I rewrote it all not too long ago. ;)
 
The idea I had is that a random chance could be applied for a pirate ship to change their nation, so they could literally roll up next to the player and they might not even notice. Certainly other traffic and forts wouldn’t care unless that nation happens to be hostile (which would be illogical, so the island nation should be looked at). Maybe within a certain distance the pirates might decide to hoist (maybe the run-away logic could be used here, so if they would not flee under normal circumstances then they hoist), and this would be in the effect of their nation attribute being reverted back to pirate. Sails would have to be set to standard otherwise it’d defeat the purpose. So yeah, the player might be like “Phew! Finally made it home with all this silver. OH CRAP!”
 
They'd only be any use if you also rewrite the AI to use them properly. For one thing, an enemy ship is going to start firing at you as soon as he's in range, and if you have an enhanced compass then the red shapes on the minimap will be a bit of a giveaway. If there are a group of pirates then they'd all need to use the same false flag because a group consisting of a French, a Dutch and an English ship is going to look suspicious.

So they all need to act friendly if they're trying to use false flags, and they all need to use the same false flag. Then they need to switch to their correct flag before firing. Naval captains did that because it was honourable and because at some point it became international law. Pirates did it to intimidate the target - raising a pirate flag was effectively saying "I'm a pirate, not navy or privateer, so I don't play by the rules of war. Don't make me angry or else!".

It's going to get amusing if the other ship is flying a false flag and so are you. Presumably his false flag will be set to make him look friendly to you, but if he hasn't recognised your false flag then it ought to be set to be friendly to your flag. Which means you're approaching Martinique under a false French flag, a ship flying a French flag approaches you, then one of you hoists his true English flag and starts firing, and the other one thinks "Oops, should have been flying my true English flag after all". :facepalm
 
@Grey Roger and @Mere_Mortal: I moved this to the Brainstorming forum since I don't think it relates to the original topic anymore.

Anyway, as a practical approach, I would imagine the following:
- Non-pirate (Coastraider/Merchant) encounters can get an attribute added that makes them a "hidden pirate"
- This would be added to the "Fleet Commander" or all ships in the fleet
- If this attribute is set, then when the player is hostile to PIRATE and they come close, the entire fleet may suddenly hoist a Pirate flag instead

So basically the current encounter generation remains as it is, with the addendum of that "hidden pirate" attribute being set for some encounters.
Then everything else can be handled in the "update every minute" function that normally handles false flag recognition.
 
That might be a more plausible approach. I’ll have to experiment with flipping the nation on an NPC to see how other ships respond. I assume it would work just like the player hoisting the flag. The only issue I have with regular merchants doing this is that they’d be merchant-class vessels, so we probably wouldn’t see many sloops or barques doing this, and they may well also have valuable cargo. I’ll look at both options, I think if the original ship can be pirate then that’s better, but it would obviously be much harder to code.
 
I’ll have to experiment with flipping the nation on an NPC to see how other ships respond.
Should be easy enough:
Code:
ch.nation = PIRATE;
RefreshBattleInterface(true);
RefreshFlags();
I think that might just do the trick.

I assume it would work just like the player hoisting the flag.
Yep. My suggestion above is basically a vastly simplified version of the HoistFlag function.
My simple approach only handles a single ship and not the entire fleet; ideally that should be added.
Nicest would be to rewrite that player function so it can also be called on NPC ships as well.
The only issue I have with regular merchants doing this is that they’d be merchant-class vessels, so we probably wouldn’t see many sloops or barques doing this, and they may well also have valuable cargo.
My reason for suggesting merchants only is because it would be easiest. Merchant ships are probably valid ships for pirates.
Also allowing navy ships means you could run into an English HMS Surprise that turns pirate, which you would want to avoid.

Fancy alternative would be to check if a ship type COULD be used by the pirates and never set that attribute if it cannot.
If the attribute is present, don't add/remove any cargo from that ship.

Not sure if this should affect the entire fleet or if only single ships within a fleet could be secret pirates.
Having it for the whole fleet would add an extra layer of complexity,
because you would have to check if each ship in the fleet is a valid pirate ship before setting that attribute for all of them.
 
I’ll look at the code for the player flag changes, I think it would be a good base to work from.

If only one ship could do it in a fleet, it would be a bit like a mutiny...
“Screw you, boss. You don’t pay me enough, so I’ll have to rob you now! Arr!!”
 
If only one ship could do it in a fleet, it would be a bit like a mutiny...
“Screw you, boss. You don’t pay me enough, so I’ll have to rob you now! Arr!!”
True. Or an "undercover pirate waiting for the right moment to strike" or something. :confused:
 
If only one ship in a group turns pirate then it will probably attack the nearest target, which is the rest of the merchants in the group. The player can either ignore the battle and go on his way; watch the fun and look for something to loot; or join in on one side or the other.

Or perhaps fix the newly-turned pirate's AI so that it ignores the nearby merchants and goes straight for you. Then all it has to worry about is all the afore-mentioned merchants firing at it as it tries to run from them.

OK, so fix the merchants' AI as well so they let it go. Not exactly realistic, especially since if a pirate had managed to join a convoy under false colours, its intent would be to attack that convoy, not to wait on the off-chance that some privateer/pirate/whatever you're playing will turn up. (In fact, I've been planning on something along those lines myself, only it's part of my storyline and it's you who will be ambushing the convoy.)

Pirates could use anything. And did. In game they're limited to smaller ships as that's what they'd have preferred - something light, agile and not too expensive to run. So pretty well anything you're likely to encounter as coastal traffic is a possible pirate. So I'd skip the check and just have the whole group turn pirate, regardless of what's in the group.

Navy ships could turn pirate, or change nation. You can do this, so it's not unreasonable for NPC's to do likewise. So you're sailing along under a French flag, you encounter a warship under a French flag, it closes in on you and then changes to English. (Could be embarrassing if you're also English and sailing under a false French flag. xD)
 
If only one ship in a group turns pirate then it will probably attack the nearest target, which is the rest of the merchants in the group. The player can either ignore the battle and go on his way; watch the fun and look for something to loot; or join in on one side or the other.
Very true. My thinking there was that perhaps that pirate meant to attack the merchants he's with.
If so, then he wouldn't need to wait with changing flags until the player is around and that might happen randomly even on the other side of an island.

Or perhaps fix the newly-turned pirate's AI so that it ignores the nearby merchants and goes straight for you. Then all it has to worry about is all the afore-mentioned merchants firing at it as it tries to run from them.
Also sounds doable. In Screwface_functions.c, there is code to determine the target of an enemy ship.
Normally that is set to whatever ship is closest, but if the "secret pirate" attribute is set, that could override the default to go for the player ship instead.

Pirates could use anything. And did. In game they're limited to smaller ships as that's what they'd have preferred - something light, agile and not too expensive to run. So pretty well anything you're likely to encounter as coastal traffic is a possible pirate. So I'd skip the check and just have the whole group turn pirate, regardless of what's in the group.
Indeed coastal ships are fair game. They also come in groups of two, so at least it wouldn't be a 15-fleet secret-pirate-fleet.
Also avoids any entire big navy fleets being "secret pirates", because that would definitely seem quite bizare.
 
If only one ship turns pirate then it’s essentially a mutiny - in such a case, I see no problem with the rest of the fleet attacking it. In any case, I think that ought to serve a separate purpose. I think we have three possibilities here: a fleet of pirates under false colours, one ship in a fleet effecting a mutiny against the rest, and a warship turning against its own nation - each would require different sets of logic, but I think for starters it would be wise to concern ourselves with only one of them and then tinker with the logic to be used in the other scenarios afterwards. One thing worth considering is that if one ship mutinies then it shouldn’t specifically be considered a pirate - or rather, we need to account for whether or not forts should open fire on them. I think the best focus initially would be hoisting the colours as a group.
 
Doing it for single ships is probably easier to code, but indeed the whole fleet would be better for gameplay.

I like the idea of focusing for starters on the Coast Raiders and having them potentially turn Pirate.
That sounds relatively small.
 
A single ship turning pirate may be a mutiny or it may be a pirate which attached itself to the convoy under false colours with the intent of attacking the convoy. Either way makes it fair game for the rest of the group to attack it, and for that matter for the fort to fire at it if it attacks while in range of the fort.

If warships are to change flag then it ought to be to another nation flag, not to pirate. It should really only be single ships or small groups, but in any case the whole group should change flag. It's not a ship or group turning traitor, it's the ship or group operating under a false flag, e.g. for commerce raiding. Large fleets wouldn't do that; keeping such a fleet at sea was expensive, so in reality it would only be there if it's on its way to a specific engagement, e.g. a major battle.
 
I think there might be considered two stages for this idea:
1. Single small ship can turn pirate
2. Fleet of multiple ships may operate under false colours and change their flag together
 
It's going to get amusing if the other ship is flying a false flag and so are you. Presumably his false flag will be set to make him look friendly to you, but if he hasn't recognised your false flag then it ought to be set to be friendly to your flag. Which means you're approaching Martinique under a false French flag, a ship flying a French flag approaches you, then one of you hoists his true English flag and starts firing, and the other one thinks "Oops, should have been flying my true English flag after all". :facepalm
Things like those actually happened. I recently read about an incident in the war of 1812 between an American privateer and a British merchant near Saint Helena island. The privateer spotted the British and hoisted a British flag to get closer. But the British captain must had heard that an American privateer was around the area so he suspected the ruse and raised an American flag instead. The privateer fell for it and raised his own real American flag in response, only for the British to scamper away to a neutral port. And so the trickster was tricked.
 
Back
Top