police turn hostile because AI ships fail to maintan distance

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

flywlyx
Posts: 1534
Joined: Sat, 15. May 21, 03:45
x4

police turn hostile because AI ships fail to maintan distance

Post by flywlyx »

Today I had a rep drop notice from a TER police, I check the log and it is caused by a Donia scanned by the police.
But the Donia doesn't have any inventory items and the cargo is empty.
So I checked the code and noticed that the following code might cause the problem even if I set comply in the global response:

Code: Select all

              
              <check_all>
                          <event_object_changed_zone object="$localtarget"/>
                          <check_any>
                            <check_all>
                              <check_value value="$police"/>
                              <!-- NB: changing the distance check to cansee could prove frustrating to the player since contact could be broken by our movement even if target is standing still. -->
                              <check_value value="this.ship.distanceto.{$localtarget} gt this.ship.maxradarrange"/>
                              <!--<check_value value="this.ship.distanceto.{$localtarget} gt $effectivescanningrange"/>-->
                            </check_all>
                            <check_value value="event.param.isclass.highway"/>
                          </check_any>
             </check_all>
Since the Donia is a fast ship, when I checked it, it was 200km away from the police, I think this is the reason behind this incident.
I recommend incorporating an additional condition to check if a ship is owned by the player but not currently occupied by the player. If the global response is set to comply, this event should return false.
Imperial Good
Moderator (English)
Moderator (English)
Posts: 4932
Joined: Fri, 21. Dec 18, 18:23
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by Imperial Good »

This might have become an issue due to the recent low attention mechanic changes adding additional breaking distance and other inertial physics that before were not simulated. The Donia is a very fast, very heavy, L ship, so probably has a terrible breaking distance once at travel speed.

The police should probably either ignore ships in travel mode, or have a multi-phase scan approach to them where they first order them to stop, then fly to them to accommodate for breaking distance, then scan them. Non-compliance is only triggered should the ship refuse to stop at the first stage, or the implicit wait for signal order is discarded in second and third stages.

I personally have not experienced this but I used almost exclusively TER L ships in my playthrough. These have rather low maximum speeds so likely have sufficient breaking distance to count as complying. Similar likely applies to a lot of L ships, with only the really fast or heavy ones having the potential to run into this issue.
rudi_pioneer
XWiki Moderator
XWiki Moderator
Posts: 554
Joined: Fri, 2. Apr 21, 21:06
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by rudi_pioneer »

j.harshaw
EGOSOFT
EGOSOFT
Posts: 2164
Joined: Mon, 23. Nov 15, 18:02

Re: police turn hostile because AI ships fail to maintan distance

Post by j.harshaw »

@flywlyx plausible. i'll try to repro locally and address, but be aware that this cannot be prioritized until we have a repro or have confirmed that the posited cause is more than a theory.

@rudi_pioneer yes, we're aware that people have mentioned the symptom happening. That, or knowledge that you have a mod that has police completely ignore player-owned objects, neither affects prioritization nor increases the chances that the actual issue will be found or fixed.
rudi_pioneer
XWiki Moderator
XWiki Moderator
Posts: 554
Joined: Fri, 2. Apr 21, 21:06
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by rudi_pioneer »

I appreciate this, we weren’t sure if issue was heard. Usually ticket number indicates that, and I haven’t seen one for posts we have about this
j.harshaw
EGOSOFT
EGOSOFT
Posts: 2164
Joined: Mon, 23. Nov 15, 18:02

Re: police turn hostile because AI ships fail to maintan distance

Post by j.harshaw »

Tried to detect this today while working on a couple other things. Only instance it caught was a smuggler who was correctly avoiding inspection, not looking good for the theory.
User avatar
PilotsBallad
Posts: 237
Joined: Thu, 18. Dec 14, 20:51
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by PilotsBallad »

This sounds like an issue I have encountered a few weeks ago and was wondering how it had happened.

I'm currently running five modded Prometheus transporters (Advanced AutoTrade) as well as seven modded Pegasus scouts (Revisit Known Stations).
All of them have the purple drag/mass hull mod as well as the Nudger mod for more forward thrust. They're all very fast even outside of travel mode.

Some time after letting them loose in Godrealm space, I noticed that they occasionally triggered police aggression for seemingly no reason.
They don't trade or pick up illegal cargo, and their inventory is empty. They're of course set to comply.

Really not sure what triggers this if it isn't caused by this theory.
flywlyx
Posts: 1534
Joined: Sat, 15. May 21, 03:45
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by flywlyx »

j.harshaw wrote: Fri, 26. Jan 24, 18:06 Tried to detect this today while working on a couple other things. Only instance it caught was a smuggler who was correctly avoiding inspection, not looking good for the theory.
All of my traders are exceptional modified. What exactly are your test cases? A sensible test would involve 100 exceptional modified Astrids conducting trades across various locations.

To be honest, I don't see the point of enforcing scan range on AI pilots; evading the police is purely a player-only action.
Nanook
Moderator (English)
Moderator (English)
Posts: 28245
Joined: Thu, 15. May 03, 20:57
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by Nanook »

flywlyx wrote: Tue, 30. Jan 24, 01:58...
To be honest, I don't see the point of enforcing scan range on AI pilots; evading the police is purely a player-only action.
Uh, no. There are global and individual ship orders for your AI ships when interdicted by police. They include Comply, Attack, Escape and Wait. I would consider Attack and Escape to be "evading the police," wouldn't you?
Have a great idea for the current or a future game? You can post it in the [L3+] Ideas forum.

X4 is a journey, not a destination. Have fun on your travels.
LameFox
Posts: 3613
Joined: Tue, 22. Oct 13, 15:26
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by LameFox »

Nanook wrote: Tue, 30. Jan 24, 03:05
flywlyx wrote: Tue, 30. Jan 24, 01:58...
To be honest, I don't see the point of enforcing scan range on AI pilots; evading the police is purely a player-only action.
Uh, no. There are global and individual ship orders for your AI ships when interdicted by police. They include Comply, Attack, Escape and Wait. I would consider Attack and Escape to be "evading the police," wouldn't you?
To be fair there is in principle some difference since the game does not know what a player is doing; it must give us some grace period to make a choice and in that time we can elect not to offer any response and just make a run for it. So in that case the distance is relevant as a way to help it determine what we are doing. On the other hand if your AI ship is set to escape that information must be available to the game already.

If it's set to attack, well, I guess initiating aggro at some distance is redundant.
***modified***
flywlyx
Posts: 1534
Joined: Sat, 15. May 21, 03:45
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by flywlyx »

Nanook wrote: Tue, 30. Jan 24, 03:05 Uh, no. There are global and individual ship orders for your AI ships when interdicted by police. They include Comply, Attack, Escape and Wait. I would consider Attack and Escape to be "evading the police," wouldn't you?
The system doesn't require distance information to recognize that players have set AI ships to attack or escape. Verifying it is redundant and introduces nothing but bugs to the system.
Nanook
Moderator (English)
Moderator (English)
Posts: 28245
Joined: Thu, 15. May 03, 20:57
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by Nanook »

I think you both are making an unwarranted assumption that every police ship in the game instantly knows what every player ship is doing. I don't think it's that simplistic, and I'd be very disappointed if it were. The game knowing and individual police ships knowing are two different things, AFAIK. And I think the occasional aggro mistake made by the cops adds a bit of realism and variability to the game. What you seem to be asking for is a simple cause and effect mechanism, which isn't how Real Life works. The more unknowns and randomness the game adds, the better I say.
Have a great idea for the current or a future game? You can post it in the [L3+] Ideas forum.

X4 is a journey, not a destination. Have fun on your travels.
LameFox
Posts: 3613
Joined: Tue, 22. Oct 13, 15:26
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by LameFox »

If they don't know then they could at least check. If the ship is actually running then they can go hostile, if not then just follow it and scan. Think of it as the police ship using some common sense to see if the ship it pulled over is braking or thrusting away.
***modified***
j.harshaw
EGOSOFT
EGOSOFT
Posts: 2164
Joined: Mon, 23. Nov 15, 18:02

Re: police turn hostile because AI ships fail to maintan distance

Post by j.harshaw »

Lots of false assumptions leading to pontificating going on here. This isn't a discussion board, it's a working space. Please refrain from further comment unless it contributes to the issue reported.
flywlyx
Posts: 1534
Joined: Sat, 15. May 21, 03:45
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by flywlyx »

j.harshaw wrote: Fri, 26. Jan 24, 00:36 @flywlyx plausible. i'll try to repro locally and address, but be aware that this cannot be prioritized until we have a repro or have confirmed that the posited cause is more than a theory.
https://i.imgur.com/o2hyYvB.png
https://i.imgur.com/roi2vxw.png
https://i.imgur.com/h6v7zXD.png

As soon as the incident occurred, I paused the game. The ship JDH-552, which is not carrying any inventory and has just exited AB, and the police VLT-286, has turned hostile.
It's evident that the 1-second delay

Code: Select all

<wait exact="[$time_scandone - player.age, 1s].max">
is insufficient for faster ships or those with high-level pilots, particularly when they are at the jump gate.
Killin_Kilo
Posts: 10
Joined: Mon, 10. Dec 18, 21:54
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by Killin_Kilo »

Sorry to resurrect the thread but this is pretty consistently happening to me as well. So far it has only happened while running in SETA but same as the others. I have large ships with no illegal inventory (no inventory at all) getting stopped by TER police and occasionally the illegal cargo message throws with absolutely no cargo. I've gotten real quick at hitting F9 because it seems entirely random and will not occur with the same police ship and my ship pairing on reload (which makes it impossible to repro on demand). I can have SETA running for around 30 minutes before the behavior triggers. Very odd.
CBJ
EGOSOFT
EGOSOFT
Posts: 54162
Joined: Tue, 29. Apr 03, 00:56
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by CBJ »

As per the previous posts from developers, we will need more information and most likely an unmodified savegame in which the problem can reasonably reliably be reproduced in order to investigate it further.
rudi_pioneer
XWiki Moderator
XWiki Moderator
Posts: 554
Joined: Fri, 2. Apr 21, 21:06
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by rudi_pioneer »

CBJ wrote: Tue, 30. Jul 24, 19:18 As per the previous posts from developers, we will need more information and most likely an unmodified savegame in which the problem can reasonably reliably be reproduced in order to investigate it further.
I feel enough of us are hitting this game breaking issue that we could use some help: any additional debug log lines we can add to help troubleshoot this? Any additional checks in police scan code? Etc
Killin_Kilo
Posts: 10
Joined: Mon, 10. Dec 18, 21:54
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by Killin_Kilo »

CBJ wrote: Tue, 30. Jul 24, 19:18 As per the previous posts from developers, we will need more information and most likely an unmodified savegame in which the problem can reasonably reliably be reproduced in order to investigate it further.
The larger my empire grows the more often it happens so I'll muscle on for a while and hand you my save when once its happening closer to every 5-10 min :). I promise we all aren't crazy!
CBJ
EGOSOFT
EGOSOFT
Posts: 54162
Joined: Tue, 29. Apr 03, 00:56
x4

Re: police turn hostile because AI ships fail to maintan distance

Post by CBJ »

Nobody is suggesting you are. But if we can't see it, it's almost impossible for us to diagnose what's happening. That's why we need a savegame.

Return to “X4: Foundations - Technical Support”