Jump to content
Sign in to follow this  
tpw

TPWC AI suppression system

Recommended Posts

Is works very well on local hosted, but isn't working too well on my dedi. Anyone give me any ideas? My other problem is that addCamShake does not work. I wonder if I need to reinstall the whole game? I normally run every new beta without fail.

Will also investigate mod conflicts,

Share this post


Link to post
Share on other sites

addCamShake does not work for me either - but I'm pretty sure we would need some local client code for that to work.

Suppress works - at least somehow - during my 1 minute test on dedicated

Edited by Ollem

Share this post


Link to post
Share on other sites

Hi all. Good to see no-one's computers exploded using TPWCAS2 while I was asleep.

The good thing now is that we can split the optimisation work. Bdetect is a masterpiece but Fabrizio_T admits that it's alpha code, with lots of scope for him to optimise. -Coulum- and I (and all you welcome contributors) can concentrate on getting TPWCAS itself feature complete and smooth.

I think we're always going to have issues with bullet detection on dedi servers, due to trying to reliably catch very fast events. Again, the only short term fix I can think of is to increase the detection radius around each bullet from 10 to say 15 or 20. I hate to say it, but a different framework might end up being necessary for MP, perhaps a vector based system. Unless Professore Fabrizio_T has even more tricks up his sleeve.

Share this post


Link to post
Share on other sites

Just something to think about:

Is it really necessary to reliably detect any single bullet?

If every now and then a bullet is missed by the suppression algorithm it just adds some more randomness without compromising the purpose of the module at all.

So if you can safe significant code complexity and performance of the detection algorithm by allowing a few bullets to be ignored - just do it.

I really enjoy the mod a lot as far as AI behavior is concerned. But please think about the shake effect on player suppression. IMHO forcing shake to the player is very frustrating, and for me it even tends to be an immersion breaker. In real life the suppression effects are generated by the stress one encounters, not by the environment. When I encounter stress in ArmA my mouse shakes automatically, you do not need to do that for me ;-)

And finally:

Many thanks for the mod and keep up the great work!

Share this post


Link to post
Share on other sites
Just something to think about:

Is it really necessary to reliably detect any single bullet?

If every now and then a bullet is missed by the suppression algorithm it just adds some more randomness without compromising the purpose of the module at all.

So if you can safe significant code complexity and performance of the detection algorithm by allowing a few bullets to be ignored - just do it.

I really enjoy the mod a lot as far as AI behavior is concerned. But please think about the shake effect on player suppression. IMHO forcing shake to the player is very frustrating, and for me it even tends to be an immersion breaker. In real life the suppression effects are generated by the stress one encounters, not by the environment. When I encounter stress in ArmA my mouse shakes automatically, you do not need to do that for me ;-)

And finally:

Many thanks for the mod and keep up the great work!

Thanks oldy41

You are entirely right about not needing to detect every single bullet. And it seems to happen anyway once things get very hectic. On dedi servers it only seems to detect occasional bullets, which might be going a bit too far...

Player suppression is optional, just switch it off if you'd prefer to suppress yourself :)

Share this post


Link to post
Share on other sites

Player suppression is optional, just switch it off if you'd prefer to suppress yourself :)

Right, but the config switch does not work with the current pbo version (as already mentioned before ;-) ). And the color saturation effect alone is fine with me.

But I will be completely happy as long as you do not forget to repair the userconfig processing for the next pbo version :bounce3:

Share this post


Link to post
Share on other sites

Yes well I did completely fuck the last PBO, but I promise not to do it again! In my defense, I am old and stupid

I will PBO up this latest version shortly. And it will be configurable! I might make camera shake and saturation separately configurable too.

Share this post


Link to post
Share on other sites

Cool, great work.

PBO version is server friendly?

Share this post


Link to post
Share on other sites
I love you.

EDIT: Default config has Debugging on, you might want to change that.

This is a true beta release, so debugging is on by default so that we can get more feedback. The userconfig actually works this time, so switch it off if you want.

EDIT: Thanks for the love!

Edited by tpw

Share this post


Link to post
Share on other sites
Hi everyone.

Here's the addon version (includes script)

2.00beta http://filesonly.com/download.php?file=339TPWC_AI_SUPPRESS_200.zip

I'm too impatient to wait for testing, and will frontpage it too.

Very nice.

I'm working on bdetect v0.6, hope to get it polished and ready in the afternoon / evening.

It's a "reliability" release, not a "performance" one.

Should be backward compatible with 0.5 (and 0.51).

tpw, please can you tell me what you added in 0.51 other than magazine type?

Too lazy to diff ;)

Features at the moment:

* Native support for handling of spawned unit ( yet raw ).

* Introduced variable "bdetect_bullet_min_distance": (meters, Default 25). Bullets having currently travelled less than this distance are ignored.

* Introduced variable "bdetect_bullet_initial_min_speed": (meters / second, Default 360). Bullets initially slower than this are ignored (good for subsonic bullets skipping, without having to individually add ammo to "bdetect_skip_mags" array).

* Enhanced debug functions, so that you can selectively log by debug "level".

More to come.

Share this post


Link to post
Share on other sites
Very nice.

I'm working on bdetect v0.6, hope to get it polished and ready in the afternoon / evening.

It's a "reliability" release, not a "performance" one.

Should be backward compatible with 0.5 (and 0.51).

tpw, please can you tell me what you added in 0.51 other than magazine type?

Too lazy to diff ;)

Features at the moment:

* Native support for handling of spawned unit ( yet raw ).

* Introduced variable "bdetect_bullet_min_distance": (meters, Default 25). Bullets having currently travelled less than this distance are ignored.

* Introduced variable "bdetect_bullet_initial_min_speed": (meters / second, Default 360). Bullets initially slower than this are ignored (good for subsonic bullets skipping, without having to individually add ammo to "bdetect_skip_mags" array).

* Enhanced debug functions, so that you can selectively log by debug "level".

More to come.

Hi fabrizio_T

Great to hear you're further refining your incredible work.

I added this to bdetect_fnc_init

_nul = [] spawn 
   {
       while { true } do
       {
           {
		_feh = _x getvariable ["FEHadded",-1];
		if (_feh == -1) then 
			{
			_x setvariable ["FEHadded",1];
			_x  addEventHandler ["Fired", bdetect_fnc_fired]; 
			if (( assignedVehicleRole _unit) select 0 == "Turret"  ) then   
				{  
				(vehicle _x) addeventhandler ["fired",bdetect_fnc_fired];   
				}; 
			};
		} foreach allUnits;
           sleep 10;
       };
   };

And this line to bdetect_fnc_fired

if(time - (_unit getVariable "bdetect_fired_time") > bdetect_shots_delay && !(_magazine in bdetect_skip_mags) ) then

What do you think will be the performance hit from the additional checking? Or are you doing it in bdetect_fnc_fired?

Share this post


Link to post
Share on other sites

Gonna give v2 a tilt nao.

EDIT - tpw, you naughty boy, don't try and substitute your hint for a sidechat! MY IMMERZIONS! :P

Seriously though, if you get a second, please make that able to be toggled off too, please.

Share this post


Link to post
Share on other sites
Gonna give v2 a tilt nao.

EDIT - tpw, you naughty boy, don't try and substitute your hint for a sidechat! MY IMMERZIONS! :P

Seriously though, if you get a second, please make that able to be toggled off too, please.

Nah the sidechat is from bdetect (fabrizio_T). Like I said above, all the debugging is on for the beta release. Make with more feedback everyone and I'll remove the beta status and the debugging stuff!

EDIT: Since you said please twice in the same sentence: http://filesonly.com/download.php?file=954tpwc_ai_suppress_200_pbo.zip (no bdetect debugging).

Edited by tpw

Share this post


Link to post
Share on other sites

Thanks tpw.

Overhead should be almost negligible, but i'll do soke comparative bechmarking (0.6 vs 0.51) prior release.

NOTES:

Be careful with debug fully enabled, it can put the computer on its knees - Not suitableother than for small test missions.

Within 0.6 you'll have an option to avoid globalcaht dumping of debug messages.

Share this post


Link to post
Share on other sites
Thanks tpw.

Overhead should be almost negligible, but i'll do soke comparative bechmarking (0.6 vs 0.51) prior release.

NOTES:

Be careful with debug fully enabled, it can put the computer on its knees - Not suitableother than for small test missions.

Within 0.6 you'll have an option to avoid globalcaht dumping of debug messages.

I just have this line in TPWCAS: bdetect_debug_enable = true

I didn't touch the bdetect debugging so it runs at the default of 1.

Share this post


Link to post
Share on other sites

This mod should be nominated for best mod of the year! Thanks guys, it's nice to see proper suppression implemented finally.

Share this post


Link to post
Share on other sites
This mod should be nominated for best mod of the year! Thanks guys, it's nice to see proper suppression implemented finally.

Thanks Muahaha, we might use that quote on the box!

Share this post


Link to post
Share on other sites
Since you said please twice in the same sentence:

Thanks, chief - your consideration is much appreciated.

Share this post


Link to post
Share on other sites

bdetect.sqf: v0.6

BEWARE: not completely backward compatible with v0.51

Please don't use this version with TPWC suppression v2.00, wait for an updated TPWC suppression version.

If you want to test this framework version alone then you're welcome.

Changelog:

* Incorporated v0.51 changes/fixes by tpw.
* Function bdetect_fnc_callback() slightly changed. See bottom of this file for example.
* Function bdetect_fnc_init() waits for 5 seconds to pass by after mission start, before activating the framework.
* Introduced function bdetect_fnc_eh_fired_add(): suitable to force -immediate- assignment of a fired EH to any unit. Syntax: [unit] call bdetect_fnc_eh_fired_add();
* Fixed function bdetect_fnc_benchmark(): internally using code spawning, not to block code execution after function call.
* Tweaked internals so that "diag_tickTime" is used instead of "time" (Thanks Ollem).
* Introduced function bdetect_fnc_eh_loop(): iteratively checks ( each "bdetect_eh_assign_cycle_wait" seconds ) for newly spawned units to assign them a 'Fired' event Handler.
* Renamed "bdetect_bullet_min_distance" to "bdetect_bullet_max_proximity"
* Introduced variable "bdetect_init_done": (Boolean). It evaluates to true when framework is loaded. Usage: "waitUntil { bdetect_init_done};"
* Introduced variable "bdetect_eh_assign_cycle_wait": (seconds, Default 10). Wait duration foreach cyclic execution of bdetect_fnc_eh_loop()
* Introduced variable "bdetect_bullet_min_distance": (meters, Default 25). Bullets not having travelled this distance are ignored
* Introduced variable "bdetect_bullet_initial_min_speed": (meters / second, Default 360). Bullets initially slower than this are ignored (good for subsonic bullets skipping). 
* Introduced variable "bdetect_debug_chat": (Boolean, Default false) Show debug messages also in globalChat.
* Changed Variable "bdetect_debug_min_level" to "bdetect_debug_levels". (Array). Default [0,1,2,3,4,5,6,7,8,9]. 0-9 are reserved levels.
* Much more

Due to some needed tweaks it's not 100% backward compatible with v0.51 as some variable names were changed as well as prototype for bdetect_fnc_callback().

Sorry, i could not get closer than this to previous version.

Other that handling for spawned units introduced by tpw with v0.51 and ported here, biggest changes are under the hood:

* Logging was revised

* Unit<->Bullet blacklisting was added, so any bullet can't trigger detection on a same unit more than once.

Due the amount of changes v0.6 is about 2% slower than v0.51.

All in all is still a good performer, while being more reliable.

Code removed, v0.61 out. See next page.

Edited by fabrizio_T

Share this post


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

×