• 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!

Fixed Sea Relations: Behaviour for Recognizing False Flags

How should enemy forts treat players sailing into port under a false flag?

  • Other, please specify below

    Votes: 0 0.0%

  • Total voters
    20
Could it be? I'm not sure. But some of the code I've been looking at does relate to surrendering.
If I have to rewrite that too, this might end up taking a while....
 
To all, but especially @Grey Roger: If you have any thoughts on how this should all work, I'd definitely welcome it.

The main queries are:

- What should other ships remember about you? At the moment they store your ship name and type only when they are hostile.
My thinking is to instead ALWAYS store your current flag when you approach and have this knowledge somehow influence their behaviour towards you.
So if you passed them under a (hostile) French flag and now pass them under a (friendly) Spanish flag, they'll immediately turn hostile as they recognize you for flying a hostile flag before.
This would then be triggered every time the battle interface is refreshed, such as on first reload to sea, after Sail To or when hoisting another flag.

- What do we want for dynamic flag detection? This used to be checked every 1-2 minutes for every flagship in a group.
I would want to do this for EVERY ship in the group, but we can decrease the checking interval to longer than 2 minutes.
And skip in the following cases:
> Player is flying Personal Flag (can never be false)
> Real player relation is not hostile to this ship (no need to detect anything as this ship likes the player)
> Skip all merchant vessels (based on encounter type, NOT on ship type as that may not match for Versatile ships)

Then I would want to be based on both the flag previously stored in memory (see above) AND the player current flag.
This to prevent ships stupidly forgetting that the player was hostile to them before.

- Then when you are indeed recognized, automatically hoist the flag of your Served Nation
 
What if you were flying a hostile nation flag and therefore got into a fight with a ship which is normally friendly to you? So you were in combat, presumably got far enough away that you aren't in battle any more and can change your flag, so now you raise Personal flag and Sail-To one of the remaining ships. It should remember that you were hostile a moment ago and resume battle, even though you only lost a point or two so your Personal flag is still friendly to them.

More importantly, even if this group now recognises you, another group which is the other side of the island should have no idea what's going on - radio hasn't been invented yet. So if you finish battle here, then raise either Personal or a friendly nation's flag, the next group should perform their check as if nothing had happened because as far as they know, nothing has happened.

You should only automatically hoist your Served Nation flag when you start firing - tie it to pressing the buttons to fire the cannons either by auto-aim or manually. Also hoist your Served Nation flag if you board him, but not if he boards you. This is important for the fort - it sees two apparently friendly ship fighting each other and has no idea which one is genuine, and if you don't return fire or initiate boarding then you're still trying to look friendly. In fact, if you keep that up long enough, the fort ought to have a chance of thinking the other ship is the impostor.
 
What if you were flying a hostile nation flag and therefore got into a fight with a ship which is normally friendly to you? So you were in combat, presumably got far enough away that you aren't in battle any more and can change your flag, so now you raise Personal flag and Sail-To one of the remaining ships. It should remember that you were hostile a moment ago and resume battle, even though you only lost a point or two so your Personal flag is still friendly to them.
That is why I want the ships to remember the flag you were flying the first time you passed them.
So hopefully I can convince them to do exactly that. :yes

More importantly, even if this group now recognises you, another group which is the other side of the island should have no idea what's going on - radio hasn't been invented yet. So if you finish battle here, then raise either Personal or a friendly nation's flag, the next group should perform their check as if nothing had happened because as far as they know, nothing has happened.
Likewise, I want all flag recognition to be executed ONLY to those ships within visible range. So indeed in your scenario, the ships on the other side of the island should remain ignorant. :yes

You should only automatically hoist your Served Nation flag when you start firing - tie it to pressing the buttons to fire the cannons either by auto-aim or manually. Also hoist your Served Nation flag if you board him, but not if he boards you. This is important for the fort - it sees two apparently friendly ship fighting each other and has no idea which one is genuine, and if you don't return fire or initiate boarding then you're still trying to look friendly. In fact, if you keep that up long enough, the fort ought to have a chance of thinking the other ship is the impostor.
I'm not entirely sold on that one.... One of the main reasons fot auto-hoisting your served nation flag is for simplicity. That would already be an improvement over auto-hoisting your personal flag, as I had originally thought of doing.
But at the moment, forts CAN NOT recognize false flags. Period. Which means that you can always sail right into an enemy town. That just make zero sense to me from a "challenging gameplay" perspective.
With the idea of auto-hoisting your served flag, the fort still doesn't recognize you, but if other ships in the area do, then the fort will join in the battle.
So then you can still always safely enter port and there is only a risk if there are any non-merchant ships near the port who might recognize you.
Sounds about right to me. :shrug

Of course if we COULD get the forts to also do false flag recognizing of their own, it might be a different story.
But that is yet another thing to complicate this project and at the moment it is complicated enough as it is. :facepalm

NOT auto-hoisting your served nation flag would mean that I need to add extra code to update the entire group when one ship catches you out.
That is also more complexity. Plus I'm not sure if I can even set them properly hostile to you if your flag is friendly to them,
because generally your on-sea relations is based on your .nation (=flag) and their .nation (=flag/actual nation).
 
This is a tricky issue to get around.
Let's first see how in real life would they detect you fly false colours.
Probably the captain of the ships spots the name of your ship or spots the captain and recognizes it by tales or orders. It could also be you sail a recognisable ship so they detect you by this.

Some issues we have are for example if you have 2 differents LOM's. You could fly both of these flags without it being a problem ... but ships might recognise this as flying false colours.

So I think we should do the following:

When attacking a ship of an nation there is a chance depending on the size of the ship and your repution to get "known" for being an enemy. If you are know your CharacterID (or model) and ShipID will be stored at the nation.

When spotted from "far" the ship will compare the shipID it knows to the one you have. If this is not an unique ship there is a chance it will detect you based on the distance etc. If you have an unique ship it will instantly detect you.
If you get "closer" the ship will compare the CharacterID it know to the CharacterID you have. We could even change this to models so visiting the tailor actually helps ;).
When detected depending on the rank of the ship it will have a higher chance of know about you. And if it does it will store the CharacterID and ShipID itself too and it will change the relation to enemy.
If you flee from the ship and encounter it again it will now see it has a characterID and ShipID (depending on the dinstance) set already and compare agains that and if it agrees it will instantly set its relation again because it now remembers you.

What you might want to consider is having an array of character and ships or at least a list of multiple ones so companionships etc can also be detected....


Does this make any sense?
 
Some issues we have are for example if you have 2 differents LOM's. You could fly both of these flags without it being a problem ... but ships might recognise this as flying false colours.
If France is friendly with Holland and England and you have a LoM from Holland or England, then you flying an English flag does not trigger false flag detection with France.

If Holland is allied with France but hostile to Portugal and England is allied with France and neutral with Portugal, you could try flying a French flag near Portuguese ships.
Your "served nation" is "personal" because you have multiple LoMs. Because the Portuguese ships ARE hostile to you, they can detect you, causing you to hoist your personal flag, which still makes sense.

It gets weird if you have only an English LoM, England is friendly to France but you are hostile to France. Flying an English flag near a French ship might then trigger false flag detection.
Then you'll hoist an English flag, which you were already flying and doesn't make the French ship hostile either.
But that is a situation that shouldn't be happening in the first place, because your relations are tied to England's anyway.

Exception is if you have been acting nasty towards France despite them being neutral/allied with England, which makes you a bit of a pirate.
In that case, if France turned hostile, then you lost a substantial number of points with them at some point, which means you GAINED those points with the pirates as you had no legal reason to offend France.
That means your served nation would now have been Pirate instead of England and upon being detected, it would be a Pirate flag that you hoist.
So again, pretty much makes sense.

So I think we should do the following:

When attacking a ship of an nation there is a chance depending on the size of the ship and your repution to get "known" for being an enemy. If you are know your CharacterID (or model) and ShipID will be stored at the nation.

When spotted from "far" the ship will compare the shipID it knows to the one you have. If this is not an unique ship there is a chance it will detect you based on the distance etc. If you have an unique ship it will instantly detect you.
If you get "closer" the ship will compare the CharacterID it know to the CharacterID you have. We could even change this to models so visiting the tailor actually helps ;).
When detected depending on the rank of the ship it will have a higher chance of know about you. And if it does it will store the CharacterID and ShipID itself too and it will change the relation to enemy.
If you flee from the ship and encounter it again it will now see it has a characterID and ShipID (depending on the dinstance) set already and compare agains that and if it agrees it will instantly set its relation again because it now remembers you.

What you might want to consider is having an array of character and ships or at least a list of multiple ones so companionships etc can also be detected....
Player character ID is always the same: "Blaze". Character name, perhaps. But then renaming yourself becomes a bit of a cheat, just like currently renaming your ship was a bit of a cheat.
For now, I just want a simple workable solution. If anyone wants to make it more complicated, they're welcome to do so.
But if we're going to throw complete realism at it, this whole feature will fall flat because it'll hardly ever happen anymore with all the checks in place to prevent it.
That's no fun either. :facepalm
 
If France is friendly with Holland and England and you have a LoM from Holland or England, then you flying an English flag does not trigger false flag detection with France.

If Holland is allied with France but hostile to Portugal and England is allied with France and neutral with Portugal, you could try flying a French flag near Portuguese ships.
Your "served nation" is "personal" because you have multiple LoMs. Because the Portuguese ships ARE hostile to you, they can detect you, causing you to hoist your personal flag, which still makes sense.
And at that point I delete the game and re-install the previous version because I don't want anything to do with personal flags. :( If it can't figure out which of my LoM's is hostile to Portugal and pick one of them then I don't want it forcing a personal flag on me instead. Or a pirate flag, unless I do something genuinely piratical such as attack a ship without a LoM from a nation hostile to that ship.

I'd much prefer if it doesn't force any flag to be hoisted. However, if you open fire while still flying a friendly flag to the enemy then you lose massive reputation points and possibly switch to being a pirate. This would, however, require that whatever stops you from changing flag during a battle is disabled, so that you can choose to hoist a Dutch flag and then fire. But this is likely to be too complicated...

It gets weird if you have only an English LoM, England is friendly to France but you are hostile to France. Flying an English flag near a French ship might then trigger false flag detection.
Then you'll hoist an English flag, which you were already flying and doesn't make the French ship hostile either.
But that is a situation that shouldn't be happening in the first place, because your relations are tied to England's anyway.
What happens if you had a second LoM, making you independent; and then either lost it or gave it up, meaning you now only have the English LoM? If, while you had two LoM's, you made an enemy of France, does the loss of the other LoM now tie your relations to England's, causing France to become friendly to you and effectively forgive whatever you did before?
 
And at that point I delete the game and re-install the previous version because I don't want anything to do with personal flags. :( If it can't figure out which of my LoM's is hostile to Portugal and pick one of them then I don't want it forcing a personal flag on me instead. Or a pirate flag, unless I do something genuinely piratical such as attack a ship without a LoM from a nation hostile to that ship.
Unless you started the game as a Pirate, indeed you would NOT be auto-hoisting a Pirate flag unless you actually committed enough acts of piracy to make your friendly with the Pirates.
And using false flags and multiple LoMs is player choice anyway.

The idea of setting your served nation to PERSONAL_NATION when you have multiple LoMs was your suggestion, if I recall.
I'm just making use of that suggestion here. o_O

I'd much prefer if it doesn't force any flag to be hoisted. However, if you open fire while still flying a friendly flag to the enemy then you lose massive reputation points and possibly switch to being a pirate. This would, however, require that whatever stops you from changing flag during a battle is disabled, so that you can choose to hoist a Dutch flag and then fire. But this is likely to be too complicated...
I do see possibilities there and I have some ideas on how to make it work.

At the moment false flags are bugged and you can basically not use them in any sensible way, so at least for now,
the approach I proposed seems to me the simplest solution to get something to work at all and I want to get create at least a workable solution on very short notice.
Then we can do testing and debugging on this admittedly simplified version. When we confirm that to be fully working as intended, we can see about building on it.

I have by now changed so many related things that I would really want it all to work as intended again.
So for the next update, don't expect any functionality exceeding what we used to have, other than false flags actually serving some sort of purpose for a change.
Further improvements are certainly possible after that though. :yes

What happens if you had a second LoM, making you independent; and then either lost it or gave it up, meaning you now only have the English LoM? If, while you had two LoM's, you made an enemy of France, does the loss of the other LoM now tie your relations to England's, causing France to become friendly to you and effectively forgive whatever you did before?
If you go from two LoMs back to one LoM, then indeed your Served Nation gets set back to whatever nation you are now serving. So in your example, you'll go back to serving England.
However, your nation relations are then indeed NOT updated until a new random nation relation change affects you.

So then flying an English flag around French ships would be an odd situation. My thinking at the moment is to just skip false flag detection in that case.
It should be an unlikely scenario and the only alternative would be to build in a special exception to then NOT hoist your served nation flag, but hoist Personal instead.
 
Unless you started the game as a Pirate, indeed you would NOT be auto-hoisting a Pirate flag unless you actually committed enough acts of piracy to make your friendly with the Pirates.
And using false flags and multiple LoMs is player choice anyway.

The idea of setting your served nation to PERSONAL_NATION when you have multiple LoMs was your suggestion, if I recall.
I'm just making use of that suggestion here. o_O
Not quite. My idea was that if you have a specific served nation due to having a single LoM then your relations are tied to that nation's, whereas if you are independent then your relations aren't tied to anything. Hoisting a Personal flag was one way of making yourself independent right away, for the benefit of those players who don't want to be tied to a nation at all. The reverse was never intended - if you're independent then you have no served nation, you don't automatically hoist Personal flag when the game feels like it. I have always been opposed to being forced to hoist a Personal flag.

At the moment false flags are bugged and you can basically not use them in any sensible way
That's only because recognition is so broken that your false flag is detected almost at once.

If you go from two LoMs back to one LoM, then indeed your Served Nation gets set back to whatever nation you are now serving. So in your example, you'll go back to serving England.
However, your nation relations are then indeed NOT updated until a new random nation relation change affects you.

So then flying an English flag around French ships would be an odd situation. My thinking at the moment is to just skip false flag detection in that case.
It should be an unlikely scenario and the only alternative would be to build in a special exception to then NOT hoist your served nation flag, but hoist Personal instead.
I'd have thought that if you've given up (or lost) the other LoM so that you now serve England alone, it's inevitable that you'll fly an English flag all over the place, including near French ships. But if you're serving a single nation and flying that nation's flag then you should indeed skip false flag detection, since you're not flying a false flag.

The only snag there is that you can become a total pirate, raid everyone's ships and get everyone hostile to you. Then you pay a pirate diplomat to make peace with one nation or pay that nation's governor for forgiveness, then buy a LoM, and you're now a loyal servant of that nation and automatically at peace with anyone who is also at peace with that nation. One possible way to hinder that, though not guaranteed to block it in all circumstances, is if you're not allowed to buy a LoM until you are first at peace with the nation and all its allies - once again making the point that alliance isn't the same as neutrality.
 
I might make things a bit worse for the time being, just for testing purposes.
It is my suspicion that there are issues with the false flag detection other than the range at which it occurs.
So to be able to narrow this down, my intention is now to ALWAYS force a false flag recognition when you get in range of a ship that can recognize you.
That will allow us to establish the maximum range at which this may happen and tweak that to start out with.

The "automatic hoisting" of your served nation flag will remain also for testing purposes only.
Once the first stages of the tests have been completed and all ships do behave like they should based on this far-too-simple system,
I'll extend it as @Grey Roger suggests so that automatic hoisting of your flag is no longer necessary to turn the ships hostile.

This on the condition that we can figure out something so that forts CAN take action against players sailing right into port under a false flag.
After all, this should be a RISKY business! If it is necessary for quest purposes, we can put exceptions in place to prevent this.
But I'm not going to make the system far too friendly just because some quest might be affected. There are different solutions for that already available.

Not quite. My idea was that if you have a specific served nation due to having a single LoM then your relations are tied to that nation's, whereas if you are independent then your relations aren't tied to anything. Hoisting a Personal flag was one way of making yourself independent right away, for the benefit of those players who don't want to be tied to a nation at all. The reverse was never intended - if you're independent then you have no served nation, you don't automatically hoist Personal flag when the game feels like it. I have always been opposed to being forced to hoist a Personal flag.
Maybe I combined different ideas with each other than.
Multiple LoMs = relations not tied to any nation
Served Nation at Personal Nation = relations not tied to any nation
So I joined those together so that when you have multiple LoMs, then your served nation is set to Personal Nation and your relations aren't tied to any nation as a consequence.
I don't want to link this to the act of HOISTING a personal flag on purpose unless we also add in the "Are you sure?" box which would take quite a bit of time and effort as well.
If players want their relations not tied to a nation, that is what the Personal Nation start is for. :shrug

That's only because recognition is so broken that your false flag is detected almost at once.
Yes.

I'd have thought that if you've given up (or lost) the other LoM so that you now serve England alone, it's inevitable that you'll fly an English flag all over the place, including near French ships. But if you're serving a single nation and flying that nation's flag then you should indeed skip false flag detection, since you're not flying a false flag.
My intention is to skip false flag detection ONLY when you're flying your personal flag.

However, that gives us another odd situation like the one I just ran into.
As Jean Lafitte, my ServedNation is America, but I have French starting relations. Spain is hostile to America, but friendly to France.
So when I sail near a fleet of Spanish ships under a French flag, they detect this as being false and I hoist an American one instead.
But if I hoist a Personal Flag myself, they're OK with that one because I myself am not actually hostile to Spain.
Doesn't make that much sense, really. :modding

The only snag there is that you can become a total pirate, raid everyone's ships and get everyone hostile to you. Then you pay a pirate diplomat to make peace with one nation or pay that nation's governor for forgiveness, then buy a LoM, and you're now a loyal servant of that nation and automatically at peace with anyone who is also at peace with that nation. One possible way to hinder that, though not guaranteed to block it in all circumstances, is if you're not allowed to buy a LoM until you are first at peace with the nation and all its allies - once again making the point that alliance isn't the same as neutrality.
Your nation relations don't change when you get a LoM nor when you are promoted.
But indeed that would be a strange situation. False flag detection WOULD occur because you're not flying a personal flag, but you'd auto-hoist the flag you're already flying.
We'd probably need an exception in place for such cases to force you to hoist a Pirate flag instead.
Though indeed if we can avoid the auto-hoisting, that problem would solve itself.

Sounds like it all stands or falls with those forts.
 
I noticed that forts have their coordinates set to 0 so checking the distance to them never makes any sense.
If you would pay attention to your spyglass, you'd also notice that their range doesn't match with what it should do at all.

However, the correct distance IS stored in the player attributes. So I made the following change to Ship_GetDistance2D:
Code:
float Ship_GetDistance2D(ref rCharacter1, ref rCharacter2)
{
   //Levis trying to get the dutchman out of reach when submerged -->
   if(CheckAttribute(rCharacter1, "ship.SubmergeDutchman") || CheckAttribute(rCharacter2, "ship.SubmergeDutchman")) return DIST_NOSHIP;
   //Levis trying to get the dutchman out of reach when submerged <--

   // PB: Correction for forts -->
   bool GetFortDist = false;
   if (IsMainCharacter(rCharacter1) && GetCharacterShipID(rCharacter2) == SHIP_FORT_NAME) GetFortDist = true;
   if (IsMainCharacter(rCharacter2) && GetCharacterShipID(rCharacter1) == SHIP_FORT_NAME) GetFortDist = true;
   if (GetFortDist)
   {
     ref pchar = GetMainCharacter();
     int i, fortidx, num;
     aref fortattr;
     string fortstr;
     if (CheckAttribute(pchar, "seaAI.update.forts")) {
       makearef(fortattr, pchar.seaAI.update.forts);
       num = GetAttributesNum(fortattr);
       for (i = 0; i < num; i++) {
         fortstr = "l" + i;
         fortidx = sti(fortattr.(fortstr).idx);
         if (fortidx < 0) continue;
         if (fortidx == sti(rCharacter1.index)) return makefloat(fortattr.(fortstr).distance);
         if (fortidx == sti(rCharacter2.index)) return makefloat(fortattr.(fortstr).distance);
       }
     }
   }
   // PB: Correction for forts -->

   // NK temp bugfix
   /*if(!CheckAttribute(rCharacter1,"pos")) trace("Char " + rCharacter1 + " has no ship.pos!");
   if(!CheckAttribute(rCharacter2,"pos")) trace("Char " + rCharacter2 + " has no ship.pos!");*/
   if(!CheckAttribute(rCharacter1,"ship.pos") || !CheckAttribute(rCharacter2,"ship.pos")) return -1.0; // NK 05-04-15
   return GetDistance2D(stf(GetAttribute(rCharacter1, "Ship.Pos.x")), stf(GetAttribute(rCharacter1, "Ship.Pos.z")), stf(GetAttribute(rCharacter2, "Ship.Pos.x")), stf(GetAttribute(rCharacter2, "Ship.Pos.z")));
}
This is a bit of a convoluted way of checking the distance, but it does appear to work.
With this change, we finally WILL be able to have the forts check the players' false flag in the same way as the others ships are checked.
Which in return means I'll probably be able to do away with the "automatic flag hoisting".

So that's good. But I don't know what this is going to do for game performance.
This method does seem a bit.... unfortunate. @Levis....?
 
Well, the forts do actually seem to work now in automatically recognizing false flags as you approach.
That means I can probably do away with the "auto hoisting served nation flag" idea as this is, of course, much better.
It'll take some more thinking and developing to get a watertight system up and running, though.
 
I think for now this is the best option .... we should just add the location of the forts to the forts tough I think ....
 
I think for now this is the best option .... we should just add the location of the forts to the forts tough I think ....
Looks like only Redmond fort actually has its position defined. Indeed adding it to the others should be a much better solution!
That would also allow the range between forts and non-player ships to be correctly determined.
I've figured out a way to do that, but I'll have to finish it tonight.
 
The single biggest problem isn't forts, though if forts are now recognising false flags as well, this problem has only got worse. The problem is that ships automatically recognise your false flag even if you're totally unknown. Apart from making false flags 100% useless if forts now do the same, it also means that if you're doing "Strange Things Going On", Montanez turns hostile almost right away. This means you have to be careful not to auto-aim in case one of your broadsides is pointing in her general direction - the peashooters on Montanez aren't likely to do you much harm but it will be a bit embarrassing if you save the Animists some trouble by sinking her yourself...
 
The single biggest problem isn't forts, though if forts are now recognising false flags as well, this problem has only got worse. The problem is that ships automatically recognise your false flag even if you're totally unknown. Apart from making false flags 100% useless if forts now do the same, it also means that if you're doing "Strange Things Going On", Montanez turns hostile almost right away. This means you have to be careful not to auto-aim in case one of your broadsides is pointing in her general direction - the peashooters on Montanez aren't likely to do you much harm but it will be a bit embarrassing if you save the Animists some trouble by sinking her yourself...
I did notice an error last weekend that seemed to return a distance of 0 for all ships when you first enter 3D sailing mode.
With the old false flag detection chance, that might have triggered immediate detection at huge ranged. But I already caught that so it shouldn't be happening anymore.

At the moment I'm pretty much thinking through the system from the ground up and doing piece-by-piece testing.
The distance-dependent chances of being recognized are pretty much the last thing I am intending to look at, after everything else is done.
Probably the next upload I make will have a 100% flag detection chance for testing purposes, because I need to know when is the earliest that might happen and whether anything weird occurs in relation to that.
Once all that is OK, it'll be easy to put in a corrected distance-dependent chance calculation again.

The actual chances being generated are something that should be relatively easy to fix and are therefore not a large concern of mine right now.
Which is not to say that I'm not going to fix it, because of course that is absolutely required to work too. Just not at the start because that doesn't help me with testing. ;)

The forts being excluded is definitele a bigger concern for me as them NEVER recognizing your false flag is just shitty gameplay altogether.
The reason for my "auto-hoisting of served nation flag" attempt was because the forts weren't included and something did need to affect forts too.
However, now that I have a lead on including the forts properly, I'll probably be able to do away with the concept of automatically hoisting your served nation flag altogether.
And I've already seen some recognizing-related code that is executed when you fire on your ship, so it should be easy to check your flag relation there and penalize the player as you suggested earlier.

So I now believe that I CAN make the system truly how you suggested it. Just bear with me a bit longer.
By the time I'm done, it should be all OK. And if not, I'm sure to hear it from you so I can rectify whatever strange things are still happening. :wp
 
Good news at last! I have now managed the following:
- ALL ships in a fleet or on their own can recognize a false flag because this is no longer linked to SeaAI groups
- I managed to reduce the number of same repeated function calls to hopefully improve performance
- Forts can recognize false flags as well as ships can (FINALLY!)
- When your false flag is recognized, the fort/ships DO turn hostile without the player auto-hoisting another flag
- You are no longer prevented from changing flags when you're locked in battle in preparation of @Grey Roger's suggestion

This even works in a situation where the player isn't even technically hostile.
Flying a French flag, served nation is United States, US is hostile to Spain, but I'm not and I'm still being recognized for it!
Probably doesn't make all that much sense, but it does indicate we can set character relations at sea independent of national relations.
And believe it or not, but that's definitely a good thing as it opens up all sorts of potential.

Still to do:
- Establish sensible "initial relations" for ships and forts, taking into account your current flag and their remembered flag
- Establish sensible conditions where false flag recognizing is and is not being performed
- Add the huge reputation and relation hit when attacking ships while still flying a flag friendly to them
- Check what happens to surrendered ships
- Check what is needed to define whether you can "board" a fort (this currently uses an attribute that I am deliberately not updating now because I don't want to need more code for the same thing)
- Check what happens when you have additional ships in your fleet
- Correct the visibility range per ship so this is based on the NPC captains' skills
- Check that "Black Pearl stealth" is taken into account properly and doesn't go the wrong way around
- Adapt the false flag recognition to use a distance-based chance and balance this for enjoyable gameplay
- Check all instances of ENABLE_FLAGS and remove them without losing functionality
- Check what happens on loading a savegame to prevent crazy relation-related effects from that

There are probably still some things I'm forgetting and the above isn't quite ordered by priority, so you can see there is still quite a bit to do.
But at least we're on the right track and I think we'll be able to get a proper good system working in the foreseeable future.

I will definitely leave the detection chance at 100% for the upcoming release for testing purposes, so that part can definitely wait.
After all, testing is easier when the game behaviour is consistent and any random chances make things more complicated to understand.

Now the question is: What other things of the above do I need to get done before we can consider this ready for public playtesting?
I think at the very least the first three points in my above list need to be covered.
Everything else is probably easier to figure out when there are more people checking these things.
 
The latest update I have is the 25th July one, which broke various things to do with flags.

For one thing, Portugal is allied to England, which it shouldn't be in "Early Explorers" and isn't in "Periods.c". This wasn't a result of random relation changes; after I noticed it, I tried reloading earlier savegames to try to find out when it happened, then started a new game and found that Portugal is allied to England right from the start.

Capturing the two animist ships attacking the Montanez turned Pirates from Wary to Hostile right away. This is going to mess up "Early Explorers", especially for Dutch privateers as Holland isn't allied to France. At least, it shouldn't be - again, "Periods.c" shows Holland to be at war with France, yet my Relations table shows them to be allied.

Here are my Relations tables before and after capturing the animist ships.
relations_before.jpg relations_after.jpg

After capturing the Mefisto I noticed these messages:
Type: Ship. Points: 1
Add 1. points: You are in the service of England, which is at war with Pirate
Remove 1. points: Pirate and Pirate are allied

False flag recognition by ships still seems to be far too quick and was responsible for two occasions where I tried to dock at Villa de Vega and was interrupted by a ship turning hostile during the docking, resulting in the normal message asking me to report it to Pirates Ahoy and the game then failing to respond to any keys.

I routinely fly the Portuguese flag during these test sessions. It's friendly to France and Spain (even without the messed up relations from the update), so provided there isn't a Spanish ship which auto-detects the false flag and spoils things, that gets me into any port I need to visit during "Help the Church" and "Strange Things Going On". On the worldmap I am routinely stopped by any Spanish group which gets close enough to me, though I can generally decline battle and continue on my way. Spain is supposed to be allied to Portugal and shouldn't be trying to stop me on the worldmap.
 
For one thing, Portugal is allied to England, which it shouldn't be in "Early Explorers" and isn't in "Periods.c". This wasn't a result of random relation changes; after I noticed it, I tried reloading earlier savegames to try to find out when it happened, then started a new game and found that Portugal is allied to England right from the start.
There was definitely some weirdness going on with nation relations in last week's release. But was that with or without this fix?
http://www.piratesahoy.net/threads/nation-in-war-with-itself.25537/#post-513247
If it was without it, try again with. If it was already with that fix, is there ANYTHING defined for the relation between Portugal and England in Early Explorers?
At the moment my new code assumes that ALL relations are defined and it might do weird things if nothing is there at all.

Capturing the two animist ships attacking the Montanez turned Pirates from Wary to Hostile right away. This is going to mess up "Early Explorers", especially for Dutch privateers as Holland isn't allied to France. At least, it shouldn't be - again, "Periods.c" shows Holland to be at war with France, yet my Relations table shows them to be allied.
Attacking pirate ships reduces your points with the pirates; that part is intentional.
How is this going to mess up Dutch privateers in Early Explorers? As I mentioned before, the Tortuga fort is friendly to Pirates even if France is not.

After capturing the Mefisto I noticed these messages:
Type: Ship. Points: 1
Add 1. points: You are in the service of England, which is at war with Pirate
Remove 1. points: Pirate and Pirate are allied
Only 1 point? But you went from Wary to Hostile anyway?
At some point, I had the pirates ALWAYS turn hostile if you attack one of their ships, but I changed that some time last week,
But I cannot remember if I actually uploaded that change yet. Possibly this is because you've still got that old version instead of the updated one.

False flag recognition by ships still seems to be far too quick and was responsible for two occasions where I tried to dock at Villa de Vega and was interrupted by a ship turning hostile
Not surprisingly as:
- I am still working on fixing this functionality
- ALL changes I made to that code haven't been posted yet because I didn't actually complete the work
- At the moment I have caught a bug with the visibility ranges that the false flag recognition uses, which massively affects this functionality too

I routinely fly the Portuguese flag during these test sessions. It's friendly to France and Spain (even without the messed up relations from the update), so provided there isn't a Spanish ship which auto-detects the false flag and spoils things, that gets me into any port I need to visit during "Help the Church" and "Strange Things Going On". On the worldmap I am routinely stopped by any Spanish group which gets close enough to me, though I can generally decline battle and continue on my way. Spain is supposed to be allied to Portugal and shouldn't be trying to stop me on the worldmap.
Indeed they shouldn't.
Try again with that fix I mention above if you didn't already have that and see if that helps anything.
If not, try again once I make a new upload as I lot of stuff has been rewritten again since then.
 
There was definitely some weirdness going on with nation relations in last week's release. But was that with or without this fix?
http://www.piratesahoy.net/threads/nation-in-war-with-itself.25537/#post-513247
If it was without it, try again with. If it was already with that fix, is there ANYTHING defined for the relation between Portugal and England in Early Explorers?
At the moment my new code assumes that ALL relations are defined and it might do weird things if nothing is there at all.
I hadn't installed that; so far the latest thing I've downloaded and installed, other than @Levis' attempted fix for preprocessing, is the 25th July .7z update.
"Periods.c" does define Portugal as being hostile to England in "Early Explorers". (In fact, it explicitly defines England's relationship to Portugal in each period.)
Attacking pirate ships reduces your points with the pirates; that part is intentional.
How is this going to mess up Dutch privateers in Early Explorers? As I mentioned before, the Tortuga fort is friendly to Pirates even if France is not.
Because Holland is hostile to France (at least when the game obeys "Periods.c" ;)) which, incidentally, means a Pirate flag might not help them at Tortuga - won't it regard a Pirate flag as a false flag if you fly it while serving Holland? Anyway, if a Dutch privateer then becomes hostile to Pirates as well then he has no friendly ports in "Early Explorers". And since false flags are so easily detected...
Only 1 point? But you went from Wary to Hostile anyway?
At some point, I had the pirates ALWAYS turn hostile if you attack one of their ships, but I changed that some time last week,
But I cannot remember if I actually uploaded that change yet. Possibly this is because you've still got that old version instead of the updated one.
Other way round. Prior to installing the 25th July update, boarding the animist ships cost me a few points with Pirates but didn't turn me outright hostile. After the 25th July update, boarding the animist ships did turn me hostile to Pirates. Perhaps the Nations update will reverse this.
 
Back
Top