• 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 Quest Soldiers Attacking Other Quest Soldiers from Same Nation

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
Go into Barbados Canyon and fight one of the groups of bandits. Previously the other groups would stay put until you got closer to them, or perhaps one particularly near group would join in. Now the whole lot charges you at once. I can survive that as I have Melee 10, gold armour and a good sword, and so do my three shore party officers. Less well endowed characters might not do so well...

Something similar happens on the coastal path between Puerto Rico beach and the town outskirts, though not in the beach/bridge area itself.
 
It could be that the AI relations could have gotten messed up as per this thread:
Confirmed Bug - Unintentional Fights or Lack Thereof (aka. AI Group Relations) | PiratesAhoy!
That is still a very real bug that has been with us for many, many years and, I fear, will be a tremendous pain to properly fix.

To be sure, could you start a random new game and try to replicate this?
If it doesn't happen on a new game (where those relations must logically still be OK), then that proves it is indeed that problem again.

If it happens on a new game too, then something else is going on.
Do you get any "reinforcements" messages on the screen by any chance?
In theory, that could do that as well. But I don't think it should be triggered in your example.
 
@Grey Roger, could you do the test I mentioned in my above post?
At least that should either confirm or deny my suspicion on this one.
 
Yes, I tried starting a free-play game as an English swordmaster (starts you off in Speightstown, from where it's a quick easy sail round to Bridgetown, with good weapon, armour and Melee skill, so you have the best chance of taking on the bandits). This was under the 20th July version. The bandits behaved as they're supposed to. There are two groups of three, close together, and when you attack one of those bandits then all six charge you, but that's normal. Meanwhile the next group of three further along the path stayed where they were. So your theory appears to be correct.
 
Thanks for checking!

Indeed this seems to be a real problem and I think @Hotshot was affected by it at some point as well.
For some reason I think in his game, the "French soldiers" were hostile to the "characters who have no group", which caused quite a bit of weirdness.
If ever I find the courage, I should look into it as it is quite a nasty issue. Probably not going to be simple and another complete rewrite may be required.... :(
 
I had an even weirder example when I was working through "Assassin". This was late in the story, when you've befriended Bartolomeu, then gone your separate ways for a while. You've gone to Kralendijk to make peace with the Dutch, then your old ship El Diablo has been sighted approaching Bonaire, so you are given a squad of Dutch soldiers to take on its crew at one of the beaches. The fight is in two parts - you fight a group of crew on the beach, then a second group appears while a second group of soldiers fights some more crew at another part of that location. Sometimes the two squads of Dutch soldiers then fought each other. And if I had officers with me, when I went from the beach to the jungle, my officers attacked me!

But if the one about all the bandits in the canyon or on the Puerto Rico path only happens after a while then that, at least, isn't such a concern. Early in the game, you may not survive such a charge. Later on, when you and your officers have good skills, good weapons and good armour, you can probably handle it.
 
Sometimes the two squads of Dutch soldiers then fought each other.
Do you know how they are generated? If they're generated using the "Ambush" and related functions, they should now all be forced into the same AI groups.
But if they're generated in a way that bypasses that, then the "add soldiers to group" code needs to be there too.
If it isn't, then that could indeed happen.

But if the one about all the bandits in the canyon or on the Puerto Rico path only happens after a while then that, at least, isn't such a concern. Early in the game, you may not survive such a charge. Later on, when you and your officers have good skills, good weapons and good armour, you can probably handle it.
Indeed that example isn't too bad. My main concern is that if that happens, it indicates that certain AI groups became hostile to each other that aren't meant to be.
So while that symptom isn't much to worry about, the same issue could mess up quests later on as well.

But we've had this issue since Build 13, I think, and it only crops up as a true problem once in a blue Monday.
So thankfully it isn't as bad as it could be.
 
Do you know how they are generated? If they're generated using the "Ambush" and related functions, they should now all be forced into the same AI groups.
But if they're generated in a way that bypasses that, then the "add soldiers to group" code needs to be there too.
If it isn't, then that could indeed happen.
The first two soldiers who accompany you to the beach are pre-defined in "PROGRAM\Storyline\Assassin\characters\init\TempQuest.c", where they are assigned to group "DUTCH_SOLDIERS". As far as I can make out, this is what happens:
case "batalha_praiabis": "SoldatD1" and "SoldatD2" are placed on the beach. Dialog with "SoldatD2" triggers case "batalha_praiabis2".

case "batalha_praiabis2": "SoldatD1" and "SoldatD2" are set to "officertype". Four pirates are spawned by 'LAi_CreateFantomCharacter' and assigned to group "SOLDIER_CHICO". Battle is declared between "SOLDIER_CHICO" and "LAI_GROUP_PLAYER", and the end of the battle triggers case "nouv_vague".

case "nouv_vague": "SoldatD1" and "SoldatD2" are again set to "officertype". Four more pirates are spawned by 'LAi_CreateFantomCharacter' and assigned to group "SOLDIER_CHICO_2". Four Dutch soldiers are also spawned and assigned to group "SOLDIER_GOVERNOR". (Remember, "SoldatD1" and "SoldatD2" are in group "DUTCH_SOLDIERS", though setting them to "officertype" may have overridden that, otherwise why would they join in the fight between "SOLDIER_CHICO" and "LAI_GROUP_PLAYER" earlier?) Berend de Voor, an officer with whom you have had previous dealings and who is also defined in "TempQuest.c", is placed in the area with the new soldiers and also assigned to group "SOLDIER_GOVERNOR". And PChar, i.e. you, also goes to group "SOLDIER_GOVERNOR"! Battle is declared between "SOLDIER_CHICO_2" and "SOLDIER_GOVERNOR". The end of the battle triggers case "fimdabatalha".

case "fimdabatalha": Ship "Diablo" is placed by the shore. Dialog with Berend de Voor triggers case "Diablo_Douwesen".

I don't see anything which takes PChar out of group "SOLDIER_GOVERNOR". And I'm not sure why one group of soldiers are in group "DUTCH_SOLDIERS" while the others are in "SOLDIER_GOVERNOR". They should all be fighting enemy group "SOLDIER_CHICO_2" at case "nouv_vague". But I wonder if putting the entire second group of soldiers plus Berend de Voor into "LAI_GROUP_PLAYER", then having the second battle between "SOLDIER_CHICO_2" and "LAI_GROUP_PLAYER", might solve the problem.

What it won't solve is the problem that I'm currently dividing attention between "Tales of a Sea Hawk" and "Ardent", and don't have time to play through "Assassin" again to test this! :D
 
Ah, that sounds like some definite AI group confusion.
I think I mentioned it before, but I strongly recommend to use existing AI groups as much as possible.
So if you're generating Dutch Soldiers, it is best to add them to the "DUTCH_SOLDIERS" group and not create a different group for every quest case.
That has definitely been done for a lot of quest coding, but it could have unintended side-effects like what you noticed.

This recommendation is especially interesting for @Jack Rackham and @Bartolomeu o Portugues as well.
 
Special AI groups should only be used if you know for sure which AI groups are in the scene (area) and you need to set up all realtion between them when you generate them.
Else it always best to use the default AI groups.

The largest problem we still have is the fact that town fantoms and random characters are generated in other AI groups at the moment. We still need something which adds these characters to the right AI groups for the scene which you are in. I believe we did discuss about this but never finished it.
 
The largest problem we still have is the fact that town fantoms and random characters are generated in other AI groups at the moment. We still need something which adds these characters to the right AI groups for the scene which you are in. I believe we did discuss about this but never finished it.
Random town folk should already be put in their appropriate Citizens groups.

It gets confusing when you add the characters who are in NO group at all (e.g. group "").
 
If you have a problem somewhere please provide a dump of
"LAi_grp_relations".
I believe that should give an overview of how the groups are set up.
Mind you it can be quite large (which is a problem at the moment).
I can't test at the moment, but maybe @Grey Roger can post a dump of that object in the situation where the problem occurs (its a global object so you should be able to dump it intantly. Maybe you want to use an & in front, but I don't believe it's needed).

And if you can please tell what is happening and what you expect to be happening (copy of your earlier post should be fine). Then I should be able to figure out where it's going wrong by looking at the dump.
 
Mind you it can be quite large (which is a problem at the moment).
Indeed! I noticed that too last time I checked and that is indeed where my recommendation of "don't use new non-existent groups unless you REALLY need to" originally came from.

I can't test at the moment, but maybe @Grey Roger can post a dump of that object in the situation where the problem occurs (its a global object so you should be able to dump it intantly. Maybe you want to use an & in front, but I don't believe it's needed).
To clarify on that, to do that, use this line of code:
Code:
DumpAttributes(LAi_grp_relations);
 
To be more exact, in my "Tales of a Sea Hawk" game running on the 18th June version, there are four groups of bandits in the canyon. Just round the corner from the Bridgetown exit are two groups of three; these always join together, presumably because they are so close to each other, so if you attack a bandit in one of them, even at range with a gun, all six will respond. This has always been the case as far as I remember. Further along, nearer to the mine, is another group of three hiding behind a rock; this group is normally separate but now is linked to the first two groups, so attacking any one of these bandits will result in all nine charging you. Past the mine entrance is a group of two which are still separate - attacking any of the groups of three does not provoke them, and attacking them does not provoke the groups of three.

On this occasion I entered the canyon from the lighthouse end, so encountered the group of two first. Here's the "compile.log" which resulted. I activated console three times - once just as battle was about to start with the group of two, once just after I'd provoked the groups of three, and once when the whole battle was over.

The file says "Build 14 Beta 4.1 WIP: 20 July 2016". That's because I'd imported "globals.c" from the 20th July version and then changed "PERSONALFLAGS_TEXTURES_QUANTITY" to 7 as a test of the 7th row of Personal flags including the Brandenburg flag. The "Tales of a Sea Hawk" savegames didn't like that so I changed it back to 6, so what I have is actually the 18th June install with the 20th July "globals.c".
 

Attachments

  • compile.log
    1.7 MB · Views: 120
Back
Top