Jump to content
Sign in to follow this  
zodd

Airburst HEDP

Recommended Posts

Gday all,

I have finished a series of scripts that allows you to fire HEDP weapons as airburst (you can alternate between direct fire and airburst and change your airburst range as required)

When the round detonates, in addition to the explosive killzone it fires shrapnel out to 150m (targetted to minimise server load)

If people are interested I can release it when it has been thoroughly tested but for now my question:

Works excellently when employed by a human player but obviously the AI just engage as per normal. For people that understand AI programming: How hard would it be to have a script or something run to amend the AI targetting behaviour with HEDP rounds? I can work out the basics of it (ie. for all enemy detected, check if there are more than say 5-10 within a certain radius, if so target the middle, add 30 to the z pos, set the range for the distance and fire...)

I have searched a bit but no luck so any input is much appreciated!

Share this post


Link to post
Share on other sites

That sounds really good, Zodd. Looking forward to testing it out.

People you might contact include Rydygier (Fire at Will), BlakeAce (Forward Observer) - I've used both of these, both work really well & are easy to set up for relative newbies like me, & most importantly, both employ AI-controlled artillery.

The authors are highly competent & open to suggestions / new ideas.

Share this post


Link to post
Share on other sites

Update:

Fully functional for HEDP in SP. Unable to test as yet in MP.

If anyone is interested I would REALLY appreciate feedback; intent is to release the scripts for public use as soon as its tested (mainly MP)

Hopefully released in next 24-48 pending feedback!

Images:

Explosion

http://dl.dropbox.com/u/74159983/Airburst%20explosion.png

Frag impact

http://dl.dropbox.com/u/74159983/Airburst%20frag.png

Demo mission:

MP : http://dl.dropbox.com/u/74159983/MP%20-%20ZSUHEDPAirburst.Desert_E.zip

SP : http://dl.dropbox.com/u/74159983/SP%20-%20ZSUHEDPAirburst.Desert_E.zip

edit: Demo missions need ACE because I accidently used ACE units in them... Will make a non ACE demo in next few days if needed (Hopefully will be releasable by the time I can make a new one anyway!)

Mission:

Several enemy soldiers and vehicles on patrol routes in front of you; Will not react (never fire and careless - just moving targets)

Metal bins for cover for firers, ammo dump behind you with extra HEDP rounds.

Basically a firing range to test weapon effects.

Usage:

Switch to Airburst (Action menu -Sets default airburst range to 300m (Can be changed using action menu))

ID your target and set the appropriate range

Aim at the middle of the group of enemy you are firing at and have your point of aim 20-40m above ground level (so it airbursts)

Fire and observe the resulting carnage.

Shrapnel is only spawned aimed towards game entities to save server load.

Lethal at 50m, Effective to 100m. (Noting there are several bits of shrapnel fired at each entity)

Shrapnel spread is modelled as accurately as possible;

Range = concentration (spread) of shrapnel

10m = 4.6mm

20m = 3.7cm

30m = 12.5cm

40m = 29.6cm

50m = 57.8cm

60m = 1m

70m = 1.58m

80m = 2.37m

90m = 3.38m

100m= 4.63m

125m= 9.04m

150m= 15.6m

Edited by Zodd

Share this post


Link to post
Share on other sites

Still help with AI FOs routines needed?

Will be brief, sorry, lack of time currently:

(ie. for all enemy detected, check if there are more than say 5-10 within a certain radius, if so target the middle, add 30 to the z pos, set the range for the distance and fire...)

If you can handle with code for all of this, there is need to determine, which AI units should have FO ability (prepare ana array contains names of such units), then exec (or spawn) for all FO's in array this code in loop with some interval and maybe waituntil for end of previous fire mission.

You may also consider two aspects: choosing of best target amongst known enemies in spotting and arty range (considering it's kind, mentioned number of units in impact range, speed (slower = better), and even height (to avoid targeting planes/choppers in air)), and to take an amendment because of target's movement vector (to predict, where target will be after time, that will pass between calling fire mission and impact, if it moves in given average direction with given average speed). Such code is implemented in my "Fire at Will" (see "spoiler" below), also I know, that BlakeAce, who uses similar method, added also some calculations for movement along roads, which makes this really sophisticated targeting routine. Difference is, that both FAW and Blackace's AI FO are based on Arma's ARTY module funcionalities, you have chosen path of spawning ammo (like here: WIP-Improving-Bon-s-artillery-script). But this shouldn't make a big difference, only this delay will be probably easier to determine here, because you exactly know value of this delay, as it is implemented by you, not dictated by Arty Module/game ballictic simulation.

So, if you are interested in my method for AI-driven choosing target, then check FAW file: "RydArtyTrg.sqf" below line 88 (above this line is completed array of AI FO's). This is, I afraid, rather messy code, but I hope, that it will be helpful somehow. And here is part of "FireAtWill.sqf" for move vector amendment:

	_targetPos = getPosASL _targlead;

_X0 = (_targetpos select 0);
_Y0 = (_targetpos select 1);
sleep 10;
_targetPos = getPosASL _targlead;
_X1 = (_targetpos select 0);
_Y1 = (_targetpos select 1);
sleep 10;
_targetPos = getPosASL _targlead;
_X2 = (_targetpos select 0);
_Y2 = (_targetpos select 1);

_Xav = (_X1+_X2)/2;
_Yav = (_Y1+_Y2)/2;

_transspeed = ([_X0,_Y0] distance [_Xav,_Yav])/15;
_transdir = (_Xav - _X0) atan2 (_Yav - _Y0);

_Xhd = _transspeed * sin _transdir * 2.7 * _TTI;
_Yhd = _transspeed * cos _transdir * 2.7 * _TTI;

and after no-friendly-fire routine that may reduce this amendment:

	_impactpos = [(_targetpos select 0) + _Xhd, (_targetpos select 1) + _Yhd,_targetpos select 2];

This contains values proper for ARTY module's artillery time of flight (_TTI factor - , here varies from 20 to 35, not remember for sure, but this is probably not second of time of flight equivalent, rather about half of it, you can find this value for yours script empirical way). Takes 20 seconds to calculate vector. The longer the more reliable vector ("sleeps"). _Xhd and _Yhd are obviously final amendments in meters for both coord axis (E-W and N-S).

In this file you can also find dispersion calculating because of weapon/shell accuracy and skills (condition) of FO and gun crews/battery commander, weather factor and such things. Sorry, for now can't explain all this more detailed.

You can also consider to put FO into stealth/no fire/no engage. See this (and related - "See also") command: setCombatMode.

Hope, that this will be useful.

Good luck! :)

Edited by Rydygier

Share this post


Link to post
Share on other sites

Ryd,

Thanks for the detail but I may not have specified enough; this isnt an artillery specific thing (Separate to the ZSUArty stuff) but a direct fire HEDP thing (In real life you can set 84mm rounds to airburst to rain shrapnel down on enemy; that is what this is doing) - Demo mission is basically a firing range that shows what I am talking about.

I am trying to work out how to get the AI to use the airburst function (ie. if target group detected, aim 35m above them and fire the airburst round)

Thanks again though; the target leading idea is a good one that may help!!!

Share this post


Link to post
Share on other sites

Oh. :) Didn't check demo, my fault. All because of reading in rush. Maybe also this will become useful someday...

Anyway needed behavior shouldn't be too hard to implement. At the moment I'm coding something quite similar - to make AI do something, when enemy is spotted. "Something" may be firing shrapnel at enemy pos as well. Perhaps this will be sufficient (still written in rush, but "should work"):

"KillOnSight.sqf"

_shrapnelGuy = _this select 0;

while {((alive _shrapnelGuy) and not (isNull _shrapnelGuy))} do 
{
_target = _shrapnelGuy findNearestEnemy _shrapnelGuy;
if not (isNull _target) then
	{
	[_shrapnelGuy,_target] execVM "ShootAtHim.sqf"// or [_shrapnelGuy,_target] spawn AIRBURST_ROUTINE or whatever
	};

sleep 10;
}

and executed by something like:

nul = [this] execVM "KillOnSight.sqf"

(in unit's init field)

or

[_unit] execVM "KillOnSight.sqf"

(in .sqf file, like init.sqf for example)

This will check every 10 seconds, if there is known to "shrapnelGuy" enemy around. If so, then yours function will be called. This function of course should contain all needed filters, like range, amount of nearby enemies and so on.

Edited by Rydygier

Share this post


Link to post
Share on other sites

I have the base of a script working that checks for known targets and looks for a group by checking nearobjects; that works well

(while shrapnelguy alive do.... with a sleep 30 at the end)

From there I have a target position based off the enemy location (eg [_tgtx, _tgty, 30] )

Problems:

1. Getting the shrapnelguy to select his launcher and change ammo to the HEDP nature

2. Getting the shrapnelguy to effectively engage the target (This has been kind of fixed by spawning a tank and disablesimulation at the target loc then dotarget/dofire - this doesnt work with any target other than a tank though)

Share this post


Link to post
Share on other sites

I see. This should be possible as well, if I rememeber correct some commands. Not sure though. Later I'll edit this post with some code, if I will be able to prepare something.

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  

×