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

Confirmed Bug Sea Relations: When commander of group surrenders the whole group surrenders

well that happened to me as well i'm personal at war with every freaking nation in the Caribbean even pirates are my enemies i have conquered a small buccaneer camp (if that how you say it) that belonged to pirates i use it for my ship ammunition and I've built a small shipyard to repair my ship cuz the seas are too dangerous for me to travel :shipto my secret hideout

so when i meet a fleet if one ship surrender the others turned neutral i didn't know about this issue so i used to attack them back and chase them which did damage to my reputation i never save in sea battles since i play iron man mod i like to play as if i die here i start over from where i was so i never save before any sea battles but after reading this i might start saving to test if this weather works or not
but anyway is it bad to have all nations at war with you
and by the way i liked how the nations relations change its complicated so i keep checking it a lot thanks to whoever made it and (is it normal to not get that much notification in iron mod and why does the bell keep on ringing every few moments its annoying sometimes )thanks
 
but anyway is it bad to have all nations at war with you
Yep, it's bad to have no friends. :rofl

and by the way i liked how the nations relations change its complicated so i keep checking it a lot thanks to whoever made it
That was me. So cheers. :doff

is it normal to not get that much notification in iron mod
What notifications would you expect to get?

why does the bell keep on ringing every few moments its annoying sometimes
That should be fixed already with the ZIP you couldn't find.
But now I told you again which one it is, so now you CAN find it. So problem solved there.... :wp
 
Yep, it's bad to have no friends. :rofl


That was me. So cheers. :doff


What notifications would you expect to get?


That should be fixed already with the ZIP you couldn't find.
But now I told you again which one it is, so now you CAN find it. So problem solved there.... :wp
thanks and notifications like food relations maybe weather the wind direction(that would help me a lot ) and few other things (the wind is important for me screw all others)
and great job with the nations relations that was amazing :cheers
 
Food.... relations? I don't know what you mean there. :rumgone

You can tell the wind direction from your flags, no?
 
Food.... relations? I don't know what you mean there. :rumgone

You can tell the wind direction from your flags, no?
for the food sometimes i personally forget myself never look for food and rum and how much is left
and for the relations just ignore what i said
and for the wind i personally love to sail in 1st person mod watching the waves so i don't get to see me flag that much so a message saying the wind from ...the wind from ....sir would be helpful to me but as you said i can try looking at the flag but at night its a little bit hard thats way but anyway i'm happy without it and i'll be soo happy if it can be
 
nd for the wind i personally love to sail in 1st person mod watching the waves so i don't get to see me flag that much so a message saying the wind from ...the wind from ....sir would be helpful to me
Just buy a compass in the game and equip it.
 
Sometimes when I'm fighting at sea, a ship will strike and I cannot board without hoisting. Sometimes an entire fleet does this, which is exceptionally annoying as I wouldn't want to hoist unless I'm actually a pirate. One time when a fleet did this I saved the game, which I could do since the battle was over, and when I reloaded they were all hostile again. Obviously I'm not talking about ships which were allied or neutral in the first place.

Is this supposed to happen?

Okay, so I saw this [thread now merged to here]...

Engine Limitation - Sea Relations: When commander of group surrenders the whole group surrenders | PiratesAhoy!

It seems to be discussing this matter. I probably should have searched first!

But... it's interesting to note that the fleet reverted to hostile upon reloading.

Right, I get it now. They're not surrendering per-se, they just turn neutral. I'm guessing that reloading the game simply checks the relations and resets everything.
 
Last edited:
There are two things that can be affecting you:

When ships surrender, they can surrender TO YOU or to another enemy that is close and involved.
If they did not surrender to you specifically, then you cannot board them.

Then there is the bug that you found. I tried to fix it and it does work better than it did before, but it still isn't quite right.
The whole fleet surrendering is completely unintentional and should not happen.
You will note that only one single ship would have hoisted a white flag; the others maintain their original colours.

After loading a save, then the sea relatations are corrected and the ones that did not surrender will be properly hostile again.
 
When ships surrender, they can surrender TO YOU or to another enemy that is close and involved.
If they did not surrender to you specifically, then you cannot board them.
This... I have never noticed before. If I'm the only opposition and this happens then I guess it has glitched, but if I remember rightly the particular situation was a "full-on flagship furball".
 
I think I saw a thread related to this fairly recently, and the outcome was that it's an engine limitation. If so, feel free to merge this with that thread.

However, just in case this isn't the exact same issue; whenever I kill or capture a flagship, the entire fleet goes neutral regardless of nation. This happens all the time with every battle, so I've had to enter the habit of not touching the flagship. I've lost so many relation points from firing on these suddenly neutral ships I've lost count. Is this the same issue as was addressed previously?

Sorry again if this is the same issue but thought it best to bring it up just to be sure. I'll post logs up if this is indeed new.
 
Same issue, yes. Quite annoying and I have no clue why it happens.

I tried to fix it and that partly works; if you Save At Sea, then load that Save, relations between those ships are corrected again.
 
Flagships certainly can surrender. There's a long-standing problem in which, when the flagship surrenders, the rest of the fleet turns neutral - they haven't surrendered, they're just not hostile any more. If you save and then reload game, they revert to being properly hostile. (Except for any which really have surrendered, that is.)

Opening a bug report for this one because after staring at the AI stuff so much this weekend I have some ideas on what might cause it, and will try to fix it soon.
 
I might fail, but I have a couple of suspicions. I looked at the past posts there and didn't see what I was suspecting.

The first suspicion is that this part goes wrong:

Code:
  bool cmdrchange = cmdridx == chridx;
   bool firstchar = Group_GetCharacterIndexR(rOGroup, 0) == chridx;
   int og_ships = Group_GetCharactersNumR(rOGroup);

   int oldrel = -1;
   if (sti(cmdr.index) > 0) oldrel = SeaAI_GetRelation(cmdridx, pchridx); // TIH moved here so we can check relation with group commander Sep3'06
   traceif("SURR: SeaAI_GetRelation cmdr relation: " + oldrel);

   // TIH --> dont do this if already had surrendered Nov5'06
   if (!bAlreadySurrendered) {
     if (cmdrchange) {
       //Trace("SURR: fleet commander change, numships in group: " + og_ships);
       if (og_ships >= 2) {
         cmdridx = Group_GetCharacterIndexR(rOGroup, firstchar);
         cmdr = GetCharacter(cmdridx);
         Group_SetGroupCommander(ogroup, cmdr.id);
         DeleteAttribute(cmdr,"relation.UseOtherCharacter");
         traceif("SURR: commander changed to " + cmdr.id);
       } else {
         Group_DeleteGroup(ogroup); // KK
         traceif("SURR: no other ships to change commander to");
       }
     }
   }

That is supposed to give the group a new commander. It that broke and didn't assign a new group commander, then maybe this sort of weirdness could result, since that guy would be moved to be commander of the surrender group in a second.

Generally the way the bug is described, I think the other ships are getting transfered to the surrender group, or some halfway point where their command is in the surrender group so they get his relations, but of course being in the surrendered group doesn't mean they surrender, it just means they go neutral. Or maybe there just don't get a commander at all so things go weird.

What I really need is a compile log from after this occurs. Even with the current version that compile log would help some since there are a couple of traces, but for future versions of my changes I'll probably add several new traces and enable some others here and elsewhere, to find what is going wrong.
 
Last edited:
EDIT: Nevermind, made a mistake with the trace, will look some more tomorrow
 
Last edited:
Hmm, the group commander is properly changed--I could see they had a new flagship. Now I wonder if it is the new group commander's relations not getting set to hostile.

Perhaps when DeleteAttribute(cmdr,"relation.UseOtherCharacter"); is done for the new group commander, his relations aren't initialized properly.


Thinking about trying this plan:

Right at the end of this where the commander change occurs (or later at the end of the surrender function if needed):

if (og_ships >= 2) {
cmdridx = Group_GetCharacterIndexR(rOGroup, firstchar);
cmdr = GetCharacter(cmdridx);
Group_SetGroupCommander(ogroup, cmdr.id);
DeleteAttribute(cmdr,"relation.UseOtherCharacter");
traceif("SURR: commander changed to " + cmdr.id);

Either:

1) do some version of this

if (oldrel == RELATION_ENEMY) {
int newcmdr.index = Group_GetGroupCommanderIndex(
rOGroup);
SetCharacterRelationBoth(pchridx, sti(newcmdr.index), RELATION_ENEMY);}

question: Does anything seem obviously wrong with the way I wrote that at first glance? Or any problem with doing that?

EDIT: I guess to cover all the cases where player allied fleets are present it would have to cycle through all nearby ships and set the new commanders relations to the old commanders prior ones, after DeleteAttribute(cmdr,"relation.UseOtherCharacter"); is executed.

OR

2) go find whatever is done when saved games are loaded or scenes are loaded to initialize relations, or maybe the code used when flags change, and run that at the end of the above block of commander change code.

Question: Any problem stand out, or any recomendstions, in doing it that way?
 
Last edited:
I'm pretty sure "relation use other character" does nothing.
Not after I rewrote the entire Sea Relations System over a year ago.
In fact, I think that is what convinced those AI ships to at least get correct relations after reloading a save.
 
@Pieter Boelen Well, as you expected, I had no luck trying to fix this.

I tried:

A) reinitilizing relations in various ways

B) find the surrendered ship or the new group commander's "last ball character", set their task to attack him, and set their relations to him to enemy

C) reaarange surrender code order, so that the surrendering and change to neutral happens only after the commander change is completed


None of that worked of course.


Here's one interesting things I discovered (just as a note for posterity, I'm giving up on this one): it is not just that loading a save eliminates the bug after it has occured, it also seems to prevent the bug from occuring if a save is loaded prior to hostilities but in the presence of the ships.

Ie, I made a save sailing right next to an allied player fleet flagship, intending to test the bug each time by loading the save, raising a pirate flag, and then consoling his surrender.

Much to my surprise, that save won't generate the bug at all. And it isn't an allied fleet issue specifically--allied fleets made hostile by raising a pirate flag generally do give the bug, they just don't if a save was loaded while they were already in the scene.


So whatever happens on loading a save doesn't just refresh relations to be correct, it sets something up different than when encounters are initially generated that prevents the bug from even occuring (at least some of the time).
 
Back
Top