Tankbuster 1733 Posted October 19, 2018 I was wondering if anyone had in their library an alternative to fnc_findoverwatch? My main issues with the function are that it is slow and rarely returns a position that really is overwatch - there is seldom a real line of sight between the two positions. Also, the third parameter, minheightabove is ignored. If no one has anything or they are unable to share it, would they be able to give some ideas as to how this might be achieved? Share this post Link to post Share on other sites
HazJ 1288 Posted October 19, 2018 I would use: https://community.bistudio.com/wiki/selectBestPlaces And check height against surroundings. 1 Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted October 20, 2018 https://github.com/auQuiksilver/Apex-Framework/blob/master/Apex_framework.terrain/code/functions/fn_findOverwatchPos.sqf params [ ['_targetPos',[0,0,0]], ['_maxrange',3000], ['_minrange',0], ['_minheight',0], ['_checkVisibility',[]] ]; the _checkVisibility variable is an array for the key arguments of the checkVisibility command so a call might look like this _overwatchPosition = [_targetPosition,1000,100,10,[[objNull, "VIEW"],_targetPosition,0.5]] call QS_fnc_findOverwatchPos; where ^ 0.5 is the minimum required "checkVisibility" return reference: [[objNull, "VIEW"],_targetPosition,0.5] if (((_checkVisibility select 0) checkVisibility [[(_checkPos select 0),(_checkPos select 1),(_height + 1)],(_checkVisibility select 1)]) > (_checkVisibility select 2)) then { And in practice, here's the types of positions it generates: (black being traditional "overwatch", red being overwatch + line of sight) 3D visualization of the overwatch: and we used it to do things like this, sniper placement: 7 5 Share this post Link to post Share on other sites
Tankbuster 1733 Posted October 20, 2018 I'm tasking players to arty or AT kill a car with a given number plate from more than 500m away. This looks just the ticket! Thank you. Quick question, any reason you use checkvisibility instead of lineintersects? I'm familiar with both - just wondering what made you chose that one? Share this post Link to post Share on other sites
pierremgi 4739 Posted October 20, 2018 checkVisibility returns a "level", (quality) of visibility. You can sort the results. Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted October 20, 2018 5 hours ago, Tankbuster said: I'm tasking players to arty or AT kill a car with a given number plate from more than 500m away. This looks just the ticket! Thank you. Quick question, any reason you use checkvisibility instead of lineintersects? I'm familiar with both - just wondering what made you chose that one? used for AI placement, they need line of sight, not just no object obstructions (is there a difference?) :) Share this post Link to post Share on other sites
Tankbuster 1733 Posted October 20, 2018 1 hour ago, fn_Quiksilver said: used for AI placement, they need line of sight, not just no object obstructions (is there a difference?) :) Effectively they are the same apart from one returns a bool and the other returns a 0 to 1 score. I'll do some tests to see if one is significantly faster than the other. Share this post Link to post Share on other sites
johnnyboy 3743 Posted October 20, 2018 19 hours ago, fn_Quiksilver said: /fn_findOverwatchPos.sqf That is very impressive and useful Mr. Quiksilver. Thanks much! 1 Share this post Link to post Share on other sites
froggyluv 2130 Posted October 22, 2018 On 10/19/2018 at 9:59 PM, fn_Quiksilver said: Cool Stuff man thats pretty neat -props for the nice explanation and to the Devs for making such a cool function 1 Share this post Link to post Share on other sites
HazJ 1288 Posted October 27, 2018 @fn_Quiksilver - Just curious... Why: ... call (missionNamespace getVariable 'QS_fnc_findSafePos') Share this post Link to post Share on other sites
Tankbuster 1733 Posted October 28, 2018 On 20/10/2018 at 6:55 PM, fn_Quiksilver said: used for AI placement, they need line of sight, not just no object obstructions (is there a difference?) :) Not in performance, not really. I'm struggling with your function though because it has dependencies on other functions from your mission and they, in turn, call other functions. I don't want to sound ungrateful, because I'm really not, but it's quite hard to use as it is right now. Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted October 29, 2018 10 hours ago, Tankbuster said: Not in performance, not really. I'm struggling with your function though because it has dependencies on other functions from your mission and they, in turn, call other functions. I don't want to sound ungrateful, because I'm really not, but it's quite hard to use as it is right now. i think it uses QS_fnc_findSafePos you should be able to just change it to BIS_fnc_findSafePos and achieve similar results 1 Share this post Link to post Share on other sites
HazJ 1288 Posted October 29, 2018 On 10/27/2018 at 9:41 PM, HazJ said: @fn_Quiksilver - Just curious... Why: ... call (missionNamespace getVariable 'QS_fnc_findSafePos') What about this? Really intrigued! Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted October 29, 2018 24 minutes ago, HazJ said: What about this? Really intrigued! what about what? :) Share this post Link to post Share on other sites
HazJ 1288 Posted October 29, 2018 Why do you do it like that? Instead of: ... call QS_fnc_findSafePos You have: ... call (missionNamespace getVariable 'QS_fnc_findSafePos') Any reason or? Share this post Link to post Share on other sites
HazJ 1288 Posted October 31, 2018 I take it is just alternate way (maybe just to be fancy?) of doing it, though it provides no actual benefit, at least not in my perf tests - used BIS code performance. Tested multiple times with BIS_fnc_findSafePos function. Share this post Link to post Share on other sites
Tankbuster 1733 Posted November 3, 2018 I got it working. Really nice. Thank you. Note that the checkvisibility component must be given an ASL, whereas the rest of the function needs ATL 1 Share this post Link to post Share on other sites