Page MenuHomeFeedback Tracker

Editor placed vehicle continues to be detected as enemy after all crew disembarks
New, WishlistPublic

Description

If enemy vehicle placed in editor and player knows about it, even if crew disembarks and vehicle is now empty, it is still detected as enemy for a long time, which can be checked with findNearestEnemy command.

However is vehicle is created on the fly and populated with enemy crew, as soon as crew disembarks, empty vehicle is removed from enemy targets almost immediately (correct functionality)

Details

Legacy ID
4007348668
Severity
None
Resolution
Open
Reproducibility
Always
Category
AI Spotting / Detection
Steps To Reproduce
  1. Place OPFOR tank in front of the BLUFOR player in editor. I used BTR-K Kamysh
  2. Name it "tank".
  3. Run this code from debug console:
  • spawn {

tank setDir direction player;
tank setVehiclePosition [player modeltoworld [0,30,0], [], 0, "none"];
player reveal [tank, 4];
onEachFrame {

		hintsilent format [
			"Nearest enemy: %1\nCrew tank: %2", 
			player findNearestEnemy player, 
			count crew tank
		];

};
sleep 5;
{

		moveout _x; 
		_x setVehiclePosition [player modeltoworld [50,100,0], [], 0, "none"];

} foreach crew tank;
};

The hint will show you that "tank" is detected and is nearest enemy and the crew of the tank is 3
After 5 seconds the crew will be moved out to some 100m away from you and tank, but "tank", while
empty, is still nearest enemy and continues to be one for a long time.

  1. Now clear mission and run this code to do exactly the same only with script:
  • spawn {

tank = "O_APC_Tracked_02_cannon_F" createVehicle [0,0,0];
createVehicleCrew tank;
tank setVehicleVarName "tank";
tank setDir direction player;
tank setVehiclePosition [player modeltoworld [0,30,0], [], 0, "none"];
player reveal [tank, 4];
onEachFrame {

		hintsilent format [
			"Nearest enemy: %1\nCrew tank: %2", 
			player findNearestEnemy player, 
			count crew tank
		];

};
sleep 5;
{

		moveout _x; 
		_x setVehiclePosition [player modeltoworld [50,100,0], [], 0, "none"];

} foreach crew tank;
};

As soon as crew disembarks, tank is removed from nearest enemy and after a while, if you point
to disembarked crew, one of the crew becomes nearest enemy.

Event Timeline

Killzone_Kid set Category to AI Spotting / Detection.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 4007348668.May 8 2016, 12:48 PM
F2kSel added a subscriber: F2kSel.May 8 2016, 12:48 PM

I believe the reason for the delay is that it should be seen as a viable target while the group alive and could get back in.

One reason the second may not be seen as a threat is that the vehicle wasn't added to the group.

group tank addVehicle Tank;

This may now produce same results as first script all though you don't really say which is your preferred result.

Ah, interesting, this might be it, as if I use leaveVehicle in addition to moving out crew, it gets removed from enemy list straight away.

Of course the problem is still with editor placed disabled vehicle, when it is not dead but cannot be used by the crew, it is still a target.

The problem is what behavior you intend to give at this command.
As written now, you can catch nearest enemies even if distant for several kilometers if your side has a knowAbout on it.
So, there are 2 ways thinking about this command should work:

  • this command must return the nearest existing enemies, for scripted scenarii. Then , you should consider allUnits with a non-friend side, excluding all emptied (civilian) vehicles;
  • If you'd rather want a more immersive information (player oriented), it's OK for the delay, but some distances should be taken into account. It's abnormal to have a return on an emptied vehicle at more than one kilometer and no info on infantry in vicinity.