Jump to content
Sign in to follow this  
tpw

TPWC AI suppression system

Recommended Posts

Hi

Thanks for the tip. I have already solved the problem by adding a few lines to the original LOS script and made a separate one which stores and monitors the units that have spotted an enemy player. So far it has worked properly in hosted MP as well (if anyone is interested, I will post it but it's quite simple). The reason why I prefer TWP LOS is simple: I use it toghether with TWP AI suppression. Thanks anyway.

Just out of curiosity: if the condition is fulfilled (i.e. a soldier can see another), the script uses lookat and dotarget commands. How about their locality? Wouldn't it be enough to run them on the serever? I could test it myself I just haven't had time yet.

Share this post


Link to post
Share on other sites
Hi

Thanks for the tip. I have already solved the problem by adding a few lines to the original LOS script and made a separate one which stores and monitors the units that have spotted an enemy player. So far it has worked properly in hosted MP as well (if anyone is interested, I will post it but it's quite simple). The reason why I prefer TWP LOS is simple: I use it toghether with TWP AI suppression. Thanks anyway.

Just out of curiosity: if the condition is fulfilled (i.e. a soldier can see another), the script uses lookat and dotarget commands. How about their locality? Wouldn't it be enough to run them on the serever? I could test it myself I just haven't had time yet.

Care to share those "few lines" with us?

This mod, more than any other, was the result of peer-review coding.

Share this post


Link to post
Share on other sites

Sure, sorry. I did not really think that my work was of real value but here it goes:

The first modification of the LOS script (highlighted in red):

//MAXIMUM DISTANCE (M). LOS STUFF ONLY WORKS FOR UNITS CLOSER THAN THIS.

tpwlos_maxdist = 100;

//MINIMUM DISTANCE (M). ENEMIES ARE CONSIDERED "VISIBLE" NO MATTER WHAT, IF LESS THAN THIS DISTANCE.

tpwlos_mindist = 25;

//DELAY BEFORE LOS FUNCTIONS START.

tpwlos_sleep = 1;

//MY VARIABLES

thosewhocanseeus = [];

timers = [];

//LAUNCHES CHECKER SCRIPT

nul = execVM "checker.sqf";

/////////

//SET UP

The second modification of the original LOS script (highlighted in red):

if (tpwlos_cansee > 0) exitwith

//IF VISIBLE ENEMY

{

//IF AN AI PLAYER CAN SEE AN ENEMY HUMAN PLAYER THE TIMER STARTS

if ({_unit == _x} count [player1, player2, player3] == 0 && {_near == _x} count [player1, player2, player3] > 0 && {_unit == _x} count thosewhocanseeus == 0) then

{

thosewhocanseeus = thosewhocanseeus + [_unit];

timers = timers + [0];

};

_unit lookat _near;

_unit dofire _near;

//SHOW DEBUG BALLS

if (tpwlos_debug == 1) then

{

_ball = _unit getvariable "tpwlos_losball";

_ball hideobject false;

};

};

It works for playable units named player1, player2, etc. which can be changed or playableunits can be used instead.

My checker.sqf:

if (!isServer) exitwith {};

while {true} do

{

// FOR DEBUGGING 1

// hintsilent parsetext format ["%1<br />%2", thosewhocanseeus,timers];

// REMOVES AI WHO SPOTTED AN ENEMY HUMAN PLAYER BUT GOT KILLED AND REMOVES THE CORRESPONDING TIMER

_loop0 = count thosewhocanseeus;

if (_loop0 > 0) then

{

for [{_i=0},{_i<_loop0},{_i=_i+1}] do

{

_elementbeingchecked = thosewhocanseeus select _i;

if (!alive _elementbeingchecked) then

{

// FOR DEBUGGING 2

// hintsilent format ["He is dead: %1", _elementbeingchecked];

// sleep 2;

thosewhocanseeus set [_i, "toberemoved"];

thosewhocanseeus = thosewhocanseeus - ["toberemoved"];

timers set [_i, "toberemoved"];

timers = timers - ["toberemoved"];

};

};

};

// CHECKS IF ANY AI SPOTTED AN ENEMY HUMAN PLAYER MORE THAN 30 SECONDS AGO

if ({_x > 30} count timers > 0) then

{

// FOR DEBUGGING 3

// hintsilent "The alarm should go off.";

// sleep 2;

thealarmgoesoff = true;

publicvariable "thealarmgoesoff";

};

// ADDS 0.5 SECONDS TO EACH TIMER

_loop1 = count timers;

if (_loop1 > 0) then

{

for [{_i=0},{_i<_loop1},{_i=_i+1}] do

{

_elementbeingchanged = timers select _i;

_elementbeingchanged = _elementbeingchanged + 0.5;

timers set [_i, _elementbeingchanged];

};

};

sleep 0.5;

};

And of course in the init.sqf you have to run tpw_ai_los.sqf.

The lines highlighted in blue contain the commands which are executed if an AI can see an enemy human player for more than 30 seconds. In my script it sets and broadcasts a variable (with which I made an alarm sound but it can be used to trigger any kind of event).

I will be happy if anyone can make use of it. I have tested it once only but it seemed to work fine.

Edited by b1944

Share this post


Link to post
Share on other sites
In the spoiler is another set of test vids, they all include ai mods TPWC & selected pbo's from Zeus, SLX, GL4. The first vid shows the Zeus problem, the need to find cover before firing. The next three show the exact same zeus pbo's being used but now without the zeus problem, we use a slightly different mix and setup. The need for us keeping the zeus find cover pbo along with the other zeus ones we use is two fold, one of which is seen in a vid I posted on the page prior to this one, i.e. great ai reactions..

You mean this...

http://www.youtube.com/watch?v=7AkWnB0tca8

I mean these...

http://www.youtube.com/watch?v=TXtY7C-QIdI

http://www.youtube.com/watch?v=1ZldJ4HWRN8

http://www.youtube.com/watch?v=HYW2iHObuMg

All have Zeus findcover pbo present, however the bottom three have a slightly different mix of pbo's. Zeus still shows through, but without the find cover problem, and no, the zeus pbo's can't be getting overridden or buried completely, as we still see zeus ai reactions coming through, i.e. the vid previously posted..:p:rolleyes:

Not arguing though, if you think its broke, then thats fine..;)

Can you share this mix of PBO's that work... I would love to have those results..

Share this post


Link to post
Share on other sites

So unless my search skills are very lacking..I haven't managed to find any discussion on this so..

How do I go about removing the suppresion effects for the player, in the script version? It's nice, but the guinea pigs players on my missions said they'd rather not have it.

Share this post


Link to post
Share on other sites

I would like to disable player suppression too. The AI has to be made more "human" but the player is able to make the decision to duck or run without the suppression system forcing him to take cover.

Share this post


Link to post
Share on other sites

? The shaking? Not sure what you guys are talking about? I dont think this mod has any affect on players?(100% sure but I could be wrong...). We play with this in MP and nothing has changed on the player side. There is default BIS effects for players. Its not like you get shot at and loose all ability to move or be forced to go prone?

Share this post


Link to post
Share on other sites

The pbo version has some effects on the player if you enable them in the userconfig

//PLAYER SUPPRESSION SHAKE. 0 = NO SUPPRESSION, 1 = SUPPRESSION.

tpwcas_playershake = 1; //FORCED OFF IF RUNNING ON DEDICATED SERVER

//PLAYER SUPPRESSION VISUALS. 0 = NO SUPPRESSION, 1 = SUPPRESSION.

tpwcas_playervis = 1; //FORCED OFF IF RUNNING ON DEDICATED SERVER

Share this post


Link to post
Share on other sites

BIS shaking happens only when bullets hit the ground very near the player - which means just about never.

Here it happens when bullets fly nearby, no matter if they hit the ground or not.

This stops the experienced player from exploiting the AI - if you've played ArmA2 vs. AI for a while you get a good idea when they are capable of hitting you - so you can just sit there under fire and calmly snipe them with almost any weapon - while AI suffers the suppression effect.

Edited by metalcraze

Share this post


Link to post
Share on other sites

while running asr ai and the two tpw mods, im getting red target markers on enemy ai's and players (not the suppression markers) as if i was commanded by someone to target something. what have i set up wrong?

Share this post


Link to post
Share on other sites
while running asr ai and the two tpw mods, im getting red target markers on enemy ai's and players (not the suppression markers) as if i was commanded by someone to target something. what have i set up wrong?

it means debug is still enabled for you

See start of the thread, and open the spoiler section at:

Readme:

Please read this for full details of TPWCAS, including features, installation, configuration, caveats, credits and changelog.

---------- Post added at 15:05 ---------- Previous post was at 15:01 ----------

? The shaking? Not sure what you guys are talking about? I dont think this mod has any affect on players?(100% sure but I could be wrong...). We play with this in MP and nothing has changed on the player side. There is default BIS effects for players. Its not like you get shot at and loose all ability to move or be forced to go prone?

If you use TPWCAS (or special version for Dedicated Servers 'TPWCAS_DSC') on server, and do not run TPWCAS on client (you can with normal TPWCAS but should not with TPWCAS_DSC) then the player effects are not active by default (they won't work while this requires client (so player pc) side code as well)

Share this post


Link to post
Share on other sites

debug was off and im not seeing the coloured balls, but the thing is that im seeing the red target marker on the enemy

Share this post


Link to post
Share on other sites
debug was off and im not seeing the coloured balls, but the thing is that im seeing the red target marker on the enemy

What difficulty level are you playing at?

Share this post


Link to post
Share on other sites

I'm getting the same issue as LeChuckle, playing on Veteran difficulty on a dedi server. TPWAC and LOS scripts running as well as ASR_AI.

Even if I don't see the enemy unit, one of these red target circles appear on it, following it everywhere and letting players cheat.

Share this post


Link to post
Share on other sites
debug was off and im not seeing the coloured balls, but the thing is that im seeing the red target marker on the enemy

How does a 'red target marker' look like?

You're sure it's not a red debug ball?

(did you perhaps test with debug set to 1 to see the diff?)

Debug examples in beta version (currently only red) E.g.

Edited by Ollem

Share this post


Link to post
Share on other sites
I'm getting the same issue as LeChuckle, playing on Veteran difficulty on a dedi server. TPWAC and LOS scripts running as well as ASR_AI.

Yes we have this problem also. (+using ACE+BIS beta)

Red Balls above all units from mission start->end

If you think it's related please help

:(

*p.s. userconfigs both server and client already checked for enabled debugging..but all seem in place


*edited later

I cleaned and reinstalled to server all 3 addons (ASR_AI//TPWCAS//TPW_LoS) and installed latest BIS beta patch.

*I must mention i disabled TPWCAS's text notice/hint when the mission starts (for testing)

Connected to server with 1 mate and played 1 of missions where the problem appeared..and no Red Ballz.

The fact is i must test it more-with more players-non until tomorrow..

Edited by GiorgyGR

Share this post


Link to post
Share on other sites
How does a 'red target marker' look like?

You're sure it's not a red debug ball?

(did you perhaps test with debug set to 1 to see the diff?)

Debug examples in beta version (currently only red) E.g.

I believe he's referring to the red brackets around a target. Normally these come up when you're not the leader and LEAD orders you to target/attack a target. I had noticed these a while ago popping up (as lead) and thought it was a BIS change in one of the betas. Now that I think about it, I started noticing it after using the LOS script version. I haven't really used the suppression mod yet, so I'm thinking that's where it might be coming from.

Share this post


Link to post
Share on other sites

i tried expert difficulty after seeing Tankbusters post and theyre gone now. usually, i play on veteran. which difficulty setting affects this?

Share this post


Link to post
Share on other sites

gatordev is correct about the red brackets.

@LeChuckle, the expert mode gets rid of all that cheaty stuff anyways, so playing on expert is a solution..but most people usually are running on veteran anyways.

I really think this is the LOS script causing it

Share this post


Link to post
Share on other sites

Hi everyone. Sorry about my lack of input over the last month or so, RL issues have sapped some of my enthusiasm. Thanks to Ollem for continuing to keep development moving too. I will try to get back on the horse.

Regarding the targetting brackets Khaki and others are seeing, lines 229 and 230 of the TPWLOS script dicate what a given unit does if it has line of sight to an enemy:

_unit lookat _near; 
_unit dofire _near;

In particular, if _unit also happens to be the player, then dofire might bring up the targetting bracket.

Khaki, if you are running the script version, try changing line 101 from

if ((side _x != civilian) && (lifestate _x == "ALIVE")) then 

to

if ((side _x != civilian) && (lifestate _x == "ALIVE") && !(isPlayer _x)) then 

This should only apply LOS calcs to non-players. My coding is a bit rusty after time off, so I could be wrong.

Share this post


Link to post
Share on other sites

What happens if i m using addon version and seeing this over Human and A.I. (friendly and enemy)?

Red_Busting_Ballzz.jpg

*ps We only see RED colored ballzz from mission start to the end

Edited by GiorgyGR

Share this post


Link to post
Share on other sites
Thanks for your continued work on this script/addon.

Wanting to try out the dedi-only version this weekend - is this the most recent one?

http://forums.bistudio.com/showthread.php?136304-TPWC-AI-suppression-system&p=2213377&viewfull=1#post2213377

:o

Yes, this is still latest version.

I'm still working on an updated version - hope to release soon.

PelleJones reported some FPS drop, most likely caused by the embedded TPWLOS.

So if you are expecting more the 20 players and a lot of close AI, I recommend to disable for now.

In updated version the TPWLOS part will be FPS aware: if FPS drops below threshold TPWLOS effect will stop or decrease

---------- Post added at 18:23 ---------- Previous post was at 18:20 ----------

What happens if i m using addon version and seeing this over Human and A.I. (friendly and enemy)?

*ps We only see RED colored ballzz from mission start to the end

This is really odd.

What version of TPWCAS and/or TPWLOS are you using?

Please notice there are currently a few different setups possible.

TPWCAS_DSC is a special version which should only be installed on a Dedicated Server and non of the clients (= player pc's) are allowed to have TPWCAS and/or TPWLOS running

Share this post


Link to post
Share on other sites

PelleJones reported some FPS drop, most likely caused by the embedded TPWLOS.

So if you are expecting more the 20 players and a lot of close AI, I recommend to disable for now.

Bugger - just noticed there isn't a disable option in the TPWCAS_DSC (Dedicated Server) PBO version yet...

Thought I already added it in this version.

Will be there for sure in next release.

For now, as a workaround in case you experience low FPS, you my want to set the following parameters in userconfig file (tpwcas_dsc.hpp):

//MAXIMUM LOS DISTANCE (M). LOS STUFF ONLY WORKS FOR UNITS CLOSER THAN THIS.

tpwlos_maxdist = 50;

//MINIMUM LOS DISTANCE (M). ENEMIES ARE CONSIDERED "VISIBLE" NO MATTER WHAT, IF LESS THAN THIS DISTANCE.

tpwlos_mindist = 25;

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×