• 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 Raising Flag in battle shouldn't always trigger treason

You can still change flags, just don't do it close to a ship.
 
How close is too close? Experience says if you can see the island you are too close.
 
It says within viewing range. But that can be quiet far it seems.
 
It is set for GetVisibilityRange(2), which is 500 units (yards?) minus fog density and half at night.
The same is used for the [Enter] > Sail To menu for displaying nation flags.
Basically, if the Sail To menu shows you the nation flag of the ship, then they will see your flag change too.
 
So should I take a look at this or will someone else?
 
I had the strangest experience last night. I was coming in to land on Jamaica and the English are hostile. I was flying the Spanish flag which is neutral to them. There were 2 English ships in the bay I was heading for, but I have a fast ship and decided that maybe I could get past them and drop anchor without getting too shot up.
The funny thing was that I ended up sailing close by one of them and I was not recognized and they stayed calm. This was early in a new game.

This is very unusual for me as normally when they show up on the minimap they are already heading for me at full sail and as soon as they get within gun range they start firing. I don't mind being recognized except when it happens when I am still 1-2 days out from the island.
 
Especially in the early game, enemy ships are supposed to be believing your fake flags.
The more fame you gain, the less chance you've got of fooling them though.
Also, the distance is taken into account, because appearing to move in to board another ship would be quite suspicious behaviour.
It is also difficulty-dependent.

Note that your fake flag being recognized is NOT related to being marked as a traitor.

By the way, this issues isn't actually a bug: The code IS doing what it was intended to.
It is also quite avoidable by just not changing your flag when you are close to other ships. I decreased the range on that quite a bit too.
I have given several easily done suggestions to modify the behaviour on this one; but someone would need to say which of those suggestions we actually want to execute.
Wouldn't want to make this too uncommon, otherwise there would be no point in the feature being there at all.

As a reminder:
We can also reduce the penalty for being recognized for doing this, such as making you deal with only the town guards and not the citizens.

Possible things to add:
- Check if that ship was hostile to you before you changing your flag
- Check if that ship is hostile to your personal nation
- Check if bMapEnter is true, which checks if you are locked in battle (or locked in a storm)
Especially reducing the penalty is VERY easily done: Just requires removing some lines of code.
So, what WOULD seem fair in such a situation? How much could you just about handle so that this isn't an instant game-over situation?
 
How much can I handle? The town guards are instant death. One can wipe us all out. Sometimes we can handle the town folk and sometimes not. The best thing is to just take off running for the nearest gate or building. I just don't mess with flags anymore because they make no difference at all.

This morning again at level 5 I was trying to sneak into secluded beaches so I could beg forgiveness. I have learned to save in open waters and then make the run into land. I takes many attempts because ships come from all over. They come racing around from the other side of the island and I have seen them break off a battle and all turn towards me. The pirates are red and the others are gray until they start shooting my ship, then they turn red too.
 
Just for the sake of it, could you try a game on a lower difficulty? Perhaps the difficulty influence on the flag recognizing is too much.

Even ONE town guard being instant death? Well, that's a bit over-the-top. And that is already after me tuning it down quite a bit from Beta 2.3.
Note that this is again difficulty-related.

What difficulty are you on anyway?
 
Swashbuckler. It takes a while to get good enough to take on the soldiers or town guards. Level 16 or better.

My thinking is to make the game barely doable at swashbuckler so it is fun but challenging at the normal levels.

Now that I know about the flags the only thing bothering me is the distance at which they recognize me. In rainy weather the first I know about them is when they appear on the minimap coming at me at full speed because I can't see them.
 
Not sure if the distance check takes rain into account.

Anyway, it would help quite a lot if you could compare the recognizing chance against a lower difficulty.
You know what you're looking for, so you are the best person to do so.

The chance of flag detection is calculated in PROGRAM\NATIONS\nations.c with the GetChanceDetectFalseFlag() function.
For example, find this:
Code:
float GetChanceDetectFalseFlag()
{
// original code -->
//   float rank = GetRankFromPoints(GetScore(GetMainCharacter()));
//   return CHANCE_DETECT_FALSE_FLAG_BASE+(CHANCE_DETECT_FALSE_FLAG_MAX-CHANCE_DETECT_FALSE_FLAG_BASE)*rank/MAX_RANK;
// original code <--

// LDH -->
   ref mchr = GetMainCharacter(); // KK
   float score  = GetScore(mchr); // KK
   float rank  = GetRankFromPoints(score);
   int  sneak  = GetSummonSkillFromName(mchr, SKILL_SNEAK);
   int difficulty = GetDifficulty();
   float chance = rank/MAX_RANK * (11.0-sneak)/10.0;
   chance = chance * difficulty/2.0;     // 0.5, 1.0, 1.5, 2.0
//   chance = chance * (difficulty+1)/3.0;     // alternate difficulty calculation 0.67, 1,0, 1.33, 1.67
   chance = retmin(chance,1.0);   // so chance doesn't go over 100%
//   LogIt("False Flag Detection - Score: " + score + ", rank: " + rank + ", Sneak: " + sneak + ", Chance: " + chance*100.0 + "%"); // for testing
//   LogIt("The chance of your false flag being detected is " + chance*100.0 + "%");   // Tell the player, it might get him used to looking for it.
   return chance;
// LDH <--
}
Replace with:
Code:
float GetChanceDetectFalseFlag()
{
// original code -->
//   float rank = GetRankFromPoints(GetScore(GetMainCharacter()));
//   return CHANCE_DETECT_FALSE_FLAG_BASE+(CHANCE_DETECT_FALSE_FLAG_MAX-CHANCE_DETECT_FALSE_FLAG_BASE)*rank/MAX_RANK;
// original code <--

// LDH -->
   ref mchr = GetMainCharacter(); // KK
   float score  = GetScore(mchr); // KK
   float rank  = GetRankFromPoints(score);
   int  sneak  = GetSummonSkillFromName(mchr, SKILL_SNEAK);
   int difficulty = GetDifficulty();
   float chance = rank/MAX_RANK * (11.0-sneak)/10.0;
   chance = chance * 1.5;     // 0.5, 1.0, 1.5, 2.0 // <------------------------------------ CHANGE THIS LINE ---------------------------------------
//   chance = chance * (difficulty+1)/3.0;     // alternate difficulty calculation 0.67, 1,0, 1.33, 1.67
   chance = retmin(chance,1.0);   // so chance doesn't go over 100%
//   LogIt("False Flag Detection - Score: " + score + ", rank: " + rank + ", Sneak: " + sneak + ", Chance: " + chance*100.0 + "%"); // for testing
//   LogIt("The chance of your false flag being detected is " + chance*100.0 + "%");   // Tell the player, it might get him used to looking for it.
   return chance;
// LDH <--
}
This will make the chance the same as it would be on Adventurer instead. See if that seems any better.
Alternatively, set it to 1.0 for the Journeyman value. Let me know if you find a value that seems more reasonable.
 
Ok, done.

Where is that fame thing because it doesn't take long before one is being instantly recognized at the land ho call even when in friendly waters.
 
See where "rank" is mentioned in that code I posted. You can also remove the // from before these lines:
Code:
// LogIt("False Flag Detection - Score: " + score + ", rank: " + rank + ", Sneak: " + sneak + ", Chance: " + chance*100.0 + "%"); // for testing
// LogIt("The chance of your false flag being detected is " + chance*100.0 + "%"); // Tell the player, it might get him used to looking for it.
That will give you some more information on false flag detection chances.
 
So any toughts on this?
 
We have three issues here:
1. Being marked as a traitor due to flag-changing in sight of other ships
2. Being recognized as a traitor in towns and getting attacked for it
3. False flags being recognized too quickly on higher difficulties

As for solutions:

On #1:
As far as I know, there isn't an actual bug here. It is doing what it is meant to do. And it should be quite avoidable too.
But these are the things we can try:
1. Check if that ship was hostile to you before you changing your flag
2. Check if that ship is hostile to your personal nation
3. Check if bMapEnter is true, which checks if you are locked in battle (or locked in a storm)
4. Just add a random chance to this happening or not

I wouldn't like #2 very much, because the other ship probably only knows you by your flag.
So they wouldn't know you're not really English if you're flying an English flag.

On #2:
Reducing the enemies is very easy. For example, not adding MORE guards to the location and not making the town citizens join in.
So you'd get only those guards already in the location.

On #3:
Needs some testing on values as per my post #31 above.

Main thing is that we need to know what sounds fair enough from a player's perspective. I can't say that, because I basically never get round to playing.
 
With a chance of 1.5, at level 5 I am being recognized from VERY far away on swashbuckler. By saving very far out and then by being patient I can get in ok, but getting out is a matter of pure speed, luck, and good winds. Ships are coming after me from all directions.
 
I usually do my testing on Apprentice or Joruneyman, so the values of 0.5-1.0 should work better then.
Care to give that a try?
 
Back
Top