Jump to content
gc8

Finding all cover objects

Recommended Posts

Hey

I'm trying to get a list of all the objects that can be used as cover (sandbags, trees, bushes, houses, fences etc.) But the problem I'm having is that commands such as nearObjects return unwanted objects like runway lights, helipad markers and what not that obviously aren't cover...

So has anyone else tackled this problem before?

 

I have tried nearestObjects too and I could filter out some of the objects by looking for word "light" in their name but this would mean keeping lists of those unwated objects for it to work in all of the maps so it's not the ideal solution

another idea is to check the size of the object but helipad for example has big size even it's just painting on the ground.

Edit: Apparently runway lights are type "Building"

 

Hopefully someone has solution for this? 

 

thx!

Share this post


Link to post
Share on other sites

you could trying using boundingBoxReal to refine your search with the ClipGeometry or ClipVisual options, and then compare the height of the object to the height of the player or something along those lines.

Share this post


Link to post
Share on other sites
8 minutes ago, NumbNutsJunior said:

you could trying using boundingBoxReal to refine your search with the ClipGeometry or ClipVisual options, and then compare the height of the object to the height of the player or something along those lines.

 

interesting idea but I tried the helipad size with 0 & 2 as first parameter to boundingBoxReal and it still returns big size so no luck there

 

Share this post


Link to post
Share on other sites

any ideas? I am leaning on towards using blacklist but don't know if that's going to work on all maps

Share this post


Link to post
Share on other sites

What about pulling apart the AI commands? As a leader, obvously, you can order your AI team mates to take cover, so I would assume that stuff would be somewhere in the one if the pbo's. No idea if it filters out any objects though, or if they just seek cover from any nearby terrain object....

Share this post


Link to post
Share on other sites
Just now, beno_83au said:

What about pulling apart the AI commands? As a leader, obvously, you can order your AI team mates to take cover, so I would assume that stuff would be somewhere in the one if the pbo's. No idea if it filters out any objects though, or if they just seek cover from any nearby terrain object....

 

Have to say i didn't know you can order your men to take cover. how do you do that?

  • Haha 1

Share this post


Link to post
Share on other sites

Yeah, I don't play a lot with AI team mates. Small co-ops or the CTI-style ones are my general favourites. But, when you're in command of troops, I think you select the AI then press 1-7? I'll check, but pretty sure that's the command to tell them to find cover.

 

Edit: I WAS RIGHT!! It is 1-7 (Find cover). Hope the project is going well 👍

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
9 minutes ago, beno_83au said:

Yeah, I don't play a lot with AI team mates. Small co-ops or the CTI-style ones are my general favourites. But, when you're in command of troops, I think you select the AI then press 1-7? I'll check, but pretty sure that's the command to tell them to find cover.

 

Edit: I WAS RIGHT!! It is 1-7 (Find cover). Hope the project is going well 👍

 

nice really didn't know that. However not only that it's not very good (some lie on roads) my cover script is quite different so I still need those cover objects figured.

  • Like 1

Share this post


Link to post
Share on other sites

The problem is that it's difficult, not saying impossible, to define a "cover object", depending on stance, direction of threat, distance to the object, threat itself...

And, your list is not very helpful for a choice. Which sorting?

Imagine. Once you are sure that a (kind of) house is a convenient cover object. Did your AI take time to "run" to the other side of the house or choose a smaller rock in direction of the threat?

Imho, the way you could find cover is something like raycasting analysis. It's a little bit resource demanding, so I didn't push on this way myself. (just on advanced map in one mod). You can calculate "intervisibility" between a point (threat), and environment (terrain, objects) then decide a path for your unit from its position to a clear area (usually the nearest). After that, tactically, there are some other choices, depending on too many parameters. I think this approach is not too far from BI take cover fsm. I didn't check.

 

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

to define a "cover object", depending on stance, direction of threat, distance to the object, threat itself...

 

fortunately I don't need to handle all that, I just need objects where the player can command the AIs to move. it's players decision if the cover is good.

 

1 hour ago, pierremgi said:

Imho, the way you could find cover is something like raycasting analysis

 

yeah was thinking the same but would like to avoid that approach as it's challenging it self to implement 

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

×