Jump to content
Sign in to follow this  
calo_mir

Sniper AI

Recommended Posts

It seems to be accepted that snipers in the game basically act like infantrymen (trying to engage directly, flanking, getting closer, etc) as opposed to being generally avoidant (setting up somewhere with cover, taking a shot at the highest value visible target and immediately retreating, trying to stay unseen).

Is anyone aware if the recently released FSM editor can be utilized to write AI that actually acts like a sniper would? Is anybody working on anything related to this?

Share this post


Link to post
Share on other sites

The easiest way is to place a sniper and a trigger linked with the sniper on the map. Activation: detected by enemy.

On activation: sniper domove [(getpos sniper select 0) + random 100 - random 100,(getpos sniper select 1) + random 100 - random 100,0];

If the enemy finds the position of the sniper, the sniper will "search" for another position.

A fsm is not easy cause:

1. The arma2 "infantry"-ai will b still in contro

2. the fsm must find: a) Enemys in sight

b) a good sniping position (hard for a script)

But I will have a try on this.

Edited by NeoArmageddon

Share this post


Link to post
Share on other sites

The findCover command looks pretty well suited to this, actually. I'll be experimenting as well.

---------- Post added at 08:57 AM ---------- Previous post was at 08:51 AM ----------

I think the procedure is basically:

  1. Get list of nearest objects of human class of a side opposite to sniper within a set radius (nearestObjects and some manual filtering)
  2. Pick highest "value" target from list (officers, etc)
  3. findCover from intended target (maximum distance of 500m or so)
  4. Engage, kill
  5. findCover from dead target with a high value for minDist (in order to flee)
  6. Repeat

---------- Post added at 08:58 AM ---------- Previous post was at 08:57 AM ----------

This does of course mean that the sniper has a bit of knowledge that it normally wouldn't (the positions of units it hasn't actually seen yet).

Edited by calo_mir

Share this post


Link to post
Share on other sites
This does of course mean that the sniper has a bit of knowledge that it normally wouldn't (the positions of units it hasn't actually seen yet).

Thats the prob. If you want to make it realistic, its much harder (knowsabout probs etc).

And with findcover you have the prob, that the sniper is maybe hiding next to the target behind a bin or somethink else.... not very "sniperlike"

Edited by NeoArmageddon

Share this post


Link to post
Share on other sites

And with findcover you have the prob, that the sniper is maybe hiding next to the target behind a bin or somethink else.... not very "sniperlike"

Well, you can set a minimum distance on cover enumeration so you can at least be sure the sniper isn't next to the target. The issue of what type of object he's hiding behind... I'm not sure exactly what can be done about that yet.

Share this post


Link to post
Share on other sites

And you dont know, if the sniper can shoot the target behind his cover... and if you let him get out of cover, its not sniperlike too and can look very strange in arma....

Sniper is laying behind a sandbag, stands up, runs around the bags, sits down again, shoots the target, stands up again, runs to another cover... :yay:

Share this post


Link to post
Share on other sites

Sniper-AI is definitely something that BI should hard-code.

Too bad they haven`t done it in Arma2.

I also noticed that on doing some tests, the sniper-AI won`t fire at

targets more far away than approx. 450m, even though there is a perfect

clear shot possible and even if you reveal the target to the sniper and set his skill to 1 and rank to colonel ?!

If someone still wants to have a go at scripting it, the

http://community.bistudio.com/wiki/findNearestEnemy

will be better suited than nearestobject, because nearestobject creates

enormous lag.

Share this post


Link to post
Share on other sites
Sniper-AI is definitely something that BI should hard-code.

Too bad they haven`t done it in Arma2.

I also noticed that on doing some tests, the sniper-AI won`t fire at

targets more far away than approx. 450m, even though there is a perfect

clear shot possible and even if you reveal the target to the sniper and set his skill to 1 and rank to colonel ?!

If someone still wants to have a go at scripting it, the

http://community.bistudio.com/wiki/findNearestEnemy

will be better suited than nearestobject, because nearestobject creates

enormous lag.

I have been busy with a private project called MCC at 6thense. Its capable of making coop mission by click. Its done by zones.

At the moment i am making a " zone manager" that is basicly the overall guide to units. The lower level FSM is already covered by BIS (group control etc). Its the heigher level that they lack.

Anyway in that zonemanager i am using http://community.bistudio.com/wiki/nearTargets in the FSM's of the units under control of the zone manager. That seems to work nice.

Share this post


Link to post
Share on other sites

@spirit6:

Sounds really good, looking forward to it!

So you override "AUTOAIM" and assign the targets from the neartargets array?

Doubtful to get the snipers to engage targets in their sniper-related range though without tweaking the config, if that even works.

And still the building geo-LOD problem exists if they lay prone on a roof, they think there is a wall in front of them which prevents them from making the shoot

in many cases.

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  

×