apparently loops, that constantly get nearEntities (mostly used in Zed Shields) are FPS Killers.
I am planning on having Zed Shields around Plots, but i didn't want massive FPS drops, so i came up with this Idea:
Getting the Marker Positions via getMarkerPos and saving them in an array. In the Zombie Behavior then check the Positions array and delete the Agent, if the distance to the Marker Position is smaller then 100.
deleteInPositions = [];
deleteInPositions set [count deleteInPositions, (getMarkerPos "Tradercitystary")];
deleteInPositions set [count deleteInPositions, (getMarkerPos "AirVehicles")];
deleteInPositions set [count deleteInPositions, (getMarkerPos "BanditDen")];
deleteInPositions set [count deleteInPositions, (getMarkerPos "Klen")];
deleteInPositions set [count deleteInPositions, (getMarkerPos "BoatDealerEast")];
deleteInPositions set [count deleteInPositions, (getMarkerPos "TradercityBash")];
deleteInPositions set [count deleteInPositions, (getMarkerPos "HeroTrader")];
Now this is my suggestion (inside wild_spawnZombies.sqf) :
_meters = 0;
while {!isNull _agent} do {
if (alive _agent) then {
{
_meters = _agent distance _x;
if (_meters < 100) exitWith {
deleteVehicle _agent;
};
} count deleteInPositions;
};
};
I am wondering, if this is actually better or worse then nearEntities, as it kind of constantly loops.. ?
Note, that _x in this case is an array that contains PosX, PosY, PosZ, which it got from the getMarkerPos, but also this is not terrain relative, so i don't really know, if this works or not?
Question
Guest
Hi,
apparently loops, that constantly get nearEntities (mostly used in Zed Shields) are FPS Killers.
I am planning on having Zed Shields around Plots, but i didn't want massive FPS drops, so i came up with this Idea:
Getting the Marker Positions via getMarkerPos and saving them in an array. In the Zombie Behavior then check the Positions array and delete the Agent, if the distance to the Marker Position is smaller then 100.
Now this is my suggestion (inside wild_spawnZombies.sqf) :
I am wondering, if this is actually better or worse then nearEntities, as it kind of constantly loops.. ?
Note, that _x in this case is an array that contains PosX, PosY, PosZ, which it got from the getMarkerPos, but also this is not terrain relative, so i don't really know, if this works or not?
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now