Jump to content
Sign in to follow this  
Rydygier

getArtilleryETA sometimes wrong with doArtilleryFire...

Recommended Posts

I'm testing artillery commands, so have set up M4 Scorcher (v1) and target for it (t1) 2,4 km away.

getArtilleryETA inside this function:

RYD_FireSol = 
{
private ["_gun","_pos","_eta","_inRange","_ammo","_dst","_hasAmmo"];

_gun = _this select 0;
_pos = _this select 1;

_ammo = currentMagazine _gun;
if ((count _this) > 2) then {_ammo = _this select 2};

_mags = getArtilleryAmmo [_gun];

_hasAmmo = false;
if (_ammo in _mags) then {_hasAmmo = true}; 

_eta = _gun getArtilleryETA [_pos,_ammo];
_inRange = _pos inRangeOfArtillery [[_gun],_ammo];

_dst = round (_gun distance _pos);

[_eta,_dst,_inRange,_hasAmmo]
};

Returns 26-27 sec.

When I'm using personally artillery computer of that M4 Scorcher, then shows same ETA for that target for semi (close) setting. Now if I'll fire the gun, round will reach the target on that time.

But if I use for firing that gun script command doArtilleryFire, eg that way:

RYD_CFF_FFE = 
{
private ["_gun","_pos","_eta","_inRange","_ammo","_dst","_hasAmmo","_rounds","_fs"];

_gun = _this select 0;
_pos = _this select 1;
_ammo = _this select 2;
_rounds = _this select 3;

_fs = [_gun,_pos] call RYD_FireSol;

_eta = _fs select 0;
_inRange = _fs select 2;
_hasAmmo = _fs select 3;

player sidechat format ["eta: %1",_eta];

[_eta] spawn
	{
	_eta = _this select 0;

	sleep _eta;

	player sidechat "Boom" 
	};

if (_hasAmmo) then
	{
	if (_inRange) then
		{
		_gun doArtilleryFire [_pos, _ammo, _rounds]
		}
	}
};

Displayed ETA is same, 27 seconds, but round is flying about 20-25 seconds longer. Exactly, like should for semi (medium) setting (49 sec.)...

Seems, like for that situation getArtilleryETA command chooses for given position semi (close) (nearly max range with this setting), while doArtilleryFire chooses semi (medium).

Problem is gone, if I move target further from semi(close)/semi(medium) ranges boundry, so IMHO this is about some miscalculation between these two commands, when exactly which setting should be used.

How to be sure, that both commands will use same setting, so ETA will be reliable all the time, also close to the range boundry of given arty comp setting? Failed to find any script command to change that setting.

Here is my testing mission (playable are observer and m4 gunner, observer can teleport onMapSingleClick, hint constantly shows ETA etc for observer position. Use 0-0-0 radio channel to fire the gun remotely on marked target position. Sidechat will notify about expected ETA and impact moment. To repro just use 0-0-0, wait for sidechat notifications and note nearly 30 sec. of delay between expected impact notification and real impact):

ArtyTest.Stratis

Second question: anybody knows how, considering what factors, arty fire dispersion is calculated?

Edited by Rydygier

Share this post


Link to post
Share on other sites

I noticed when using the artillery computer for the mortar that the spread is 50mx50m / 100mx100m /150mx150m and i would guess that a random position is used for each shot. (depending on distance).

I also noticed that the random position is not that random... i.e. it must use the same random function without variation. what I mean is if you set up 10 mortars and use all 10 with the same call ,they will drop the mortar at the same place as every other mortar(not just the first shot but every shot)(shots displaced by the distance between mortars).

imo they should use a random seed to add some variation otherwise mortar batteries will look kinda weird and will not really give you a benefit for using more than one mortar at once

Edited by Kunsa
AAAAAAAAAARRRRRRRRRRRRRGGGGGG!!!!!

Share this post


Link to post
Share on other sites

Thanks for the answer. Hmm. Just tested. Slightly changed above test mission by replacing SP mortar with 3 mortars (one group) then I made doArtilleryFire 1 round for each at the same position (3 round salvo per call). Each round of one salvo and each salvos hit at different place, so I see here it is proper randomization each shot, or perhaps you are calling arty fire other way, eg by support modules?

Still, main problem is that ETA issue here. It is crucial for AI predicting moving target position at expected impact time.

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  

×