taking cover.

Posted By: Random

taking cover. - 12/21/14 22:07

One way to make your AI seek and use cover, is usind "coverpoints", which you set in WED, and c_trace.

However, I want my AI to seek and use cover, without pre planted "coverpoints";
that the AI somehow knows where to take cover, only using the position of it's enemy/ies and traces (or whatever).

Anybody has an idea?

Greetings Random
Posted By: sivan

Re: taking cover. - 12/22/14 07:44

as I remember in Company of Heroes cover points are auto placed around obstacles (it uses a tile and area system for pathfinding similarly to my RTS pathfinder), which requires some kind of map decomposition, and they are set as real cover points for each group of characters based on line of sight calculation from enemies within range. thus you can easily assign cover points. if you do not have any kind of map decomposition then you have to place cover points manually, and evaluate similarly in game.
Posted By: alibaba

Re: taking cover. - 12/22/14 09:28

Well in IntenseX it was handled like this:

Place some nodes radially around the entitiy within a defined range.
Check from every node to enemy if contact is held.
If not then compare the distances.
Take the shortest and walk to it.
Posted By: Random

Re: taking cover. - 12/22/14 16:52

I already handled it manually, but it has to be automatic.
The idea that coverpoints are placed due to the situation and position (ally AI and enemy AI) while the game is running (real time) isn't bad, but it would definitely kill to much performance.
Posted By: MasterQ32

Re: taking cover. - 12/22/14 17:29

you can do some preprocessing of the level. Just create it once dynamically then store them in a file
Posted By: Random

Re: taking cover. - 12/22/14 18:56

I don't really know what you mean by that.
Do you mean that for instance, every (almost) entity in a certain radius of the AI is registered as a potential coverpoint. So if it is time for the AI to take cover, it searches for the nearest coverpoint (suitable entity)?

- beware of my paint skills! -


Posted By: MasterQ32

Re: taking cover. - 12/22/14 20:23

You have a level file that contains more information than just geometry+actions (wmb).
Create a custom file format (reference to wmb or something) that also contains path information, so path nodes, cover points and so on.
Then load the path information in your game into a fast data structure (quadtree for shooter levels eg) and search suitable cover points as soon as you need them from your precomputed storage (level format).
If you need dynamic cover points that move with entities, just search them as well but don't treat them equally.
© 2024 lite-C Forums