Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAF Attack: despawn and Heli movemet issues #281

Open
deimerl opened this issue Feb 25, 2018 · 15 comments
Open

AAF Attack: despawn and Heli movemet issues #281

deimerl opened this issue Feb 25, 2018 · 15 comments
Labels

Comments

@deimerl
Copy link

deimerl commented Feb 25, 2018

At least with RHS on, enemy attack helicopters will take off and fly to their objective but return to the airbase and hover their for the rest of the attack after flying about 10% of the way.

@StefArma
Copy link
Member

Yes confirmed

@StefArma StefArma added the bug label Feb 25, 2018
@deimerl
Copy link
Author

deimerl commented Feb 26, 2018

I'll also add there's sometimes waypoint issue with the land vehicles as well.

@StefArma
Copy link
Member

I caused the problem here i think

https://github.com/A3Antistasi/antistasiofficial/blob/master/AntistasiOfficial.Altis/Functions/fn_QRF_RTB.sqf#L20

i'm trying to spawn AS_fnc_despawnUnits on them, so they will check if there are blufor within 1 km, if not, they despawn

@Barbolani77
Copy link

Barbolani77 commented Feb 26, 2018

Stef,

As I dont know how to comment code lines I write you here.

If I understand well you just want to add a a waypoint to the group so they RTB.

The code is very wrong:

  • You are adding a waypoint to the group on a loop. Good point of waypoints is you only have to do it once.

  • So every 5 seconds you are adding a waypoint and the group may finish with hundereds of useless waypoints.

  • Same with the autocombat thing, you only have to do it once.

  • They will allways start some pathfinding procedures on the waypoint on each loop.

  • You are adding it as first waypoint and no other waypoints are being deleted.

  • You are missing a very useful command which is setWaypointStatements on which you may add whatever desired effect when the waypoint is reached.

  • But: A waypoint can be considered as reached just because the group leader has reached it, but maybe the rest of the group are stuck somewhere else in front of the player so they will despawn.

My suggestion, something like this:

params ["_vehGroup", "_dest"];

if !(typeName _vehGroup == "GROUP") exitWith {"Error in QRF_RTB: not a group"};

{_x disableAI "AUTOCOMBAT"} forEach units _vehGroup;
{deleteWaypoint _x} forEach waypoints _vehGroup;

_wp700 = _vehGroup addWaypoint [_dest, 0];
_wp700 setWaypointSpeed "FULL";
_wp700 setWaypointBehaviour "CARELESS";
_wp700 setWaypointCombatMode "GREEN";
_vehGroup setCurrentWaypoint _wp700;

so from here, a loop to check if there is any player near for deleting the units, like;

while {{alive _x} count units _vehGroup >0} do
{
{
if (blablá I check if there is some player nearby or whatever condition you want to give) then {deleteVehicle _x}
} forEach units _vehGroup;
sleep 10
};
deleteGroup _vehGroup;

or use whatever function you have in Altis for despawning. Don't forget the vehicle.

@StefArma
Copy link
Member

that's a long series of Chirs scripts which i never really checked in.

As far i can see there is in the code, active only for some missions, another qrf script named as https://github.com/A3Antistasi/antistasiofficial/blob/master/AntistasiOfficial.Altis/CREATE/enemyQRF.SQF

it could be the time to go trough it but i've no energy for that now..

@Barbolani77
Copy link

Not well done too :(

It despawns units only checking players nearby. I told them several times Antistasi is not player centric. If you send HC commanded AIs to counter a QRF, those AIs will see suddently their enemies despawn.

EDIT: No, because I see the conditions for despawning are coded badly too:

  • They are not counting fleeing units. Bad done. Very bad. An AI running away for 1 KM, nobody spots it, QRF does not despawn until the timeout, AI who wants to go home cannot because they still have not surrendered or died.
  • Non fleeing soldiers, but lost / stuck, even when the QRF has no sense at all, same issues (criteria shouldnt be == 0 but 1/3 of the spawned units).
  • Transport pilots are added to the soldier array, they are counted, and if they dont despawn in other way, same issue as long as they are not shot down and killed.
  • Different distances for vehicles than soldiers lead to: When timeouted I despawn the veh, the soldiers not, soldiers fall, soldiers die, economics affected.
  • Vehicles should despawn first, to avoid very rare despawn of units but not despawn vehicles, veh crashes, affect economics or free vehicles...

So, bad for performance, bad for game experience. Not a big issue, dont delay any release because of this, but has to be improved.

@StefArma
Copy link
Member

So, regardless the fn_QRF_RTB.sqf

In combinedca.sqf there is already this line which should despawn enemies once the attack is done.
https://github.com/A3Antistasi/antistasiofficial/blob/36b1ef07e16333ae0e5b3be6cf63bba3c1b070bf/AntistasiOfficial.Altis/CREATE/combinedCA.sqf#L381

And it will by checking theese:
https://github.com/A3Antistasi/antistasiofficial/blob/36b1ef07e16333ae0e5b3be6cf63bba3c1b070bf/AntistasiOfficial.Altis/Functions/fn_despawnUnits.sqf#L20-L24

so ofcourse they check for bluforspawn and all FIA AI has bluforspawn true apart the ones who are in the garrison.

The weird thing is that those helis won't despawn.. so i need to check if they're not included in the list.


About thhose fn_QRF functions i'm agree so i was trying to make a foreach and spawn the fn_despawnunits.sqf there too.

@Barbolani77
Copy link

Regarding the win / lose conditions: same than the QRF, or even worse :(

  • Counting with incapacitated soldiers while AFAIK they were not using the setUncosncious command (is the one used in WotP for the revive radolls etc).
  • Not counting with surrendered enemies.
  • Not counting with fleeing enemies.

So a bunch of surrendered CSAT guys can win the battle because a few FIA brave and combative guys moved 100 mts away of the marker center. lol

The despawn function is ok but may be improved with the things we spoke the other day about not waiting in some cases.

What has Little sense for me is the waitUntil before the despawner function. Big thing here. We don't need the defending place to be despawned for waiting to despawn the attackers. This means the attackers will never despawn, as the ones that are close to the marker will avoid it to despawn, so, target spawned, attackes spawned even when the attack is lost.

Despawning an attacker can be only related to:

  • When they have won or loose: related to attacking (not defending) enemy presence. Allways.
  • When they are not pretending to conquer anything, when the destination is despawned. Only in this case. For example, a qrf sent to some point (not marker) in response of an action, if no attackers near the attackers, and no attackers near the point, then yes despawn,

@StefArma StefArma changed the title Enemy attack helicopters not attacking AAF Attack: despawn and Heli movemet issues Feb 27, 2018
@StefArma
Copy link
Member

I solved the part of them not attacking, however it's horrible how they behave, they loiter around without the clue they're actually assaulting an objective.

d744f35

@deimerl
Copy link
Author

deimerl commented Feb 28, 2018

Thank you, so will they still attack or just fly around like you said?

@StefArma
Copy link
Member

StefArma commented Mar 1, 2018

With RHS they fly around and hardly be able to shoot on place of attack, but they'll indeed burst whatever they can like players coming in from outside :P
or, another RHS peculiarity, they'll explode while loitering because they will strafe weirdly into trees ;)

@deimerl
Copy link
Author

deimerl commented Mar 1, 2018

I don't remember in previous versions with RHS this happening. Do you plan on fixing it in the future?

@StefArma
Copy link
Member

StefArma commented Mar 1, 2018

Ofcourse, they were never loitering properly. I can't fix RHS stuff, i can tweak the height and the speed tho

@deimerl
Copy link
Author

deimerl commented Mar 1, 2018

Great, as long as its all back to normal that'll be fine. Thanks for your work. Is the issue of enemy not sending a QRF related to this?

@StefArma
Copy link
Member

StefArma commented Mar 1, 2018

no

@zalexki zalexki added the bug label Apr 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants