Jump to content
Sign in to follow this  
tpw

TPW EBS: engine based suppression

Recommended Posts

More TPW gold. Gonna wait for the non-visible bubble version and good luck with FindCover cause that's gonna seal the deal. :)
Copy @TPW_EBS\userconfig\TPW_EBS\TPW_EBS.hpp to your userconfig\TPW_EBS\TPW_EBS.hpp. You may edit this file to taste:

tpw_ebs_thresh = 5; // unit is suppressed if this many bullets pass by in 5 secs

tpw_ebs_hint = 1; // start hint. 0 = no hint

tpw_ebs_sleep = 1; // how long til suppression functions start

tpw_ebs_debug = 1; // debugging will colour the suppression shell (green = own side, yellow = enemy <5 bullets, red = enemy >5 bullets)

tpw_ebs_radius = 500; // units must be closer to player than this (m) for suppression to work

tpw_ebs_playersup = 1; // suppression effects applied to player. 0 = no player suppression

I reckon setting it to 0 will disable it :)

Share this post


Link to post
Share on other sites
I reckon setting it to 0 will disable it :)

Yep. Sorry, I should have been clearer about it. I will disable debugging by default next release.

Share this post


Link to post
Share on other sites

Yeah no I was just being stupid. Normally userconfig is first place I go but I thought I read it was always on as this is test release of new suppression bubble.

Share this post


Link to post
Share on other sites
The AI will change position, and they are moving prone and crouched, in fact I'm finding they are more dangerous then ever before because they will often attempt to flank me while keeping low behind cover. This mod is easily the most realistic feeling AI I have played against, it actually feels like I am playing against human opponents.

Well said Takoda,

I also find that when they are suppressed they will crouch or lie down and try and seek cover.

Even if some do, after a number of seconds, actually pop back up in the same position (as we humans also do) would you really wait in the same position for a few seconds on the possibility that he might pop back out/up in the same spot, putting yourself in danger, or would you move to a different location?

At least the ai don't just stand there anymore blasting away till they empty their mags at you, they now actually do something,which is excellent, IMO.

Well done on this mod TPW, it really makes a huge difference on how I play the mission now, and I for one are wishing you all the best in any tweaks or extras you may have in mind for it,

Regards,

Mick. :)

Share this post


Link to post
Share on other sites

Thanks guys. So with regards to finding cover, I'm trying to keep things simple by using the findcover command. This means I can get units to seek cover in the default way, which while not great is better than nothing. Ollem has implemented a wonderful find cover function in TPWCAS, but I'd need a brain transplant to write something similar.

Share this post


Link to post
Share on other sites
Thanks guys. So with regards to finding cover, I'm trying to keep things simple by using the findcover command. This means I can get units to seek cover in the default way, which while not great is better than nothing. Ollem has implemented a wonderful find cover function in TPWCAS, but I'd need a brain transplant to write something similar.

I don't know much about scripting, but i thought that this potentially friggen useful command wasnt working any more as it had been purposely disabled by BIS. if not then thats even more good news.

Share this post


Link to post
Share on other sites
I don't know much about scripting, but i thought that this potentially friggen useful command wasnt working any more as it had been purposely disabled by BIS. if not then thats even more good news.

You're right I think. With further testing, I'm not that sure that findcover is doing a bloody thing. I can never get it to return anything other than <null-object>. Let's say I name an AI "testunit", and run a small test script:

_cover = testunit findCover [getpos testunit,getpos player,100];
hintsilent format["%1",_cover];

According to the instruction booklet, this should return the nearest cover between the test unit and the player. No matter what, it just returns <NULL-object>. Bugger, it looks like I might have to go back to my fallback plan and code something...

Share this post


Link to post
Share on other sites

That's a shame about findCover - did try it in A2 but could never get it to work.

I guess you could try something like nearObjects with an empty array and then filter out the results to get rid of things like butterflies etc, but then I'm not sure how hard cover is defined in the game. (Maybe something in the configs you can check for).

I'm at work so can't check for you but will have a look when I get in to see if I can help.

not sure if nearestObjects would be the right way to go though as it's quite CPU heavy if used liberally.

Share this post


Link to post
Share on other sites
That's a shame about findCover - did try it in A2 but could never get it to work.

I guess you could try something like nearObjects with an empty array and then filter out the results to get rid of things like butterflies etc, but then I'm not sure how hard cover is defined in the game. (Maybe something in the configs you can check for).

I'm at work so can't check for you but will have a look when I get in to see if I can help.

not sure if nearestObjects would be the right way to go though as it's quite CPU heavy if used liberally.

Yeah I've been playing with nearestobjects and can get units heading to nearby houses etc when shot at. Just have to combine it with some lineintersects stuff and it'll be good enough for government work.

Share this post


Link to post
Share on other sites

AFAIK, findCover has been broken since Arma 2.

The CIT ticket contains some example script code to find nearby objects

Edited by ceeeb

Share this post


Link to post
Share on other sites
AFAIK, findCover has been broken since Arma 2.

CIT issue: https://dev-heaven.net/issues/2016

I was kind of hoping it was broken in Arma2, not since Arma 2! Another Wiki goose chase.

Share this post


Link to post
Share on other sites
Yeah I've been playing with nearestobjects and can get units heading to nearby houses etc when shot at. Just have to combine it with some lineintersects stuff and it'll be good enough for government work.

Cool man :) - lineIntersects is damn useful for all sorts of things. I like your thinking.

Was thinking about it and wanted to ask how you're handling it in terms of squad movement. Are you looking for an appropriately "in cover" position and then assigning a WP (which could break missions I guess), or are you going down the route of giving them individual commands (like _x doMove _pos) ?

I have been trying the second route for a house searching script I'm doing, but it's seeming to have overly-detrimental effects on the game framerate. Maybe I need to improve my code, but it's as lightweight as I (think I) can make it. :(

I had some thoughts about finding cover if there aren't buildings around. If you like, I'll shoot you a pm about some approaches I can think of.

Share this post


Link to post
Share on other sites
Cool man :) - lineIntersects is damn useful for all sorts of things. I like your thinking.

Was thinking about it and wanted to ask how you're handling it in terms of squad movement. Are you looking for an appropriately "in cover" position and then assigning a WP (which could break missions I guess), or are you going down the route of giving them individual commands (like _x doMove _pos) ?

I have been trying the second route for a house searching script I'm doing, but it's seeming to have overly-detrimental effects on the game framerate. Maybe I need to improve my code, but it's as lightweight as I (think I) can make it. :(

I had some thoughts about finding cover if there aren't buildings around. If you like, I'll shoot you a pm about some approaches I can think of.

Gday DA. I've been trying all sorts of things out but _x domove _cover seems to work without undue CPU stress. I tried putting suppressed units into stealth mode too, to see if that would force them into cover, but I'm not sure that was terribly successful.

Anyway, the code idea is to spawn a simple function once a unit is suppressed:

_cover = nearestobjects [position _unit,["house,"etc","etc"],20];
while {eyepos _unit lineintersects eyepos _shooter} do
{
_unit domove position (_cover select 0);
sleep 5;
};

with a few more conditions thrown in so it terminates after x amount of time etc.

Anyway, drop me a PM and let's see what we can come up with.

Edited by tpw

Share this post


Link to post
Share on other sites
Gday DA. I've been trying all sorts of things out but _x domove _cover seems to work without undue CPU stress. I tried putting suppressed units into stealth mode too, to see if that would force them into cover, but I'm not sure that was terribly successful.

Anyway, the code idea is to spawn a simple function once a unit is suppressed:

_cover = nearestobjects [position _unit,["house,"etc","etc"],20];
while {eyepos _unit lineintersects eyepos _shooter} do
{
_unit domove position (_cover select 0);
sleep 5;
};

with a few more conditions thrown in so it terminates after x amount of time etc.

Anyway, drop me a PM and let's see what we can come up with.

I had the idea for a while to code an AI take cover function. When I tried something similar this, I had a problem with nearestobjects. From the wiki, it is supposed to return everything around me when using ["All"] but when I do that, AI won't move at all to the position found.

My thoughts where to find all nearby objects, then check their heights and if it is suitable for cover, force AI to move there. So far it's not going very well.

Share this post


Link to post
Share on other sites
I had the idea for a while to code an AI take cover function. When I tried something similar this, I had a problem with nearestobjects. From the wiki, it is supposed to return everything around me when using ["All"] but when I do that, AI won't move at all to the position found.

My thoughts where to find all nearby objects, then check their heights and if it is suitable for cover, force AI to move there. So far it's not going very well.

You must be psychic WW, I have pretty much the system you describe working, and will release it tonight.

_cover = nearestobjects [position _unit,[],50]; returns an array with all objects within 50m of _unit (notice the empty [])

boundingbox allows you to determine the object's height.

So I loop through _cover, and exit once I've found an object greater than 1m high.

Then domove towards that object for as long as the unit is under suppression or has line of sight to the shooter.

I added some debug code so that a red ball appears near the cover object, and you can clearly see the suppressed unit moving towards it. The ball disappears once the unit is not suppressed.

This system is neither perfect nor complete, but it at least gives an illusion of a suppressed unit making an attempt to get out of the line of fire. And it's light.

As always, if you want the most complete and perfect suppression system, use TPWCAS instead. Ollem is a coding magician who has forgotten more than I've learned.

Share this post


Link to post
Share on other sites
You must be psychic WW, I have pretty much the system you describe working, and will release it tonight.

_cover = nearestobjects [position _unit,[],50]; returns an array with all objects within 50m of _unit (notice the empty [])

boundingbox allows you to determine the object's height.

So I loop through _cover, and exit once I've found an object greater than 1m high.

Then domove towards that object for as long as the unit is under suppression or has line of sight to the shooter.

I added some debug code so that a red ball appears near the cover object, and you can clearly see the suppressed unit moving towards it. The ball disappears once the unit is not suppressed.

This system is neither perfect nor complete, but it at least gives an illusion of a suppressed unit making an attempt to get out of the line of fire. And it's light.

As always, if you want the most complete and perfect suppression system, use TPWCAS instead. Ollem is a coding magician who has forgotten more than I've learned.

Fantastic, seeing AI properly run to cover would be wonderful.

Share this post


Link to post
Share on other sites
You must be psychic WW, I have pretty much the system you describe working, and will release it tonight.

_cover = nearestobjects [position _unit,[],50]; returns an array with all objects within 50m of _unit (notice the empty [])

boundingbox allows you to determine the object's height.

So I loop through _cover, and exit once I've found an object greater than 1m high.

Then domove towards that object for as long as the unit is under suppression or has line of sight to the shooter.

I added some debug code so that a red ball appears near the cover object, and you can clearly see the suppressed unit moving towards it. The ball disappears once the unit is not suppressed.

This system is neither perfect nor complete, but it at least gives an illusion of a suppressed unit making an attempt to get out of the line of fire. And it's light.

As always, if you want the most complete and perfect suppression system, use TPWCAS instead. Ollem is a coding magician who has forgotten more than I've learned.

That is fantastic!

I managed to get my code to work as well, but I am very new to the world of Arma modding. I am positive your code will function better. Do you mind if when you release it, I look at your code and learn a few things? :)

My idea is that I want to write a script to make check to see if AI is in safe stance. If they heard a gun shot near them and they are in safe stance, they immediately go to danger mode and run for cover. The shot doesn't have to be near them or visible. If no more shots came their way, they will regroup and investigate the shots. Note that running for cover time will be based on the number of shots and how close they are. If its only one shot, they will start running for cover for 2 seconds before regaining form. If frantic shots are heard, they will run for 6 seconds or so or till they reach cover. If shots starting being fired at them, they run for cover.

I think this might be a good addition to your mod? I am new at this, so I am just messing around to learn.

Share this post


Link to post
Share on other sites

Ok after some addon checking Ive found that after the latest patch EBS forces flash lights in its radius to not show/ turn off. I thought it was the debug but I turned it off and nothing changed.

To test airfield easiest

1. Switch time to night

2.Place 3 units down.

2a. 1player 1ai right next to player 1 ai atleast 550m away from player

2b. insert code

this addPrimaryWeaponItem "acc_flashlight";    this unassignItem "NVGoggles";    this removeItem "NVGoggles";    this enablegunlights "forceOn"  

3. Observe

Share this post


Link to post
Share on other sites
Ok after some addon checking Ive found that after the latest patch EBS forces flash lights in its radius to not show/ turn off. I thought it was the debug but I turned it off and nothing changed.

To test airfield easiest

1. Switch time to night

2.Place 3 units down.

2a. 1player 1ai right next to player 1 ai atleast 550m away from player

2b. insert code

this addPrimaryWeaponItem "acc_flashlight";    this unassignItem "NVGoggles";    this removeItem "NVGoggles";    this enablegunlights "forceOn"  

3. Observe

Thanks for that report. I'm not in front of my Arma box so can't investigate further. There's nothing in the code that should be forcing the lights off, but it might be that the invisible shell is not letting the light out. In which case I'll be pissed off! I've been doing all my testing in daytime conditions to better see the effect of suppression, so this one might have slipped through.

Share this post


Link to post
Share on other sites

It was working all night last night then the patch came and I was thrust into the dark :D

Share this post


Link to post
Share on other sites

I just checked it and with 0.77.109067 I can see the lights of any units. I have a little script to get my squad AI to turn their gun lights on, and I can see both the light texture and the beam shining on stuff. Are you saying that it disappears at distance?

Share this post


Link to post
Share on other sites

negative It simply doesnt show. Ill make a fast repo.

https://www.dropbox.com/s/whj50va9uovag4f/EBS.Stratis.pbo

On tele to the group on the northern end of runway their lights go off.

0.77.109067 A3 version TPWEBS version Version: 1.01 CBA3 Version v1.00 beta4 rev. 8

Without http://steamcommunity.com/sharedfiles/filedetails/?id=169933424

with http://steamcommunity.com/sharedfiles/filedetails/?id=169934180

Edited by Masharra

Share this post


Link to post
Share on other sites

Thanks for that. So I can see light from the 2 blokes up the runway but not from the guy in my squad. Is that what I'm supposed to see?

Share this post


Link to post
Share on other sites

The guy in your squad doesnt have the force lights on (he is just there because I used groups instead of placing a single soldier.)

There are 3 Nato patrol groups

1 player + 1 ai = No lights

2 ai (about 10-15m away from player group)= lights but do not show

2ai on other end of runway(more than 500m away) = lights that DO show.

Share this post


Link to post
Share on other sites

Hi Masharra

Had a good look and the problem is if you try to turn the lights on before TPW EBS

I put a squad down with this in the player's init

{ _x addPrimaryWeaponItem "acc_flashlight";_x enableGunLights "forceon";  _x say "clicksoft";  } foreach  units (group player);

No lights

If I have nothing in the player init but execute the same commands in the debug console after EBS has initialised then I get lights.

Sorry about the angst, I'm glad I have established the problem. Not sure how to fix it, though it may have something to do with attaching the suppression shell to a unit who already has a light going.

Share this post


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

×