Jump to content
Sign in to follow this  
Guest

Request for new scripting command: ClearNearTargetsArray

Recommended Posts

Guest

/EDIT

A new, final thread has been made, which properly describes the function needed to accomplish the clearing of a units list of known enemies :

ClearKnowsAboutList

This thread here is now outdated, and incorrect in the function name, as the TargetArray is not actually the issue but instead it is a units knowsAbout listing.

Please refer to the new thread link.

__________________________________________________________________________________________________________________________

Hello

I recently stumbled on the discovery that switching an AI unit to a new group can clear out their NearTargets array information, and this has been the only reliable way that I have found to get AI units to be able to effectively advance towards a location where an enemy presence was just recently discovered by the AI. The ability to use this 'group swap' to clear out the target array actually provides the result (through some extra work) of units behaving in an aggressive form, somewhat mimicking AI behavior seen in other tactical shooter games, like Ghost Recon, Hidden And Dangerous 2, these two come to mind.

I would like to ask for maybe a future scripting command that allows mission scripters to simply wipe clean an Ai Unit or Group's (or both) NearTarget array. I am both asking for this because if the clearing out of the target array through group swapping is ever changed in the future it will eliminate the possibility of getting AI to be able to operate in such a fashion, and also it seems it could possibly be a simple scripting command to provide.

Right now, with using the group swap method along with both NearTarget's Position Accuracy (this is accessed in between array resets) and Line Intersect, it is very possible to move units in a believable fashion towards recently discovered enemy positions, and this is doable in a dynamic fashion where they will track down enemies and stop along when visual contact is made to engage, and then after a brief amount of time they will continue forward.

Thanks.

Edited by Guest

Share this post


Link to post
Share on other sites
Guest

Hey thanks :)

It seems the Arma tracker thing wont let me login with my BI account info, I tried a password reset and the tracker tells me it does not even recognize my username/email (or both). I went through some issues to get my account re-instated just recently ironically, every time I tried to reset my password it would not recognize it, and had to get support to get me past the issue to get the account activated - so I'm kind of leery of resetting things again to try to get access to the tracker.

I appreciate the response though.

I wasn't really prepared to get into all of that, if the topic dies it's not a big deal, thought I'd just give it a shot.

Share this post


Link to post
Share on other sites

Nice catch Ed!

This could help not only to make AI advance but also making them to fall back. As Attorney said put it up on FT and you have another vote ;)

/KC

Share this post


Link to post
Share on other sites

i just recently "repaired" my feedback account so i could finally make some tickets that i was collecting over some time. if you still have problems feel free to send me all the info via PM and i'll make that ticket for you.

Share this post


Link to post
Share on other sites
Hey thanks :)

It seems the Arma tracker thing wont let me login with my BI account info, I tried a password reset and the tracker tells me it does not even recognize my username/email (or both). I went through some issues to get my account re-instated just recently ironically, every time I tried to reset my password it would not recognize it, and had to get support to get me past the issue to get the account activated - so I'm kind of leery of resetting things again to try to get access to the tracker.

I appreciate the response though.

I wasn't really prepared to get into all of that, if the topic dies it's not a big deal, thought I'd just give it a shot.

Feedback Tracker is a separate entity, you need to register on it regardless of whether you have a forum account or not.

Share this post


Link to post
Share on other sites

hot damn! This could be the key to remedy the stuck team subordinates ? Voted

Share this post


Link to post
Share on other sites
hot damn! This could be the key to remedy the stuck team subordinates ? Voted

Yes and no.

In theory, if an AI group kills all of it's closest enemies and then you clear the array, they should return to normal and then be able to move somewhere else.

If you clear their nearTargets array while they are in combat (to get them to move to cover for example), it would fill up with enemy units instantly and they would continue to move slowly as they are still in combat mode.

The issue lies elsewhere and is how they move when aware of enemies. This would be nice for stealth scenarios (sneaking and hiding) and getting units to return to normal AFTER combat, but I doubt it would fix the current slow-moving behaviour DURING firefights.

Share this post


Link to post
Share on other sites
Guest

As long as an ai unit has visual sight of an enemy, their movement is practically impaired, regardless of target array clearing, it just gets re-populated with any enemies within sight. Although I've done nearly all of my tests (with the group swap) by locking the units to combat mode, which does slow some of them down (some randomly will run as well), aware mode could likely be set as well, and the units would probably be more controllable - of course they would go back into combat mode upon visual sighting again, and hence could be switched back to aware upon either/or a generic script loop or something more exact like checking the position accuracy of near targets.

But, what this does is allows units to be fully mobile immediately after losing visual sight of any enemies. This is particularly helpful when players are engaging enemy units, where players are more prone to use cover, duck behind walls, etc, and in these scenarios the AI can be scripted to advance to the players last known position when visual contact is lost. I've done more testing than what I even want to think about here lol - the results can really be impressive when you have a small town populated with say 10 Opfor in a group, and you the player fire on them, taking out a few, 20 seconds later you find that the remaining 8 units are filtering through the town seeking you out, just because by clearing out the target array of those units they were able to be moved out.

Position Accuracy can be checked on each units nearTargets list, and very low values can be used to both create new move positions and stop clearing the target array due to the indication of an enemy sighting just recently happening.

Although to get more than basic functionality from the clearing of the target arrays does take some scripting work, nonetheless, the potential of the new mobile functionality of AI units in combat scenarios (in particular scenarios that have good cover clutter, like towns, and ragged terrain) is really pretty significant with the use of the target array clearing in contrast to what the AI is capable of without it. I for one simply have not found anything that comes close in neither tests nor forum searches.

Ideally, it would be great to have a whole new dynamic unit behavior setting, like "Aggressive", or "All Costs", or something like that, but we don't, and I don't count on some big Ai update like this happening any time soon. The target array clearing is ironically a really simple little 'trick' that at least opens the doors for some neat stuff to be done with the ai that normally Arma 3's ai just doesn't like doing during combat scenarios.

/Edit

Something that just came to mind though. Is the group swap really just clearing out the target array, or is it essentially clearing out all known enemies. As, from the description of the NearTargets command, the array elements values are dependent on the KnowsAbout value. I am actually starting to question if I'm asking for the right thing here, like you said Das Attorney, without actually clearing out the known enemies, clearing out the target array may actually just cause it to simply instantly repopulate with all known enemies, regardless of sight - either way as long as the list of known enemies existed, the unit would still be exhibiting stunted movement behavior. If this were to be the result of a new ClearTargetArray, then really, it would be basically useless. Unless the command would completely clear out all known enemies to a unit exactly like the group swap does, the effect would have little impact. I might need to re-name and re-describe the desired command in the Tracker.

Edited by Guest

Share this post


Link to post
Share on other sites
Guest

After doing some tests, I have discovered that indeed the truly needed script command here is actually ClearKnowsAboutList, as this is the essential function needed, yet I am attaching the clearing of the target array as well in case for any reason during the clearing of the KnowsAbout list the Target Array does not get immediately cleared/updated as well.

Here is the link to the new, proper thread :

http://forums.bistudio.com/showthread.php?188248-Request-for-new-spcriting-command-ClearKnowsAboutList

Moderators are welcome to close/lock this thread, it is no longer relevant.

Share this post


Link to post
Share on other sites

I did some work around the time you first posted the findings. The attempt was to clear the knowsAbout in order that the group would continue advancing and exit danger FSM. All is needed is the ability to clear nearTargets array. It may be possible to do this directly via cycling through nearTargets array and use the set command to clear the knowsAbout. Won't have time to test htat for a few weeks though.

The code used:

//========================== Run on server

QS_fnReveal = {
private ["_enemyUnits","_unit"];
_unit = _this select 0;
_enemyUnits = [];
{
	if ((side _x) isEqualTo west) then {
		0 = _enemyUnits pushBack _x;
	};
} count allUnits;
if ((count _enemyUnits) > 0) then {
	{
		_unit reveal [_x,0];
	} count _enemyUnits;
};
}; 

//=========================== Run on server

[] spawn {
private ["_group"];
QS_attackTest = TRUE;
while {QS_attackTest} do {
	{
		_group = _x;
		if (_group getVariable "QS_aggressive_group") then {
			{0 = [_x] call QS_fnReveal;} count (units _group);
			systemChat "Aggression";
		};
	} count allGroups;
	sleep 15;
};
};

//=========================== Apply this to unit init, via debug

(group this) setVariable ["QS_aggressive_group",TRUE];

^ There are some improvements that can be made above, and I did not access or try to do anything with the nearTargets array, which may have yielded some results.

Share this post


Link to post
Share on other sites

If I'm reading this correctly your trying to reduce knowsabout by using _unit reveal [_x,0]; to set it to zero.

As far as I know this won't work, it will only increase the value not reduce it, only time will do that or as already mentioned swapping the group.

The ability to make units forget has been requested before in A2 http://dev.withsix.com/issues/27801

Edited by F2k Sel

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  

×