Jump to content
Tankbuster

Alternative to fnc_findoverwatch

Recommended Posts

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

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)

fhn0QdR.jpg

 

3D visualization of the overwatch:

TbI5Gep.jpg

 

and we used it to do things like this, sniper placement:

9Nc4DHF.jpg

  • Like 7
  • Thanks 5

Share this post


Link to post
Share on other sites

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

checkVisibility returns a "level", (quality) of visibility. You can sort the results.

Share this post


Link to post
Share on other sites
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
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
19 hours ago, fn_Quiksilver said:

/fn_findOverwatchPos.sqf

That is very  impressive and useful Mr. Quiksilver.  Thanks much!

  • Like 1

Share this post


Link to post
Share on other sites
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

  • Like 1

Share this post


Link to post
Share on other sites

@fn_Quiksilver - Just curious... Why:

... call (missionNamespace getVariable 'QS_fnc_findSafePos')

 

Share this post


Link to post
Share on other sites
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
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

  • Thanks 1

Share this post


Link to post
Share on other sites
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! :happy:

Share this post


Link to post
Share on other sites

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

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

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

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×