• 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
I hav ebeen trying to play this game all day and it makes no rhyme or reason at all. It is total insanity! I give up.
 
Any chance of reducing that for the rest of us? I'd rather like to be able to check that "Help the Church" and "Strange Things Going On" still work. Or, for that matter, play a proper game over the weekend...
Any chance of reducing it? Not until the functionality actually works. The real problem isn't with the false flag detection and I have to find the time to narrow it down and tackle it properly.
In the meantime, not using false flags is probably your best bet.
You can try this though in PROGRAM\Screwface_functions.c:
Code:
void CheckAllShips(string type, bool initialize)
{
   return; // PB: Temporarily disabled
   int i, shipidx, num;
That stops a lot of relation changes at sea, including false flag recognition.
But that doesn't mean you won't have problems because, as I said, it is something else that is really messing us up. :facepalm

Yes, no, maybe. The game started with everyone hostile at -60 except the French at 0. I did a smuggling run earlier at Jamaica where the coast guard were standing there waiting for me to finish the deal with the smugglers so they could arrest me. Well I got away clean but the Dutch and Pirates became wary of me. This allowed me to haul cargo to Dutch ports but they still would not trade with me afterwards. Toff would not talk to me either.
Toff not talking to you is based on your reputation. So what is your reputation?

I was no where near the beach! In fact I was on the far side of the rope bridge and had to stand around for a while before they found me so we could kill them. Then the smugglers wouldn't talk and there were no coast guard ships around.
Far side of the rope bridge on Puerto Rico is still the beach location.
I'm sure @Levis will be looking into it.

I hav ebeen trying to play this game all day and it makes no rhyme or reason at all. It is total insanity! I give up.
As I've been saying, here is half-finished stuff in there at the moment because I'm not finished fixing it all.
It is very difficult and complicated and the game hasn't been cooperating with what I want.
I need more time to get things back to normal (and better).

When version 3.5 will be released for everyone?
NOT right now. Hopefully by the end of August.
 
Apparently the game likes setting the default relation between ships to hostile, so that's what you'll get when initial relations aren't initialized properly.
For testing, I have gotten rid of ALL points where nation relations are set and changed at sea, just to simplify matters.

I now seem to have a simple function working that sets the relation between all ships and forts the way they should be based on their nation relations:
Code:
void CheckInitialFlagRelations(ref chr, float visibility_range, float ship_range)
{
   int i;
   ref otherChar;
   for(i = 0; i < MAX_SHIPS_ON_SEA; i++)
   {
     if (ships[i] <= 0) continue;
     otherChar = GetCharacter(ships[i]);
     SetCharacterRelationBoth(sti(chr.index), sti(otherChar.index), GetNationRelation(sti(chr.nation), sti(otherChar.nation)));
   }

   ref PChar = GetMainCharacter();
   SetCharacterRelationBoth(sti(PChar.index), sti(chr.index), GetNationRelation(sti(PChar.nation), sti(chr.nation)));
}
Now I have to see about adding some exceptions in place for pirates to certain forts and to get ships to remember the player's flag.

But at least it's a step in the right direction. Hopefully I can figure out how to NOT change relations more frequently than need be.
That might help a bit with game performance too, because there was code changing this everywhere. :facepalm
 
I was neutral the last time I was there and up to bloke now. But I don't need that sword, I need a safe haven. When I gave up I am playing as French and have sunk no ships and have only smuggled two times. Now the French forts are sinking me, the British and Spanish are hostile, the Pirates seem to be ok although their ships attack me, and the Dutch change constantly so I don't know where I stand with them. They have gone from hostile to wary to neutral to hostile and I have done nothing to irritate them that I know of. I am sailing a Hoy with 8-4 pounders. How could I irritate anyone?
 
Indeed Toff won't talk to you if you're neutral.

Are your nation relations according to the F2 menu changing back and forth or is it the ships at sea?
I'm finally today making some progress on getting the ships to behave themselves, but I'm not done yet.
 
That IS weird. Have you got any idea of what you've been doing?
And have there been any random nation relation changes that involved France?
Those would affect you too.
 
Ok, it seems that only the Hispaniola forts are FUBAR. Dunno why because that was the first place I went and I got in and out just fine.
 
I think I found the problem with the forts sinking me. The first time you visit a port they remember your flag and if you come back with a different flag then they become hostile. It does not matter if your are friendly or not. All that matters is that you are different.
 
I started the game as La Croix. French, but that really doesn't mean anything to me. All others were -60 and hostile. But it keeps changing. One time I delivered cargo to Willemstad and while I was there they turned hostile, but I got away clean anyway.

I have NO LOM and never will.

Right now England and Spain are -60, Pirates are -59 and friendly!, French are 0, Dutch are -30 after bribing them, and Portagee are 0.

But there is more! Hispaniola forts sink me if I get in range because I am not flying the correct flag. No ideer what one to fly except for trial and error(glub). I was trading under the French flag with the Dutch until they got hostile, so they shoot at me too now. No flag works with them anymore.

I am thinking of joining the Pirates, but if that makes all other nations hostile that is no good.
 
I have NO LOM and never will.
Wha? I'm pretty sure you used to do that. Why not anymore?

But there is more! Hispaniola forts sink me if I get in range because I am not flying the correct flag. No ideer what one to fly except for trial and error(glub). I was trading under the French flag with the Dutch until they got hostile, so they shoot at me too now. No flag works with them anymore.
At the moment false flag detection is completely non-functional because I'm still working on fixing it properly.
Once that is done, Spanish flag for Spanish towns should work. Provided they don't catch you, that is; but that will be PROPER unlikely in the early game soon.
 
Because up until this game I'm playing right now 3.5 could not support even one small ship. Performance was extremely bad even with just one small ship. As in unplayable. Hence the move to GOF2 which plays very well.
Ah, performance reasons. Makes sense.
Just so you know, the version I just uploaded should have somewhat improved performance at sea again as well.
I got rid of a bunch of code that should no longer be needed and reduced the number of calls to some other functions too.
Hopefully that'll help a bit too.

OTOH, I have tried French, Spanish, and Personal flags at Hispaniola and get sunk with all of them. So that means no Mr. Gibbs or Angelique Moulin for me.
If you are actually hostile to the town you're trying to get into, at the moment that should actually be happening.
However, I'll post how to get around that in another thread now.
 
The whole "false flags" code should be almost operational as per this update:
http://www.piratesahoy.net/threads/build-14-beta-3-5-internal-wip-for-testing.24817/

At the moment the detection chance is still 100% so we can test the instances where this happens,
but it only applies to any ships that are within visible range of you. It should NOT EVER happen anymore for ships on the other side of the island!

Additionally, when you start in a hostile port, you will NOT be recognized the first time anymore.
And Tortuga will not fire upon you as player anymore if you're flying a pirate flag.
This may need some further testing, as the fort might still recognize it as false flag if you are actually hostile to France/Pirates(?).

The code to actually have a dynamic chance of being detected instead of a fixed 100% chance is also already prepared.
If you want to test with that, find this in PROGRAM\Screwface_functions.c:
Code:
bool CheckForMainCharacterfalseflag(ref chr, float visibility_range, float ship_range)
{
   if (iForceDetectionFalseFlag == -1)       return false; // Override: Never detect
   if (GetCurrentFlag() == PERSONAL_NATION)   return false; // Never a false flag
   if (IsCompanion(chr))             return false; // Companions don't care

   ref PChar = GetMainCharacter();

   bool Recognized = false;
   float chance = 1 - (ship_range / visibility_range);
   if (SeaAI_GetRelation(sti(chr.index), sti(PChar.index)) != RELATION_ENEMY && GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY)
   {
     if (ship_range < visibility_range)
     {
     /*   if (iForceDetectionFalseFlag)
       {
         chance = 1.0;
       }
       else
       {
         chance = 0.5 + chance; // 0.5 will be decreased if you are too easily recognized
         chance = chance * GetChanceDetectFalseFlag();
       }*/
       chance = 1.0;
       if(frnd() <= chance)
       {
         TraceAndLog("FLAGS: The " + GetMyShipNameShow(chr) + " has recognized our false " + GetNationDescByType(GetCurrentFlag()) + " flag at range=" + ship_range + " with visibility=" + visibility_range);
         Recognized = true;
         SetGroupHostile(chr);
       }
     }
   }
   return Recognized;
}
Replace with:
Code:
bool CheckForMainCharacterfalseflag(ref chr, float visibility_range, float ship_range)
{
   if (iForceDetectionFalseFlag == -1)       return false; // Override: Never detect
   if (GetCurrentFlag() == PERSONAL_NATION)   return false; // Never a false flag
   if (IsCompanion(chr))             return false; // Companions don't care

   ref PChar = GetMainCharacter();

   bool Recognized = false;
   float chance = 1 - (ship_range / visibility_range);
   if (SeaAI_GetRelation(sti(chr.index), sti(PChar.index)) != RELATION_ENEMY && GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY)
   {
     if (ship_range < visibility_range)
     {
        if (iForceDetectionFalseFlag == 1)
       {
         chance = 1.0;
       }
       else
       {
         chance = 0.5 + chance; // 0.5 will be decreased if you are too easily recognized
         chance = chance * GetChanceDetectFalseFlag();
       }
       if(frnd() <= chance)
       {
         TraceAndLog("FLAGS: The " + GetMyShipNameShow(chr) + " has recognized our false " + GetNationDescByType(GetCurrentFlag()) + " flag at range=" + ship_range + " with visibility=" + visibility_range);
         Recognized = true;
         SetGroupHostile(chr);
       }
     }
   }
   return Recognized;
}
However, I do not want to start trying to balance this last part until everything else actually works as expected!
So if you can temporarily agree to the current imperfect system, please do stick to the default so you can keep a critical eye on what is going on!
 
No, I was trying to enter French ports. I am French in good standing as stated before.
 
No, I was trying to enter French ports. I am French in good standing as stated before.
If it still happens with today's update, please provide a savegame and tell me one French port where you cannot enter, but should be able to.
Note that ships and forts remember the flag you've flown before, so if a French fort saw you under a hostile flag close to itself, it won't believe your French flag anymore.

Good job Pieter.
That is yet to be seen.... Hopefully it truly IS beginning to make sense with today's latest chances.
Would be about bloody time! :shock
 
Some things that probably still ARE going wrong with this feature:

Entering Tortuga under a pirate flag while being hostile to France is probably still considered flying a false flag and may get you recognised and attacked for that.
I'll have to add some extra exceptions to allow that situation as well.

Once a fort has seen you flying a hostile flag or recognised your false flag, it will NEVER forget!
That seems a bit excessive to me especially for forts of your own served nations.
How about resetting this for all forts of a nation when you're promoted?
That at least gives a logical reason for this to be done and also gives the player some influence on it.
Would only work for Pirates, navy officers and privateers. Honest merchants would remain screwed.
But then why should an honest merchant fly a hostile or false flag near a friendly fort???
 
Once a fort has seen you flying a hostile flag or recognised your false flag, it will NEVER forget!
That seems a bit excessive to me especially for forts of your own served nations.
How about resetting this for all forts of a nation when you're promoted?
That at least gives a logical reason for this to be done and also gives the player some influence on it.
Would only work for Pirates, navy officers and privateers. Honest merchants would remain screwed.
But then why should an honest merchant fly a hostile or false flag near a friendly fort???

Gameplay wise it would be nice to be able to make people forget you. So would it be possible to also save the type of ship and paint type. If these don't match it won't recognize you. This way painting your ships gets gameplay use too. And buying a new ship would also help.

Next to that maybe add something to the town update (daily) where there is a small random chance the fort forgets you. Or have a relation agent be able to do this for you.
 
Gameplay wise it would be nice to be able to make people forget you. So would it be possible to also save the type of ship and paint type. If these don't match it won't recognize you. This way painting your ships gets gameplay use too. And buying a new ship would also help.
It used to be based on ship model and name, but I figured that could be used as too much of a cheat.
Now it remembers your flag instead, which is certainly less forgiving than it used to be but that is compensated by the mod actually beginning to work for real. :wp

Next to that maybe add something to the town update (daily) where there is a small random chance the fort forgets you. Or have a relation agent be able to do this for you.
As far as I'm concerned, making all forts of a nation forget you when you get a LoM or are promoted should be good enough.
Should be no need to make things more complicated than that, I hope.

Main point is that forts were never part of the false flag detection, so their part was never really set up properly.
 
It used to be based on ship model and name, but I figured that could be used as too much of a cheat.
Now it remembers your flag instead, which is certainly less forgiving than it used to be but that is compensated by the mod actually beginning to work for real. :wp

I dont think thats a cheat. I think that should be a genuine function to get past them. Don't forget forts will remember you forever else so at one point flying a false flag wouldn't be possible anywhere anymore.
When you need to get to a certain port and you can buy a small ship to sail there to do the business and get out again because they don't recognise you with this ship, shouldn't that be the case.

I do have some questions:
- Do they also check your other ships, so could they be spotted as well?
- Does it work on companions too?
- Is there any way to improve the way you fly a false flag now (a certain skill or so?)
 
I started a new game and learned my lesson the hard way. From now on I fly my personal flag ONLY. Nothing else ever.
 
Back
Top