Jump to content
Sign in to follow this  
zodd

AI terrain/LOS analysis

Recommended Posts

Gday all,

I am in the process of working through an AI command mod and wondering if anyone has any cunning ideas on how you could go about generating a MCOO style analysis of a map for the AI to use? (ie. get the data so what I am working on can analyse it)

Something like:

1-s2.0-S0022489805000133-gr5.jpg

In addition, I am trying to work out the best way to do a line of sight analysis

Something like:

http://casoilresource.lawr.ucdavis.edu/drupal/files/images/condor_facility-4m_los.preview.png (655 kB)

I think you could check a route by having a general position you want to avoid and run LOS checks every 10/20/50m along the planned route... Possibly using something from

http://forums.bistudio.com/showthread.php?135252-Line-Of-Sight-(Example-Thread)

or

http://forums.bistudio.com/showthread.php?90864-Script-function-request-Line-of-sight-check&p=1504843&viewfull=1#post1504843

Any other ideas would be great.

The combination of those two will allow the AI to work out the best avenue of advance (based on passability of terrain and identifying dead ground)

Any thoughts would be much appreciated

Edited by Zodd

Share this post


Link to post
Share on other sites

I have a rally point idea which is easy to do but not a priority, I am busy at the moment so will keep and eye on yours, I'd probably use Larrows height scripts also.

I'd make it so at mission start I'd break the map into sections, find high and low points with larrows scripts, find rally points using terrainIntersect and save with profileNamespace so the mission wouldn't

take so long to load next time, basically make arrays of good spots and bad spots and rally points to be used as waypoints, all cpu work done at start.

good luck

Share this post


Link to post
Share on other sites

Ok - some success in a basic proof of concept...

I am using terrainIntersect and loops to find areas of dead ground. Currently it only checks a single direction (due north for ease initially) however intent from here will be to check areas in an angle either side of the intended assault to work out a route into the FUP too.

The script loops from the initial position and adds a minimum distance to start checking from. This prevents dead ground within close range being considered. It can be set to 0 to check from the observer's origin. There is an offset that can be modified; currently I use it to add a bit of height as a safety buffer.

The loop checks from the observer position to a location a set angle and distance from them; a set interval is added to this each time until it reaches the number of cycles. This allows you to specify the accuracy (eg. Check every 5m, 20m, 50m etc) and distance (eg. if interval is 5m and you want to check to 1km, you would use 200 interval loops)

It also identifies the closest FUP available. You specify how many intervals of dead ground you need (ie. set how 'deep' the FUP needs to be to be considered valid) and how far into the dead ground the FUP will start (eg. You could have the FUP right on the cusp of visibility or you can start it further into the dead ground)

As always, pictures are a good demo:

Basic eg:

https://dl.dropboxusercontent.com/u/74159983/deadGroundDemo1.jpg (214 kB)

Checking with more detail (FUP needs to be a bigger size here; note the dead ground ignored because it isnt sufficient size)

https://dl.dropboxusercontent.com/u/74159983/deadGroundDemo2.jpg (212 kB)

Another demo showing where small amounts of dead ground are

https://dl.dropboxusercontent.com/u/74159983/deadGroundDemo3.jpg (208 kB)

If you need a big FUP you would use something like the above; if you wanted a LUP for a sniper for example, you could use a smaller interval and FUP size.

Obviously still very basic WIP but at least the concept is feasible!

Script allows you to specify the interval between

Share this post


Link to post
Share on other sites

Hi good projct i like it

i think in A1 there was scripts for things like flatground and maybe more , could b pointrs for you witn hew commands

also maybe better for you to make FSM for more efficient way ?

i know some bits about FSM because i wrote for some fish and sharks , its basicly conditions and actions when conditions are met , they arevery raw but very fast :)

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
Sign in to follow this  

×