Jump to content
Sign in to follow this  
SaOk

Line Of Sight (Example Thread)

Recommended Posts

I'm at work now but will modify the script a little when I get home, to work regardless of whether player and group is opfor or blufor.

See my above post regarding enhancing the script for more realistic behaviour regarding enemy visibility such as camo or at night. I will work on this too.

The script won't make units hunt an enemy down. They won't move towards them or seek them out, merely react when they see them by crouching and shooting. I'll leave it up to the masters like Robalo to modify behaviour in more fundamental ways.

You can watch your subordinates engaging enemies. The script runs on a per unit basis, so while you might have LOS to an enemy, a subordinate may not. And vice versa.

Anyway, keep on testing mate, all the feedback is giving me some food for thought.

As it stands, AI target recognition at night may get an unwanted boost from the script. Going back to play with it now.

It only affects BLUFOR squadmates? Alright, a derp on my part.

This makes the script extremely difficult to test, since observing the behavior of the AI will affect the test. I can't watch my subordinates do battle without giving away enemy positions to them. It's much easier to test when enemy AI are using the script to hunt the player down.

Also, if it only affects your own squad, my big battle tests may have been misleading.

Share this post


Link to post
Share on other sites

So I've been trying out a few things trying to inject some realism into this LOS CQB thing. Obviously having a squad who can instantly blow away any enemies within a 200m radius, regardless of conditions or enemy stealth, is not optimal.

Here's what I've come up with so far:

Darkness: I use CarlGustaffa's excellent azimuth code to return an angle from -90 (middle of night) to 90 (middle of day). The darker it is, the harder it is to see an enemy.

Distance from unit to enemy: 0 - 100. The further away the enemy are, the harder they are to spot. Beyond 100m the LOS function stops and the default knowsabout and its mysterious parameters come into effect

Speed of enemy: 0 -20 (for infantry). Moving enemies are easier to spot than stationary ones

Speed of unit: 0 -20. Running units are less effective at instantly spotting enemies

Vision mode of player: 0 (unassisted) 1 (NV) 2 (FLIR). Assisted vision aids in spotting enemies in lower light conditions.

The idea is to combine these variables into a simple formula so that a value of > 0 causes the unit to kneel and shoot, and < 0 causes them to not bother (ie simulating that they can't see the enemy even though they have LOS). My formula so far is

formula = sunangle + (enemy speed * 5) - (unit speed * 5) - distance + (vision mode * 50) + some offset (let's say 20)

Here's some scenarios...

Scenario 1. Midnight, stationary unit with no NV, stationary enemy 10m away

-90 + (0 * 5) - (0 * 5) - 10 + (0 * 50) + 20 = -80 -> unit can't see enemy

Enemy starts running

-90 + (20 * 5) - (0 * 5) - 10 + (0 * 50) + 20 = 20 -> unit sees enemy

Enemy runs 50m away

-90 + (20 * 5) - (0 * 5) - 50 + (0 * 50) + 20 = -20 -> unit can't see enemy

Unit turns on NV

-90 + (20 * 5) - (0 * 5) - 50 + (1 * 50) + 20 = 30 -> unit sees enemy

Scenario 2. Mid morning, running unit, stationary enemy 80m away

45 + (0 * 5) - (20 * 5) - 80 + (0 * 50) + 20 = -115 -> unit can't see enemy

Unit stops running

45 + (0 * 5) - (0 * 5) - 80 + (0 * 50) + 20 = -15 -> unit still can't see enemy

Enemy freaks out and starts running

45 + (20 * 5) - (0 * 5) - 80 + (0 * 50) + 20 = 85 -> unit sees enemy

You get the picture. I've tested this out and it seems to work well. Obviously the problem is that there are many more potential variables, that I just don't know how to implement. eg player fatigue or morale, enemy camouflage, local shadow or light. So if anyone has any more ideas, I'd love to hear them.

Share this post


Link to post
Share on other sites

In my opinion, the script's most crucial function is interrupting AI that are already running, so making their spotting worse is counter-productive, at least at very short ranges (>50m(.

Share this post


Link to post
Share on other sites
So I've been trying out a few things trying to inject some realism into this LOS CQB thing. Obviously having a squad who can instantly blow away any enemies within a 200m radius, regardless of conditions or enemy stealth, is not optimal.

Here's what I've come up with so far:

Darkness: I use CarlGustaffa's excellent azimuth code to return an angle from -90 (middle of night) to 90 (middle of day). The darker it is, the harder it is to see an enemy.

Distance from unit to enemy: 0 - 100. The further away the enemy are, the harder they are to spot. Beyond 100m the LOS function stops and the default knowsabout and its mysterious parameters come into effect

Speed of enemy: 0 -20 (for infantry). Moving enemies are easier to spot than stationary ones

Speed of unit: 0 -20. Running units are less effective at instantly spotting enemies

Vision mode of player: 0 (unassisted) 1 (NV) 2 (FLIR). Assisted vision aids in spotting enemies in lower light conditions.

The idea is to combine these variables into a simple formula so that a value of > 0 causes the unit to kneel and shoot, and < 0 causes them to not bother (ie simulating that they can't see the enemy even though they have LOS). My formula so far is

formula = sunangle + (enemy speed * 5) - (unit speed * 5) - distance + (vision mode * 50) + some offset (let's say 20)

Here's some scenarios...

You get the picture. I've tested this out and it seems to work well. Obviously the problem is that there are many more potential variables, that I just don't know how to implement. eg player fatigue or morale, enemy camouflage, local shadow or light. So if anyone has any more ideas, I'd love to hear them.

Wow this is interesting. Some suggestions to your “formulaâ€:

The degree that night vision helps should depend on the time of day as well. ***Currently you have it totally independent of the time if I’m not mistaken. So I would have it look something like this…

formula = sunangle*visionmode + (enemy speed * 5) - (unit speed * 5) - distance + some offset (let's say 20)

Where vision mode would be either -1:NV, or +1:unequipped. Honestly FLIR is so unlike both of these as it is totally independent of time of day, so I would make it a whole separate category.

also, movement of the target should have more effect than movement of the spotter, to prevent the current problem we have of units running by units right in front of them, or units not seeing units run right in front of them. So something more like this

formula = sunangle*visionmode + (enemy speed * 6) - (unit speed * 4) - distance + some offset (let's say 20)

Just spitballing. Obviously these type of things need to be tested to fully determine their validity. I am sure the numbers I provided would not work well but you get the idea. And I also agree with Maturin. Right now, I would say it is most important to simply make the ai capable at spotting + engaging in close combat. Making their spotting worse might not be ideal at this point… But whatever you decide to do Keep up the good work.

I also wonder if BIS made these new functions specifically to improve CQB, with plans to implement it in arma 3. I hope so.

Edited by -Coulum-

Share this post


Link to post
Share on other sites

I think some implementation of knowsabout needs to be considered - the above, while certainly impressive, still has no way of taking camouflage (i.e. the difference in visibility between someone wearing a ghillie suit and another person in a hi-vis vest) into account. Either that, or perhaps consideration of a unit's camouflage parameter in the config (although I'm fairly certain this can't be queried in-game).

Share this post


Link to post
Share on other sites
I think some implementation of knowsabout needs to be considered - the above, while certainly impressive, still has no way of taking camouflage (i.e. the difference in visibility between someone wearing a ghillie suit and another person in a hi-vis vest) into account. Either that, or perhaps consideration of a unit's camouflage parameter in the config (although I'm fairly certain this can't be queried in-game).

infact... that may just be possible with config >> "Class entry" after getting the unit's class under inspection and checking for the proper entry (camouflage = 0.5).

Share this post


Link to post
Share on other sites

Thanks for all the feedback guys, very very helpful.

@-Coulum-, I think your suggestions are excellent and I will implement them post haste.

@CameronMcDonald: I tried knowsabout and it was pretty useless in this situation. Basically as soon as a unit has LOS to an enemy, the knowsabout is 4 (maximum).

@Gammadust, thanks for the tips re config scraping to get camo values. I will definitely have a look at this. Just to save me having to get it working by trial and error (that's the kind of shit coder I am), could you give me a code example?

@maturin: I'll set things up so that if a unit has LOS to anything under say 25m they just shoot them, regardless of the above visibility juggling.

Share this post


Link to post
Share on other sites
I tried knowsabout and it was pretty useless in this situation. Basically as soon as a unit has LOS to an enemy, the knowsabout is 4 (maximum).

Yep, as expected.

Perhaps to clarify, could knowsabout can be used as a trigger condition (i.e. only the unit only stops and shoots the target based upon LOS while knowsabout is above a certain value? Or, should the enemy target array only include units with a knowsabout value above a certain number?

If a unit doesn't know about an enemy in the area (i.e. he/she is prone in the grass or otherwise concealed), the LOS firing assist script doesn't run for him/her, hence, snipers can stay hidden until they are spotted, after which they are promptly coated with lead.

EDIT - something like:

if (!(_cansee == 0) and (_a knowsabout _b > 0.2))

Edited by CameronMcDonald

Share this post


Link to post
Share on other sites

OK, I see what you mean now.

Currently the script finds all "man" and "car" entities within 100m radius of the unit, and then does the LOS calculations for any which are side EAST (or WEST if you are EAST). I can expand it so that the LOS stuff is only done for EAST && knowsabout > 2 (or whatever value).

Such a shame I can't do Arma scripting on my work lunch break!

Yep, as expected.

Perhaps to clarify, could knowsabout can be used as a trigger condition (i.e. only the unit only stops and shoots the target based upon LOS while knowsabout is above a certain value? Or, should the enemy target array only include units with a knowsabout value above a certain number?

If a unit doesn't know about an enemy in the area (i.e. he/she is prone in the grass or otherwise concealed), the LOS firing assist script doesn't run for him/her, hence, snipers can stay hidden until they are spotted, after which they are promptly coated with lead.

EDIT - something like:

if (!(_cansee == 0) and (_a knowsabout _b > 0.2))

Share this post


Link to post
Share on other sites

I've done a quick test or two with the above line and knowsabout value (0.2), results are encouraging.

Made a quick test mission where a ghillied Russian sniper crawls out into the open from behind a building about 100m away.

With the knowsabout modification, team mates have no idea where he is until I ID him for them (thus raising their knowsabout value above threshold). Without it, they all "see" him the instant he comes around the corner. Might do some testing in a slightly larger scale environment.

Share this post


Link to post
Share on other sites

Awesome. I will incorporate knowsabout into the system tonight. Thanks CMcD

I've done a quick test or two with the above line and knowsabout value (0.2), results are encouraging.

Made a quick test mission where a ghillied Russian sniper crawls out into the open from behind a building about 100m away.

With the knowsabout modification, team mates have no idea where he is until I ID him for them (thus raising their knowsabout value above threshold). Without it, they all "see" him the instant he comes around the corner. Might do some testing in a slightly larger scale environment.

Share this post


Link to post
Share on other sites
infact... that may just be possible with config >> "Class entry" after getting the unit's class under inspection and checking for the proper entry (camouflage = 0.5).

OK so I couldn't help myself and tried this for myself. I can get the enemy's classname using typeof, but have no idea how to go from there to digging out the camouflage values from the config. Any further help on this would be much appreciated.

The reason I am interested in this is that I'm still not particularly satisfied with knowsabout, after playing some more with it. I've had cases with myself or squad getting full line of sight on a non camo enemy and knowsabout staying stubbornly on 0 for 30 seconds or more.

EDIT: worked it out

_camo = getnumber (configfile >> "CfgVehicles" >> (typeof _near) >> "Camouflage");

Normal units are 1

Camo units are 0.5

Edited by tpw

Share this post


Link to post
Share on other sites

Try this one on for size.

Thanks to everyone's help I've been able to implement a few things (and fix some bad bugs).

  • The script will work for the player's group, whether they are opfor or blufor
  • The LOS stuff only kicks in if enemies are closer than 100m. Beyond that, the usual AI FSM, knowsabout etc come into play
  • Camouflaged units are ignored by the LOS script. Units will still shoot at snipers, but only if they can see them as part of their usual AI routines.
  • I've implemented a kludgy "visibility formula", which takes into account darkness, whether unit has NV, unit movement and enemy movement, plus a bit of randomness. So even if a unit has LOS to an enemy, they may not actually "see" them....
  • ...however if any enemies are closer than 25m, the LOS over-rides the visibility formula and units will serve them up a hot lead injection.

Any feedback is welcomed!

//UNITS IN PLAYER'S GROUP WILL AUTOMATICALLY KNEEL/CROUCH AND SHOOT IF THEY HAVE LINE OF SIGHT WITH NEAR ENEMIES 
// Needs beta 93666 or greater 
// Line of sight stuff adapted from SaOk 
// Azimuth stuff adapted from CarlGustaffa
// TPW 20120615 

private ["_unit","_near","_nearunits","_a","_b","_dirTo","_eyeD","_eyePb","_eyePa","_eyeDV","_ang","_tint","_lint","_vm","_dist","_esp","_usp","_camo","_ka","_formula"]; 

//Start hint
sleep 1;
hintsilent "TPW / SaOk LOS active";

//Angle of sun - adapted from CarlGustaffa
[] spawn {
private ["_lat","_day","_hour"];
while {true} do 
{
_lat = -1 * getNumber(configFile >> "CfgWorlds" >> worldName >> "latitude");
_day = 360 * (dateToNumber date);
_hour = (daytime / 24) * 360;
tpw_los_sunangle = round (((12 * cos(_day) - 78) * cos(_lat) * cos(_hour)) - (24 * sin(_lat) * cos(_day)));  
sleep 300; 
};
};

//Main function
tpw_los =  
{ 
   { 
   _unit = _x; 
_vm = (currentVisionMode _unit); if (_vm == 1) then {_vm = -1} else {_vm = 1}; 
if (side _unit == east) then {tpw_enemyside = west} else {tpw_enemyside = east};
   _nextTime = _unit getVariable ["NextTime", -1]; 
   if(_nextTime == -1) then {_unit setVariable ["NextTime", diag_tickTime + random 1];}; 
   if(diag_tickTime >= _nextTime) then  
       { 
       _unit setunitpos "AUTO"; 
       _unit setVariable ["NextTime", diag_tickTime + random 1]; 
       _nearunits = (getposatl _unit) nearentities [["man","car"],100]; 
           { 
           _near = _x; 
           tpw_los_cansee = 0; 
           if (side _near == tpw_enemyside) then  
               { 
               //Line of sight stuff adapted from SaOk 
               _a = _unit;  
               _b = _near;  
               _eyeDV = eyeDirection _a;  
               _eyeD = ((_eyeDV select 0) atan2 (_eyeDV select 1));   
               _dirTo = ([_b, _a] call BIS_fnc_dirTo);  
               _ang = abs (_dirTo - _eyeD); 
               _eyePa = eyePos _a; 
               _eyePb = eyePos _b; 
               _tInt = terrainIntersect [_eyePa, _eyePb]; 
               _lInt = lineIntersects [_eyePa, _eyePb]; 
			if (((_ang > 120) && (_ang < 240)) && !(_lInt) && !(_tInt)) then
				{
				//Other factors affecting visibility of enemy
				_ka = _unit knowsabout _near;
				_dist = (_unit distance _near); 
				_esp = abs (speed _near);
				_usp = abs (speed _unit);
				_camo = getnumber (configfile >> "CfgVehicles" >> (typeof _near) >> "Camouflage");
				//Magic visibility formula
				_formula = (_vm * (tpw_los_sunangle)) + (_esp * 6) - (_usp * 2) - _dist + random 40;
				if (_dist < 25) then {_formula = 200}; 
				if (_camo > 0.5) then {tpw_los_cansee = _formula};
				};

			}; 
               if (tpw_los_cansee > 0) exitwith  
                  { 
                   _unit setunitpos "MIDDLE"; 
                   _unit lookat _near; 
                   _unit dofire _near; 
                   //Debugging     
                  //hint format ["%1 \n%2 \n%3m \n%4",(name _unit),(typeof _near),round (_unit distance _near),round tpw_los_cansee]; 
                  };  
           } foreach _nearunits; 
       }; 
   } foreach units group player; 
}; 

[tpw_los,0.5] call cba_fnc_addPerFrameHandler;

Edited by tpw

Share this post


Link to post
Share on other sites

Ok, nicely done!

Some further suggestions:

- Allowance for the player/leader to set stance independently of the script (at the moment, I would assume that group stances will automatically revert to "auto", which is likely to break stealth, as well as units perhaps getting up to fire). Perhaps the lines "_unit setunitpos "AUTO";" and "_unit setunitpos "MIDDLE";" should have a condition that they only activate if the unit is set to unitpos "auto", i.e. if the player has specified prone, crouched or standing, the stance changes in the script will not take effect.

- Similarly to the above, support for "hold fire" situations.

- Functionality for independent allied with east, or allied with none (basically all side combinations).

Might think of more later. Oh, here's one:

- Addon version working with all groups, not just that of the player. :P

Share this post


Link to post
Share on other sites
Try this one on for size.

Thanks to everyone's help I've been able to implement a few things (and fix some bad bugs).

The script will work for the player's group, whether they are opfor or blufor

The LOS stuff only kicks in if enemies are closer than 100m. Beyond that, the usual AI FSM, knowsabout etc come into play

Camouflaged units are ignored by the LOS script. Units will still shoot at snipers, but only if they can see them as part of their usual AI routines.

I've implemented a kludgy "visibility formula", which takes into account darkness, whether unit has NV, unit movement and enemy movement, plus a bit of randomness. So even if a unit has LOS to an enemy, they may not actually "see" them....

...however if any enemies are closer than 25m, the LOS over-rides the visibility formula and units will serve them up a hot lead injection.

Any feedback is welcomed!

Sorry, I am a dummy... Where do I put all that code to test this out. It looks really good though. And I agree with Cammcdonald, It will be far easier to see its effectiveness if it is activated for all units.

Share this post


Link to post
Share on other sites

You'll need to copy all of the above code, open up the tpw_saok_los_100 PBO and replace the contents of tpw_los.sqf with it, then re-PBO and play.

PM me if you need it done.

Share this post


Link to post
Share on other sites

Thanks CMcD

As far as I can tell, if the player orders a group to a stance, they hold it even if they have LOS. Only if you set "copy my stance" do they automatically kneel. TBH I'm happy about the kneeling, my initial idea for the LOS script was just to force kneeling as I hate it when units fire standing all the time.

Yes they do break "hold fire", but I find that AI tend to ignore this command regardless of the script. In any case I'm having trouble because combatmode _unit always returns "YELLOW", regardless of whether I have given them a hold fire or not. Will keep investigating that.

Independents easily implemented.

I'm experimenting with an allunits version, will try to iron out the last kinks in that.

---------- Post added at 11:27 ---------- Previous post was at 11:12 ----------

Here's an allunits version

It's set up to only work for opfor or blufor.

if ((side _x == west) || (side _x == east)) then {....

For some reason this statement doesn't fly

if ((side _x == west) || (side _x == east) || (side _x == guer)) then {..

Anyway, give it a try.

Addon version: http://www.gamefront.com/files/21851723/TPW_SAOK_LOS_ALL.zip

//UNITS IN PLAYER'S GROUP WILL AUTOMATICALLY KNEEL/CROUCH AND SHOOT IF THEY HAVE LINE OF SIGHT WITH NEAR ENEMIES 
// Needs beta 93666 or greater 
// Line of sight stuff adapted from SaOk 
// Azimuth stuff adapted from CarlGustaffa
// TPW 20120616 

private ["_unit","_near","_nearunits","_a","_b","_dirTo","_eyeD","_eyePb","_eyePa","_eyeDV","_ang","_tint","_lint","_vm","_dist","_esp","_usp","_camo","_ka","_formula"]; 

//Start hint
sleep 1;
hintsilent "TPW / SaOk LOS active";

//Angle of sun - adapted from CarlGustaffa
[] spawn {
private ["_lat","_day","_hour"];
while {true} do 
{
_lat = -1 * getNumber(configFile >> "CfgWorlds" >> worldName >> "latitude");
_day = 360 * (dateToNumber date);
_hour = (daytime / 24) * 360;
tpw_los_sunangle = round (((12 * cos(_day) - 78) * cos(_lat) * cos(_hour)) - (24 * sin(_lat) * cos(_day)));  
sleep 300; 
};
};

//Main function
tpw_los =  
{ 
   {
if ((side _x == west) || (side _x == east)) then 
	{
	_unit = _x; 
	_vm = (currentVisionMode _unit); if (_vm == 1) then {_vm = -1} else {_vm = 1}; 
	switch (side _unit) do 
		{
	case east: {tpw_enemyside = west};
	case west: {tpw_enemyside = east};
	case guer: {tpw_enemyside = east};
	//case guer: {tpw_enemyside = west};
		};
	_nextTime = _unit getVariable ["NextTime", -1]; 
	if(_nextTime == -1) then {_unit setVariable ["NextTime", diag_tickTime + random 1];}; 
	if(diag_tickTime >= _nextTime) then  
		{ 
		_unit setunitpos "AUTO"; 
		_unit setVariable ["NextTime", diag_tickTime + random 1]; 
		_nearunits = (getposatl _unit) nearentities [["man","car"],100]; 
			{ 
			_near = _x; 
			tpw_los_cansee = 0; 
			if (side _near == tpw_enemyside) then  
				{ 
				//Line of sight stuff adapted from SaOk 
				_a = _unit;  
				_b = _near;  
				_eyeDV = eyeDirection _a;  
				_eyeD = ((_eyeDV select 0) atan2 (_eyeDV select 1));   
				_dirTo = ([_b, _a] call BIS_fnc_dirTo);  
				_ang = abs (_dirTo - _eyeD); 
				_eyePa = eyePos _a; 
				_eyePb = eyePos _b; 
				_tInt = terrainIntersect [_eyePa, _eyePb]; 
				_lInt = lineIntersects [_eyePa, _eyePb]; 
				if (((_ang > 120) && (_ang < 240)) && !(_lInt) && !(_tInt)) then
					{
					//Other factors affecting visibility of enemy
					_ka = _unit knowsabout _near;
					_dist = (_unit distance _near); 
					_esp = abs (speed _near);
					_usp = abs (speed _unit);
					_camo = getnumber (configfile >> "CfgVehicles" >> (typeof _near) >> "Camouflage");
					//Magic visibility formula
					_formula = (_vm * (tpw_los_sunangle)) + (_esp * 6) - (_usp * 2) - _dist + random 40;
					if (_dist < 25) then {_formula = 200}; 
					if (_camo > 0.5) then {tpw_los_cansee = _formula};
					};

				}; 
				if (tpw_los_cansee > 0) exitwith  
				   { 
				   _unit setunitpos "MIDDLE"; 
				   _unit lookat _near; 
				   _unit dofire _near;
					//Debugging     
				   //hint format ["%1 \n%2 \n%3m \n%4\n%5",(name _unit),(typeof _near),round (_unit distance _near),round tpw_los_cansee]; 
				   };  
			} foreach _nearunits; 
		}; 
	};
   }forEach allUnits;
}; 

[tpw_los,0.5] call cba_fnc_addPerFrameHandler;

Edited by tpw

Share this post


Link to post
Share on other sites
You'll need to copy all of the above code, open up the tpw_saok_los_100 PBO and replace the contents of tpw_los.sqf with it, then re-PBO and play.

PM me if you need it done.

Ah! I should have thought of that. Sorry I am a bit new to this kind of stuff. Thanks for the help and offer for help, I think I should be able to manage that.

--edit--

doa! Just de/re pbo'd it and then realized tpw had upldated and uploaded a new pbo. Thanks tpw, I'm going to give it a rip as soon as I get time.

Share this post


Link to post
Share on other sites

Simply marvelous. I had taken a crack at CQB AI just about a year ago, but I ended up spending most of the efforts in developing my own LOS system using invisible bullets. In fact, by the time I had finished developing that system, I thought I had quite enough of that so I held it off. Never got back into it. But now, with this new system, I can definitely resume my work, although tpw here has done a wonderful job with his own script. I'll definitely give it a try and report back. Thanks for all your hard work!

Share this post


Link to post
Share on other sites
(side _x == guer)

Should be:

(side _x == resistance)

or:

((str (side _x)) == "GUER")

Very, very fascinating is all this. Can't wait for 1.61 official.

Share this post


Link to post
Share on other sites
Very, very fascinating is all this. Can't wait for 1.61 official.

Me too!. I'm seriously impressed (yet again) by the way forum members collaborate to make the game even better - kudos to tpw, SaOK, CameronMcDonald et al., and BIS for this set of great new functions/commands.

Roll on next weekend when I should have some time to start playing again :D

Share this post


Link to post
Share on other sites

Great job tpw. I just tried some fighting in shapur and the ai is much improved. No more do they run by you when you are clearly in their sight. A few observations/suggestions

The ai is very bad at looking around them and being aware of their surroundings. Your script works great, but if the ai doesn 't see you they will still run right by you. this is good but the problem is the ai is bad at checking there surroundings, so sometimes they would see you if they had human intellegence but don't. It happens less often but a couple times the ai continued right passed me because I was facing them from the side.

For example...

Basically I think either the ai looking behaviour must be improved, which probably isn't worth/ is to complex too be tinkering with... or their field of view could simply be increased to compensate for the fact thaye don't know how to scan areas of possible danger nearly as well as a human. I don't know if this is possible but its just my observation.

The other problem with the ai, as mentioned by many others, is that they are glacially slow to get on target at times. I have actually found that they can turn fast, but for some reason tehy don't always do it . I would say that its basically a fifty-fifty chance that they will turn quick and not slow. Anyways, I think this is a problem deep down in the ai code so there probably isn't a easy fix, but I did find this command...

object setDir heading

And it instantly rotates a unit, so there is no slow turning. Maybe it could be used to set the direction of a unit towards the enemy as soon as that enemy comes into sight? This would make it so the unit instantly turns (I know not exactly realistic) to face the threat, meaning that all he really has to do is raise his weapon and fire. This is a quick test I did...

vs.

The problem is you can't set the direction towards another object but rather a direction on the map (0-360). So if it is even possible to setdir towards a unit it would require a fair bit of math...

I don't know if any of that is possible or reasonable, I'm just spitting out ideas as thy come. This is definitley an improvement over the vanilla ai though. Great work!

Edited by -Coulum-

Share this post


Link to post
Share on other sites
The ai is very bad at looking around them and being aware of their surroundings.

Unless they know you are there that is ! I certainly don't have a 6th sense and they shouldn't either. I DO agree that when they are waiting they should be scanning some arcs (instead of looking forward) but it shouldn't look odd or unnatural. The setdir is unnatural and will open the 'milsim can of wormsTM'.

So the addon version works for EVERY unit or is it only onto group leaders ?

Share this post


Link to post
Share on other sites
Unless they know you are there that is ! I certainly don't have a 6th sense and they shouldn't either. I DO agree that when they are waiting they should be scanning some arcs (instead of looking forward) but it shouldn't look odd or unnatural.

Yes I know what you mean, they shouldn't have super vision. But as a human player, you are constantly scanning around to check for enemies. The ai doesn't do that. In the example I showed, A human player would have quickly checked the corner of the compound I was hiding in, seen me and turned to engage me. The ai however was not scanning like a human however so they didn't do this. This is in my opinion one of the biggest problems that allow a player to just sit in a house or compound and watch the pile of dead ai at the door way pile up. But I do understand what you mean. The ai shouldn't be able to magically have eyes in the back of their head. But every-once and a while they should quickly glance behind themselves. or something like that.

The setdir is unnatural and will open the 'milsim can of wormsTM'.

Ha! yeah I figured as much. Keep in mind that it wouldn't look quite so unnatural if the ai was already somewhat facing the player and only had to turn a small amount. But I can't imagine a lot of people would be open to it, although the slow aiming we have currently IMO is even more unnatural... But I am just kicking around ideas if you know what I mean.

Edited by -Coulum-

Share this post


Link to post
Share on other sites

That top video in which you await in ambush - the AI didn't seem like he was in Combat mode - did he have any Knowsabout value on you? If not, I've played PvP where humans were equally oblivious if I got into their compound (behind their front). If he did have an awareness that an enemy was nearby - would be great if AI could 'detect' that they were passing thru a doorway/entryway and automatically do a quick scan if they have suspicion (Knowsabout) that enemy is nearby. At least for Arma 3 I hope :)

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  

×