Jump to content
ollem

TPWCAS for A3 - AI Suppression System - suggestions/comments/ideas discussion

Recommended Posts

Yes I am :)

Is this the problem ?

I don't know but I think asr_ai3 is not HC aware. There are loads of isserver (exit) tests : so for me, scripted spawns on the HC do not use asr_ai3.

And tpwcas :

1st - the HC recognition doesn't seem to work

2nd - tpwcas uses asr_ai3 to change skills

I don't know if tpwcas can be used alone.

What I know is that when using asr_ai3+tpwcas on a dedicated server without HC -> guys love the AI this way

Edited by gagi

Share this post


Link to post
Share on other sites

the files were setup already in that fashion

this is the current setup in _decskill:

if (  isNil {_unit getvariable "tpwcas_originalaccuracy"} ) then 
{
    _unit setvariable ["tpwcas_originalaccuracy", _unit skill "aimingAccuracy"];        
    _unit setvariable ["tpwcas_originalshake", _unit skill "aimingShake"];      
    _unit setvariable ["tpwcas_originalcourage", _unit skill "courage"]; 
};

_originalaccuracy = _unit getvariable "tpwcas_originalaccuracy";        
_originalshake = _unit getvariable "tpwcas_originalshake";      
_originalcourage = _unit getvariable "tpwcas_originalcourage";       
_shots = _unit getvariable "tpwcas_enemybulletcount";     

_newaccuracy = (_originalaccuracy - (( _originalaccuracy * _dec) * _shots )) max tpwcas_minskill; 
_newshake = (_originalshake - ((_originalshake * _dec) * _shots )) max tpwcas_minskill;
_newcourage = (_originalcourage - ((_originalcourage * _dec * (1 - _originalcourage)) * _shots )) max tpwcas_minskill;
_unit setskill ["aimingAccuracy",_newaccuracy];         
_unit setskill ["aimingShake",_newshake];        
_unit setskill ["courage",_newcourage]; 

and this is what i have in _incskill ;

	if (  isNil {_unit getvariable "tpwcas_originalaccuracy"} ) then 
{
    _unit setvariable ["tpwcas_originalaccuracy", _unit skill "aimingAccuracy"];        
    _unit setvariable ["tpwcas_originalshake", _unit skill "aimingShake"];      
    _unit setvariable ["tpwcas_originalcourage", _unit skill "courage"]; 
};

_originalaccuracy = _unit getvariable "tpwcas_originalaccuracy";        
_originalshake = _unit getvariable "tpwcas_originalshake";      
_originalcourage = _unit getvariable "tpwcas_originalcourage"; 

_currentaccuracy = _unit skill "aimingAccuracy"; 
_currentshake = _unit skill "aimingShake"; 
_currentcourage = _unit skill "courage"; 

Im thinking it is something simple that were overlooking ... I was thinking about the Init.sqf checks for isServer, etc and i was wondering if it was the check itself that is keeping any ai on a Headless client from being affected by this mod.

this is the current client , hc, server check:

// Multi Player Server or HC Mode (tpwcas_mode 2 or 3)
if ( ( ( isServer || tpwcas_isHC ) ) && ( isMultiPlayer ) ) then 
{  

if ( isNil "tpwcas_mode" ) then // read tpwcas_mode value from userconfig file
{
	tpwcas_mode = getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_mode");	
};

if ( !((tpwcas_mode == 2) || (tpwcas_mode == 3) || (tpwcas_mode == 0) || (tpwcas_mode == 5)) ) then 
{
	diag_log format ["%1 forcing tpwcas to value [3]: determined tpwcas_mode value: [%2]", time, tpwcas_mode];
	tpwcas_mode = 3; 
}; 

if ( tpwcas_mode == 5 ) then // => DEPRECATED
{
	tpwcas_mode = 0;
	diag_log format ["%1 disabled tpwcas by userconfig file: tpwcas_mode = %2", time, tpwcas_mode];
};

diag_log format ["%1 tpwcas_mode = %2 - Server: [%3] - MP: [%4] - config: [%5] - isNil: [%6]", time, tpwcas_mode, isServer, isMultiPlayer, getnumber(configfile>> "tpwcas_key_setting"  >> "tpwcas_mode"), isNil "tpwcas_mode"];
};

could it be this that is the issue? i doubt it but that is all it can think of some hc check somewhere is gumming up the works..

Edited by Lordprimate

Share this post


Link to post
Share on other sites

I was thinking if :

the guy who made asrai can make a version without any server check that we will launch only on the HC and the same for tpwcas : remove any check and we test this version on the HC only.

What do you think ?

Share this post


Link to post
Share on other sites
Yes I am :)

Is this the problem ?

Could be... for TPWCAS in combination with UPSMON and ASR_AI3 I've seen AI behavior which was 'not as expected': AI kept prone in a column without moving again.

Log files showed some ASR error messages: don't know yet the impact of these errors.

On top of that BIS has made some changes to AI behavior over the past months which might interfere with either TPWCAS, UPSMON and/or ASR_AI3.

I'm curious about experience of other people here.

Do you see strange results? Is TPWCAS still working for you like it did in A2?

Share this post


Link to post
Share on other sites

Yeah the same for me ... asr ai has lot of exit if not server ... I don't know how to remove these tests and compile a version for HC use only ...

Share this post


Link to post
Share on other sites
Could be... for TPWCAS in combination with UPSMON and ASR_AI3 I've seen AI behavior which was 'not as expected': AI kept prone in a column without moving again.

Log files showed some ASR error messages: don't know yet the impact of these errors.

On top of that BIS has made some changes to AI behavior over the past months which might interfere with either TPWCAS, UPSMON and/or ASR_AI3.

I'm curious about experience of other people here.

Do you see strange results? Is TPWCAS still working for you like it did in A2?

If i can help, a player of our community add the tpwcas script to the mcc template mission who use the UPSMON and we see exactly the bug you describe.

With MCC with TPWCAS script on a server with ASR AI and HC, the TPWCAS doesn t work.

If we turn off the HC, everything work but we have sometimes some ia who are stuck and does nothing and other time they are really impressives. (same thing with TPWCAS addons)

We use the VTS too and Dulgan already describe what problems we have.

We have some server crashs with asr ai too, i already contacted Robalo to inform him and gave him our .rpt.

Share this post


Link to post
Share on other sites
... I was thinking about the Init.sqf checks for isServer, etc and i was wondering if it was the check itself that is keeping any ai on a Headless client from being affected by this mod.

The HC logs posted in this thread show that TPWCAS is started on HC, so it is a nother issue.

While script version did work for me on HC (besides the issues mentioned above), I will have a look what's different in both versions

--- update -----

It's important that the HC is using the same config file like the server in case of mod version!

Unlike regular clients (= player pc's) who get the right tpwcas_mode value pushed from the server, the HC will read the tpwcas_mode from the "\userconfig\tpwcas\tpwcas_v2.hpp" file just like the server.

(other parameters are pushed)

Edited by Ollem

Share this post


Link to post
Share on other sites

HC issue might be caused due to some code in tpcas_mainloop.sqf.

However, this would only explain issue with HC in tpwcas_mode = 3.

For tpwcas_mode = 2 it *should* work already with current version.

{ //foreach start

		if ( tpwcas_mode == 3 ) then // multiplayer (dedicated) server no client setup
		{
			_unitCheck =[color="#FF0000"] !(isPlayer _x);[/color]
		}
		else // singleplayer or (hosted/dedicated) server with clients enabled or headless client
		{
			_unitCheck = (local _x);
		};

In the first tpwcas releases with HC support I used to have a dedicated mode for hc: tpwcas_mode = 4.

As of 4.5 I removed this and implemented auto detection of HC.

I never noticed an issue with HC in combination with 'tpwcas_mode = 3', but I didn't use/test HC a lot either.

I still need to verify if really the case, but just looking at the above piece of code, It seems both server and HC both try to perform tpwcas actions on the same AI, which may result in very strange behavior.

While we assume that for tpwcas_mode = 3 all AI is local on the server anyway, and in case of combination with HC local on either server or HC, we could simply add a 'local' check, which should avoid dual behavior

{ //foreach start

		if ( tpwcas_mode == 3 ) then // multiplayer (dedicated) server [color="#FF0000"]or headless client [/color]and no other client setup
		{
			_unitCheck =[color="#FF0000"] ( !(isPlayer _x) && (local _x) )[/color];
		}
		else // singleplayer or (hosted/dedicated) server with clients enabled or headless client
		{
			_unitCheck = (local _x);
		};

To be continued / confirmed..

Edited by Ollem

Share this post


Link to post
Share on other sites

Can you tell in how far tpw_mods conflicts with this? He has "engine based supression" built in. Maybe in first posting for all future confused souls like me. :rolleyes:

Share this post


Link to post
Share on other sites
Can you tell in how far tpw_mods conflicts with this? He has "engine based supression" built in. Maybe in first posting for all future confused souls like me. :rolleyes:

TPWCAS started as a SinglePlayer mod, but when I took over converted it into a MultiPlayer focussed mod which still works in SinglePlayer.

Tpw's TPWMOD is developed for SinglePlayer only, though some sub-mods do work on MultiPlayer too.

In case of SinglePlayer game I think you better focus on TPWEBS.

TPWEBS v1 couldn't work at all on MultiPlayer due to the concepts used.

After recent code change (read: full new version from scratch while although the idea was great, it had too many issues) it should be able to make it MP compatible.

The difference between TPWCAS and TPWEBS is that TPWCAS is AI focused (checks if AI is close to a bullet) and TPWEBSv2 is bullet focused (checks if bullet is close to AI).

Tpw already shared his code with me and while it seems the new concept has performance advantages for SP, it is on my todo to check if the new code could have advantages for MP version too.

Share this post


Link to post
Share on other sites
HC issue might be caused due to some code in tpcas_mainloop.sqf.

However, this would only explain issue with HC in tpwcas_mode = 3.

For tpwcas_mode = 2 it *should* work already with current version.

{ //foreach start

		if ( tpwcas_mode == 3 ) then // multiplayer (dedicated) server no client setup
		{
			_unitCheck =[color="#FF0000"] !(isPlayer _x);[/color]
		}
		else // singleplayer or (hosted/dedicated) server with clients enabled or headless client
		{
			_unitCheck = (local _x);
		};

In the first tpwcas releases with HC support I used to have a dedicated mode for hc: tpwcas_mode = 4.

As of 4.5 I removed this and implemented auto detection of HC.

I never noticed an issue with HC in combination with 'tpwcas_mode = 3', but I didn't use/test HC a lot either.

I still need to verify if really the case, but just looking at the above piece of code, It seems both server and HC both try to perform tpwcas actions on the same AI, which may result in very strange behavior.

While we assume that for tpwcas_mode = 3 all AI is local on the server anyway, and in case of combination with HC local on either server or HC, we could simply add a 'local' check, which should avoid dual behavior

{ //foreach start

		if ( tpwcas_mode == 3 ) then // multiplayer (dedicated) server [color="#FF0000"]or headless client [/color]and no other client setup
		{
			_unitCheck =[color="#FF0000"] ( !(isPlayer _x) && (local _x) )[/color];
		}
		else // singleplayer or (hosted/dedicated) server with clients enabled or headless client
		{
			_unitCheck = (local _x);
		};

To be continued / confirmed..

Implementing and pushing out update ASAP.... the funny thing is, that bit of code, is also what i was looking at when i posted up about the client/server/HC checks. I know the logs showed it enabled, but something was gumming up the works...

GAGI: tpwcas does NOT require ASR_AI. It only detects if it is running and then calls a function to aid in setting unit skills under suppression etc... if tpwcas does Not detect asr_ai it still affects AI's skill.. Just with out the help of asr_ai.

tortuosit : i have run tpwcas and tpw_mods together with out any seeming odd behavior. as ollem said some things work in MP but some dont. but i havent seen any really weird things happen when both are running.. Honestly its not hard to run them both and see for yourself.. and the cool thing is its easy to not run a mod if it does causes problems, just removed it from the launch parameters or from the ingame expansions menu....

===================================================================================================================================

UPDATE tpwcas_v2.02 test

fix posted by ollem above implemented

ARMA 3 tpwcas_v2.02 test

Edited by Lordprimate

Share this post


Link to post
Share on other sites

I nevet got the debug balls as soon as i launch with hc

Seems the same again

ps : asrai removed

Edited by gagi

Share this post


Link to post
Share on other sites
TPWCAS started as a SinglePlayer mod, but when I took over converted it into a MultiPlayer focussed mod which still works in SinglePlayer.

Tpw's TPWMOD is developed for SinglePlayer only, though some sub-mods do work on MultiPlayer too.

In case of SinglePlayer game I think you better focus on TPWEBS.

Thanks for taking the time and sharing information; I THINK future players will ask the same question and we need to point them here :) Also there is name confusion (both share "tpw" in the name and one mod creators name is tpw (Theodore Peter Winterbottom?) :D.

Share this post


Link to post
Share on other sites
Thanks for taking the time and sharing information; I THINK future players will ask the same question and we need to point them here :) Also there is name confusion (both share "tpw" in the name and one mod creators name is tpw (Theodore Peter Winterbottom?) :D.

TPWCAS was started by TPW too... I assisted him with making it MP compatible and continued to work on it when TPW took an ArmA break.

Share this post


Link to post
Share on other sites

Whats the latest script version that should be working? I see the "Arma3 tpwcas_v2.02 test" download a few posts up dated the 22nd October, but this is the latest @mod version - is there an up-to-date script version to try too?

EDIT: So Ollem's first post in this thread has: tpwcas_A3 v19-10-2013 and downloads @tpwcas_v2.7 dated the 21st October.

So there are two MOD versions released on consecutive days, with different version numbers?

I really appreciate that you have both undertaken to get this working for Arma3 in MP - maybe you should use something like bitbucket and get you both working on the same bit of code, and only release stuff on here that you've both agreed on?

(I'm looking at this for multiplayer/dedicated server, no HC)

Edited by zach72

Share this post


Link to post
Share on other sites

Zach72 if you look at the version numbers you will see that they are consecutive as well.. and those links that ollem posted are links to versions i have posted earlier in this thread. Ollem just hasent updated the first post yet. rest assured that there differences are minute and are shown in posts in this thread maybe 1 or two pages back. As far as a script version goes. I can pull the .sqf files out and merge with ollems last posted script version, Give it a test and post it.. Give me a few, unless ollem beats me to it!

Share this post


Link to post
Share on other sites

isHC = (!(isServer) && !(hasInterface))

Sent from my iPhone using Tapatalk - now Free

Share this post


Link to post
Share on other sites
I'm looking at this for multiplayer/dedicated server, no HC

As far as I can tell, the lastest test mod version is fully functionnal with this configuration.

Share this post


Link to post
Share on other sites

Yeah it´s ok without hc!!!

I heard that scripts for clients are broken for the moment...

Perhaps the problem is due to a bug in arma code not playing post init or pre init scripts... No clue about this bug. There is an explanation on xen domination thread somewhere on the net...

Sent from my iPhone using Tapatalk - now Free

Share this post


Link to post
Share on other sites
UPDATE tpwcas_v2.02 test

fix posted by ollem above implemented

ARMA 3 tpwcas_v2.02 test

The problem is still present, doesn't work with HC and spawning units (not tried with mission with IA already spawned).

Gagi did you test with HC and without AsrAI ?

Share this post


Link to post
Share on other sites

Updated script-only version based on LordPrimate's latest mod code:

https://dl.dropboxusercontent.com/u/96469595/tpwcas_a3/tpwcas.zip

Main changes compared to LordPrimate's version:

- fixed debug balls/smoke for MP game (tpwcas_mode = 2 is needed)

- evasive movement will only be triggered when no close cover is found (added pink debug smoke effect when triggered)

- removed 2 evasive options which required additional event handler = additional overhead (though very limited) on server and network

- renamed 'borrowed' functions to tpwcas function names to avoid potential conflicts with other mods

- included 'behaviour' change in suppression (e.g. "SAFE" to "COMBAT"), so (improved) default BIS AI behaviour playes a more important role

- added doMove in case unitPos from "Middle" back to "Auto" to fix (potential) raise-lower weapon loop for AI

- added option to ignore specific AI for TPWCAS suppression, e.g when put in guard tower: use in unit's init: _this setVariable ["tpwcas_ignoreUnit", true];

- Some Headless Clients tweaks

- other minor changes

Edited by Ollem

Share this post


Link to post
Share on other sites
Updated script-only version based on LordPrimate's latest mod code

Thanks a lot for the update, I'll give it a look asap.

Is this script version conflicting with the mod version ?

If it is, is it possible to have a mod version ?

Thanks again, can't wait to test it :)

Share this post


Link to post
Share on other sites

When I test in the editor I have one error that spawn during all the test.

[bIS_Func_MPexe] function "" not found.

I don't have anymore the b_detect error.

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

×