• 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 Unintentional Fights or Lack Thereof (aka. AI Group Relations)

What kind of behaviour would you like to see from the town guards?

  • It is fine as-is. They don't bother me and I don't bother them!

    Votes: 0 0.0%
  • Same as above, but I should be able to bribe them so they turn a blind eye

    Votes: 0 0.0%
  • Other, please specify below

    Votes: 0 0.0%

  • Total voters
    10
Quick test with the new muskets.... Guards hacking into me, accidentally hit one of the town folk.
Next thing I know, I hear banging sounds from elsewhere in town, because a amazing brawl has broken out between all the soldiers and citizens of the town.
Still funny, but still not intentional.... :wp
Police brutality triggers a riot. Not entirely unrealistic!
 
One thing I noticed today is that Town Fantoms are added to the MONSTER relation group instead of a citizens relation group. So when town guards attack you they also attack monsters. I think this is because monsters become hostile toward you (which sounds logical) once you start fighting. And the town guards then become hostile towards them.
I don't know for sure but I think this is one of the reasons things are getting messed up.
 
Maybe. Town guards don't get automatically hostile to hostile town folk though.
Only if one of either group accidentally hits one of the other.
But I reckon the two groups should be linked. They were in the stock game and early Builds.
 
I think I've found where the code to have citizens be helped is located:
Code:
if(SetHostile) // if we are setting enemy hostile to us (and haven't yet)
    {
        if(!LAi_IsDead(enemy)) { LAi_group_Attack(attack, enemy); } // if not dead, alarm!
        else // otherwise...
        {
            // for now, just behave like normal. When I have a chance, I'll check near characters vs. see/hear radius.
            //int num = FindNearCharacters(enemy, float rad, float ax, float testAng, float nearDist, bool isVisibleTest, bool isSort)
            LAi_group_Attack(attack, enemy);
        }
    }
from LAi_events
I guess this has been rewritten or so and never finished.
 
Since we're playing around a bit with AI group relations again, I thought I'd bring this up once more.

After my changes from today, I confirmed that the "random citizens" do end up in the same group as the "fixed citizens".
So if I kill a fixed one, the random ones start to attack me.

But the town guards still do not care. Which is still wrong, because they ARE meant to:
Code:
   LAi_group_SetAlarmReaction("DOUWESEN_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY, LAI_GROUP_FRIEND);
   LAi_group_SetRelation("DOUWESEN_CITIZENS", "DOUWESEN_SOLDIERS", LAI_GROUP_FRIEND);
   LAi_group_SetRelation("DOUWESEN_SOLDIERS", "DOUWESEN_SOLDIERS", LAI_GROUP_FRIEND);
   LAi_group_SetRelation("DOUWESEN_SOLDIERS", LAI_DEFAULT_GROUP, LAI_GROUP_FRIEND);
   LAi_group_SetLookRadius("DOUWESEN_SOLDIERS", LAI_GROUP_GRD_LOOK);
   LAi_group_SetHearRadius("DOUWESEN_SOLDIERS", LAI_GROUP_GRD_HEAR);
   LAi_group_SetSayRadius("DOUWESEN_SOLDIERS", LAI_GROUP_GRD_SAY);
   LAi_group_SetAlarmReaction("DOUWESEN_SOLDIERS", "DOUWESEN_CITIZENS", LAI_GROUP_FRIEND, LAI_GROUP_FRIEND);
   LAi_group_SetPriority("DOUWESEN_CITIZENS", LAI_GROUP_PCITIZENS);
   LAi_group_SetPriority("DOUWESEN_SOLDIERS", LAI_GROUP_PGUARDS);

So the problem remains.
 
After this weekend, I know at least a tad bit more about this system:

- The content of the "LAI_GROUP_NEUTRAL" define MUST be "neitral" and not "neutral".
Probably that is related to some sort of internal game engine stuff that we cannot see, but it makes a TERRIBLE difference.

- The "AI group relations" are reset for the player on EVERY location, apparently on purpose.
This is the reason why normally if you get into a fight with guards in one location, reloading to the next location makes them calm down again.

I am not convinced we should want that. Doesn't make sense to me to have them just forget every single time.
Rather, should there not be a soldier and citizen group PER TOWN, rather than PER NATION?
So you might upset one town, but not ALL towns of that nation? And then there should be a reasonable "reset" functionality to go with that.

But the "link between soldier and citizen groups" is still completely broken and has been now for many, many years.
There is little point in updating anything with this until THAT is sorted out again, because who knows what other evils lurk in the way this code behaves?

For the time being, hopefully I managed to set things back to normal now.
Let's NOT touch it for a while..... :shock
 
Just setting the neutral in LAi_Defines back to neutral fixes most of it indeed. Had some problems with it today also
 
NEITRAL, yes. That indeed does make quite a difference.
the LAI_GROUP_NEUTRAL is send to engine calls. So by making the value of it "neutral" instead of "neitral" the game didn't recognised it and went to it's default values which seemed to be enemy ....
So the name for the variable can still be LAI_GROUP_NEUTRAL but the value has to be neitral as it's hardcoded in the engine itself.
 
the LAI_GROUP_NEUTRAL is send to engine calls. So by making the value of it "neutral" instead of "neitral" the game didn't recognised it and went to it's default values which seemed to be enemy ....
So the name for the variable can still be LAI_GROUP_NEUTRAL but the value has to be neitral as it's hardcoded in the engine itself.
That's what I figured as well.
 
Can someone explain what just happened? I landed at San Juan and was walking to the gate when someone drew a sword and attacked us. I ran away to get some space, turned and started fighting the guy who attacked me. My officer was fighting someone else. Then all hell broke loose and we died.
POTC4 2016-01-24 10-08-29-68.jpg
 

Attachments

  • compile.log
    158.5 KB · Views: 199
  • system.log
    1.1 KB · Views: 208
You or your officer must have killed an item trader.
Could also be an Enc_Walker which is doing itemtrading right?
Maybe we do want to remove that again due to the weird group relations...
 
It wasn't me as I killed no one. I just replayed it and walked well away from anyone until we were attacked by just one person. That was the end of any drama as nothing happened after we killed him.
 
@Levis: Yes, that could happen too.
But that shouldn't be much of a problem.
Never was before.
they are probably in the same AIgroup as other enc_walker, so if one attacks you now because he spots you as a traitor or so then all will be aggresive right? so also the merchant. And then he will get help again...
 
That could happen.
But only if you're marked as a pirate which is supposed to be tough.
 
I can confirm a problem here.
I was spotted as a traitor by a random guard in the tavern in Greenford. Now every time I enter the tavern and there is a guard there he starts attacking me instantly but all other guards in greenford don't.
 
Back
Top