Jump to content
Mariusz B

Show bullet position every millisecond

Recommended Posts

Hi :)

 

I want my script to report bullet position every milisecond including a moment of fire. However loop occurs every game frame.

player addEventHandler ["Fired", {
    _null = _this spawn {
        _missile = _this select 6;
			
        waitUntil {
            if (isNull _missile) exitWith {true};

             diag_log getPos _missile;
	     
        };    
    };
}];

   this is a player position :[3999.79,999.912,0.00143909]  and this is a first report of bullet  : [3999.97,1016.43,1.35643]  as you can see projectile flew 16 meters before first data, that means Im missing time before fire and next frame. The most importnant for me is a position of bullet in moment of fire. It would be great if script reported data every milisecond. What should I write ? Please help !

 

Thank you.

Share this post


Link to post
Share on other sites

I guess spawn makes that latency. Use diag_log before spawn once.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, POLPOX said:

I guess spawn makes that latency. Use diag_log before spawn once.

 

Yup that paritally works :D. I wrote

 

_missile = _this select 6;
 diag_log getPos _missile;

 

before spawn[] in result i am geting data of bullet in moment of shot. After that it still printing position every frame :(. How to overcome this?

Share this post


Link to post
Share on other sites

The bullet's position is updated only once per frame. You'd have to calculate the position between them manually. 

You could slow down the time to get 1/1000s resolution. But why do you need so accurate data?

  • Like 2

Share this post


Link to post
Share on other sites

Why would you need the bullets position for every millisecond? That's 60 positions every second with a 0.02s (20ms) sleep, or even 42227 positions for one second with a plain loop and no sleep in it.

That's quite an amount of data you're shoving into the .rpt...

Snippet with 42227 positions per second (at least on my rig):

GOM_debug = [];
player addEventHandler ["Fired",{

	_projectile = _this select 6;
	systemchat str _projectile;
	GOM_debug pushBack [diag_tickTime,getposatl _projectile];

	_track = [time,_projectile] spawn {
		params ["_time","_projectile"];

		while {time < (_time + 1) AND alive _projectile} do {
			GOM_debug pushBack [diag_tickTime,getposatl _projectile];
		};

		copyToClipboard str GOM_debug;
		_duration = time - _time;
		systemchat str format ["Collected %1 positions over %2 seconds!", count GOM_debug,_duration];
		playsound "click";
		true
	}
}];

With 1ms "sleep":


GOM_debug = [];
GOM_debug_lastTICK = 0;
player addEventHandler ["Fired",{

	_projectile = _this select 6;
	systemchat str _projectile;
	GOM_debug pushBack [diag_tickTime,getposatl _projectile];
	GOM_debug_lastTICK = diag_tickTime;

	_track = [time,_projectile] spawn {
		params ["_time","_projectile"];

		while {time < (_time + 1) AND alive _projectile} do {


			if (diag_tickTime >= GOM_debug_lastTICK + 0.001) then {
				GOM_debug_lastTICK = diag_tickTime;
			GOM_debug pushBack [diag_tickTime,getposatl _projectile];
		}
		};

		copyToClipboard str GOM_debug;
		_duration = time - _time;
		systemchat str format ["Collected %1 positions over %2 seconds!", count GOM_debug,_duration];
		playsound "click";
		true
	}
}];

Output:

Spoiler

 



[[1510.01,[3484.51,5833.24,1.50848]],[1510.01,[3483.89,5845.02,4.33069]],[1510.01,[3483.89,5845.02,4.33069]],[1510.01,[3483.89,5845.02,4.33069]],[1510.02,[3483.27,5856.67,5.17374]],[1510.02,[3483.27,5856.67,5.17374]],[1510.03,[3483.27,5856.67,5.17374]],[1510.03,[3483.27,5856.67,5.17374]],[1510.04,[3482.66,5868.19,8.07821]],[1510.04,[3482.66,5868.19,8.07821]],[1510.04,[3482.66,5868.19,8.07821]],[1510.04,[3482.66,5868.19,8.07821]],[1510.06,[3482.05,5879.83,12.8511]],[1510.06,[3482.05,5879.83,12.8511]],[1510.06,[3482.05,5879.83,12.8511]],[1510.06,[3482.05,5879.83,12.8511]],[1510.07,[3481.46,5891.11,17.7511]],[1510.07,[3481.46,5891.11,17.7511]],[1510.08,[3481.46,5891.11,17.7511]],[1510.08,[3481.46,5891.11,17.7511]],[1510.09,[3480.87,5902.28,22.2288]],[1510.09,[3480.87,5902.28,22.2288]],[1510.09,[3480.87,5902.28,22.2288]],[1510.09,[3480.87,5902.28,22.2288]],[1510.11,[3480.28,5913.33,26.4367]],[1510.11,[3480.28,5913.33,26.4367]],[1510.11,[3480.28,5913.33,26.4367]],[1510.12,[3479.71,5924.27,31.1849]],[1510.12,[3479.71,5924.27,31.1849]],[1510.13,[3479.71,5924.27,31.1849]],[1510.13,[3479.71,5924.27,31.1849]],[1510.14,[3479.15,5934.89,35.6801]],[1510.14,[3479.15,5934.89,35.6801]],[1510.14,[3479.15,5934.89,35.6801]],[1510.14,[3479.15,5934.89,35.6801]],[1510.16,[3478.59,5945.4,39.7376]],[1510.16,[3478.59,5945.4,39.7376]],[1510.16,[3478.59,5945.4,39.7376]],[1510.16,[3478.59,5945.4,39.7376]],[1510.17,[3478.03,5956.02,44.4329]],[1510.17,[3478.03,5956.02,44.4329]],[1510.18,[3478.03,5956.02,44.4329]],[1510.18,[3478.03,5956.02,44.4329]],[1510.19,[3477.48,5966.54,50.0139]],[1510.19,[3477.48,5966.54,50.0139]],[1510.19,[3477.48,5966.54,50.0139]],[1510.19,[3477.48,5966.54,50.0139]],[1510.21,[3476.93,5976.96,54.9499]],[1510.21,[3476.93,5976.96,54.9499]],[1510.21,[3476.93,5976.96,54.9499]],[1510.21,[3476.93,5976.96,54.9499]],[1510.22,[3476.39,5987.28,59.9394]],[1510.22,[3476.39,5987.28,59.9394]],[1510.22,[3476.39,5987.28,59.9394]],[1510.24,[3475.85,5997.5,62.4288]],[1510.24,[3475.85,5997.5,62.4288]],[1510.24,[3475.85,5997.5,62.4288]],[1510.24,[3475.85,5997.5,62.4288]],[1510.26,[3475.31,6007.62,62.1378]],[1510.26,[3475.31,6007.62,62.1378]],[1510.26,[3475.31,6007.62,62.1378]],[1510.26,[3475.31,6007.62,62.1378]],[1510.28,[3474.78,6017.65,62.4801]],[1510.28,[3474.78,6017.65,62.4801]],[1510.28,[3474.78,6017.65,62.4801]],[1510.28,[3474.78,6017.65,62.4801]],[1510.29,[3474.25,6027.79,62.6543]],[1510.29,[3474.25,6027.79,62.6543]],[1510.29,[3474.25,6027.79,62.6543]],[1510.29,[3474.25,6027.79,62.6543]],[1510.31,[3473.73,6037.64,63.1247]],[1510.31,[3473.73,6037.64,63.1247]],[1510.31,[3473.73,6037.64,63.1247]],[1510.31,[3473.73,6037.64,63.1247]],[1510.32,[3473.22,6047.4,63.202]],[1510.32,[3473.22,6047.4,63.202]],[1510.33,[3473.22,6047.4,63.202]],[1510.33,[3473.22,6047.4,63.202]],[1510.34,[3472.71,6057.07,64.661]],[1510.34,[3472.71,6057.07,64.661]],[1510.36,[3472.2,6066.65,64.8689]],[1510.36,[3472.2,6066.65,64.8689]],[1510.36,[3472.2,6066.65,64.8689]],[1510.36,[3472.2,6066.65,64.8689]],[1510.37,[3471.7,6076.15,64.3271]],[1510.37,[3471.7,6076.15,64.3271]],[1510.38,[3471.7,6076.15,64.3271]],[1510.38,[3471.7,6076.15,64.3271]],[1510.39,[3471.2,6085.57,64.0956]],[1510.39,[3471.2,6085.57,64.0956]],[1510.39,[3471.2,6085.57,64.0956]],[1510.39,[3471.2,6085.57,64.0956]],[1510.41,[3470.71,6094.91,63.9729]],[1510.41,[3470.71,6094.91,63.9729]],[1510.41,[3470.71,6094.91,63.9729]],[1510.41,[3470.71,6094.91,63.9729]],[1510.42,[3470.22,6104.16,63.7516]],[1510.42,[3470.22,6104.16,63.7516]],[1510.42,[3470.22,6104.16,63.7516]],[1510.43,[3470.22,6104.16,63.7516]],[1510.44,[3469.75,6113.16,63.2346]],[1510.44,[3469.75,6113.16,63.2346]],[1510.44,[3469.75,6113.16,63.2346]],[1510.44,[3469.75,6113.16,63.2346]],[1510.46,[3469.27,6122.26,60.3405]],[1510.46,[3469.27,6122.26,60.3405]],[1510.47,[3468.79,6131.29,55.9805]],[1510.47,[3468.79,6131.29,55.9805]],[1510.47,[3468.79,6131.29,55.9805]],[1510.48,[3468.79,6131.29,55.9805]],[1510.49,[3468.32,6140.24,52.3575]],[1510.49,[3468.32,6140.24,52.3575]],[1510.5,[3468.32,6140.24,52.3575]],[1510.5,[3468.32,6140.24,52.3575]],[1510.51,[3467.85,6149.12,50.1537]],[1510.51,[3467.85,6149.12,50.1537]],[1510.51,[3467.85,6149.12,50.1537]],[1510.51,[3467.85,6149.12,50.1537]],[1510.52,[3467.4,6157.75,47.7985]],[1510.52,[3467.4,6157.75,47.7985]],[1510.52,[3467.4,6157.75,47.7985]],[1510.53,[3467.4,6157.75,47.7985]],[1510.54,[3466.93,6166.66,46.2086]],[1510.54,[3466.93,6166.66,46.2086]],[1510.54,[3466.93,6166.66,46.2086]],[1510.54,[3466.93,6166.66,46.2086]],[1510.56,[3466.47,6175.33,44.7042]],[1510.56,[3466.47,6175.33,44.7042]],[1510.56,[3466.47,6175.33,44.7042]],[1510.56,[3466.47,6175.33,44.7042]],[1510.57,[3466.01,6184.1,44.6269]],[1510.57,[3466.01,6184.1,44.6269]],[1510.59,[3465.56,6192.63,45.4391]],[1510.59,[3465.56,6192.63,45.4391]],[1510.59,[3465.56,6192.63,45.4391]],[1510.59,[3465.56,6192.63,45.4391]],[1510.61,[3465.11,6201.09,48.1836]],[1510.61,[3465.11,6201.09,48.1836]],[1510.61,[3465.11,6201.09,48.1836]],[1510.61,[3465.11,6201.09,48.1836]],[1510.62,[3464.67,6209.48,50.8607]],[1510.63,[3464.67,6209.48,50.8607]],[1510.63,[3464.67,6209.48,50.8607]],[1510.63,[3464.67,6209.48,50.8607]],[1510.64,[3464.23,6217.82,53.2302]],[1510.64,[3464.23,6217.82,53.2302]],[1510.64,[3464.23,6217.82,53.2302]],[1510.64,[3464.23,6217.82,53.2302]],[1510.66,[3463.8,6226.08,55.0336]],[1510.66,[3463.8,6226.08,55.0336]],[1510.66,[3463.8,6226.08,55.0336]],[1510.66,[3463.8,6226.08,55.0336]],[1510.67,[3463.36,6234.29,58.4021]],[1510.67,[3463.36,6234.29,58.4021]],[1510.68,[3463.36,6234.29,58.4021]],[1510.68,[3463.36,6234.29,58.4021]],[1510.69,[3462.94,6242.27,61.7845]],[1510.69,[3462.94,6242.27,61.7845]],[1510.71,[3462.47,6251.16,65.5632]],[1510.71,[3462.47,6251.16,65.5632]],[1510.71,[3462.47,6251.16,65.5632]],[1510.72,[3462.47,6251.16,65.5632]],[1510.72,[3462.04,6259.34,70.8484]],[1510.72,[3462.04,6259.34,70.8484]],[1510.73,[3462.04,6259.34,70.8484]],[1510.73,[3462.04,6259.34,70.8484]],[1510.74,[3461.62,6267.3,77.2105]],[1510.74,[3461.62,6267.3,77.2105]],[1510.74,[3461.62,6267.3,77.2105]],[1510.74,[3461.62,6267.3,77.2105]],[1510.76,[3461.25,6274.41,79.746]],[1510.76,[3461.25,6274.41,79.746]],[1510.76,[3461.25,6274.41,79.746]],[1510.76,[3461.25,6274.41,79.746]],[1510.77,[3460.85,6281.95,79.302]],[1510.77,[3460.85,6281.95,79.302]],[1510.77,[3460.85,6281.95,79.302]],[1510.78,[3460.85,6281.95,79.302]],[1510.79,[3460.44,6289.74,78.4027]],[1510.79,[3460.44,6289.74,78.4027]],[1510.79,[3460.44,6289.74,78.4027]],[1510.79,[3460.44,6289.74,78.4027]],[1510.81,[3460.02,6297.64,76.923]],[1510.81,[3460.02,6297.64,76.923]],[1510.82,[3459.61,6305.47,75.2995]],[1510.82,[3459.61,6305.47,75.2995]],[1510.83,[3459.61,6305.47,75.2995]],[1510.83,[3459.61,6305.47,75.2995]],[1510.84,[3459.2,6313.26,72.6418]],[1510.84,[3459.2,6313.26,72.6418]],[1510.84,[3459.2,6313.26,72.6418]],[1510.84,[3459.2,6313.26,72.6418]],[1510.86,[3458.81,6320.68,72.4449]],[1510.86,[3458.81,6320.68,72.4449]],[1510.86,[3458.81,6320.68,72.4449]],[1510.86,[3458.81,6320.68,72.4449]],[1510.87,[3458.41,6328.2,73.2113]],[1510.87,[3458.41,6328.2,73.2113]],[1510.88,[3458.41,6328.2,73.2113]],[1510.88,[3458.41,6328.2,73.2113]],[1510.89,[3458.02,6335.67,72.991]],[1510.89,[3458.02,6335.67,72.991]],[1510.89,[3458.02,6335.67,72.991]],[1510.89,[3458.02,6335.67,72.991]],[1510.91,[3457.63,6343.09,73.0013]],[1510.91,[3457.63,6343.09,73.0013]],[1510.91,[3457.63,6343.09,73.0013]],[1510.91,[3457.63,6343.09,73.0013]],[1510.93,[3457.24,6350.46,71.4954]],[1510.93,[3457.24,6350.46,71.4954]],[1510.94,[3456.86,6357.64,69.8112]],[1510.94,[3456.86,6357.64,69.8112]],[1510.94,[3456.86,6357.64,69.8112]],[1510.94,[3456.86,6357.64,69.8112]],[1510.96,[3456.48,6364.91,67.8952]],[1510.96,[3456.48,6364.91,67.8952]],[1510.96,[3456.48,6364.91,67.8952]],[1510.96,[3456.48,6364.91,67.8952]],[1510.97,[3456.1,6372.13,65.8564]],[1510.97,[3456.1,6372.13,65.8564]],[1510.98,[3456.1,6372.13,65.8564]],[1510.98,[3456.1,6372.13,65.8564]],[1643.26,[3484.48,5833.24,1.52286]],[1643.26,[3483.32,5844.93,4.80634]],[1643.26,[3483.32,5844.93,4.80634]],[1643.26,[3483.32,5844.93,4.80634]],[1643.27,[3482.17,5856.49,5.98055]],[1643.28,[3482.17,5856.49,5.98055]],[1643.28,[3482.17,5856.49,5.98055]],[1643.28,[3482.17,5856.49,5.98055]],[1643.29,[3481.05,5867.7,8.73709]],[1643.29,[3481.05,5867.7,8.73709]],[1643.29,[3481.05,5867.7,8.73709]],[1643.29,[3481.05,5867.7,8.73709]],[1643.31,[3479.93,5879.03,13.3659]],[1643.31,[3479.93,5879.03,13.3659]],[1643.31,[3479.93,5879.03,13.3659]],[1643.31,[3479.93,5879.03,13.3659]],[1643.32,[3478.83,5890.01,18.1222]],[1643.33,[3478.83,5890.01,18.1222]],[1643.33,[3478.83,5890.01,18.1222]],[1643.33,[3478.83,5890.01,18.1222]],[1643.34,[3477.73,5901.1,22.8056]],[1643.34,[3477.73,5901.1,22.8056]],[1643.34,[3477.73,5901.1,22.8056]],[1643.34,[3477.73,5901.1,22.8056]],[1643.36,[3476.62,5912.29,27.3002]],[1643.36,[3476.62,5912.29,27.3002]],[1643.38,[3475.49,5923.59,32.5976]],[1643.38,[3475.49,5923.59,32.5976]],[1643.38,[3475.49,5923.59,32.5976]],[1643.38,[3475.49,5923.59,32.5976]],[1643.39,[3474.4,5934.56,37.4833]],[1643.39,[3474.4,5934.56,37.4833]],[1643.39,[3474.4,5934.56,37.4833]],[1643.39,[3474.4,5934.56,37.4833]],[1643.41,[3473.37,5944.98,41.3574]],[1643.41,[3473.37,5944.98,41.3574]],[1643.41,[3473.37,5944.98,41.3574]],[1643.41,[3473.37,5944.98,41.3574]],[1643.42,[3472.34,5955.31,45.8862]],[1643.43,[3472.34,5955.31,45.8862]],[1643.43,[3472.34,5955.31,45.8862]],[1643.43,[3472.34,5955.31,45.8862]],[1643.44,[3471.32,5965.54,51.7529]],[1643.44,[3471.32,5965.54,51.7529]],[1643.44,[3471.32,5965.54,51.7529]],[1643.44,[3471.32,5965.54,51.7529]],[1643.46,[3470.29,5975.88,57.1967]],[1643.46,[3470.29,5975.88,57.1967]],[1643.46,[3470.29,5975.88,57.1967]],[1643.46,[3470.29,5975.88,57.1967]],[1643.48,[3469.25,5986.33,62.4908]],[1643.48,[3469.25,5986.33,62.4908]],[1643.48,[3469.25,5986.33,62.4908]],[1643.49,[3468.24,5996.47,65.9761]],[1643.49,[3468.24,5996.47,65.9761]],[1643.49,[3468.24,5996.47,65.9761]],[1643.49,[3468.24,5996.47,65.9761]],[1643.49,[3468.24,5996.47,65.9761]],[1643.51,[3467.25,6006.52,66.3245]],[1643.51,[3467.25,6006.52,66.3245]],[1643.51,[3467.25,6006.52,66.3245]],[1643.51,[3467.25,6006.52,66.3245]],[1643.52,[3466.3,6016.07,66.9947]],[1643.53,[3466.3,6016.07,66.9947]],[1643.53,[3466.3,6016.07,66.9947]],[1643.53,[3466.3,6016.07,66.9947]],[1643.54,[3465.29,6026.14,67.7405]],[1643.54,[3465.29,6026.14,67.7405]],[1643.54,[3465.29,6026.14,67.7405]],[1643.54,[3465.29,6026.14,67.7405]],[1643.56,[3464.32,6035.91,68.545]],[1643.56,[3464.32,6035.91,68.545]],[1643.56,[3464.32,6035.91,68.545]],[1643.56,[3464.32,6035.91,68.545]],[1643.57,[3463.34,6045.79,68.9536]],[1643.58,[3463.34,6045.79,68.9536]],[1643.58,[3463.34,6045.79,68.9536]],[1643.58,[3463.34,6045.79,68.9536]],[1643.59,[3462.4,6055.2,70.2995]],[1643.59,[3462.4,6055.2,70.2995]],[1643.61,[3461.46,6064.71,72.0623]],[1643.61,[3461.46,6064.71,72.0623]],[1643.61,[3461.46,6064.71,72.0623]],[1643.61,[3461.46,6064.71,72.0623]],[1643.62,[3460.54,6073.96,71.0949]],[1643.63,[3460.54,6073.96,71.0949]],[1643.63,[3460.54,6073.96,71.0949]],[1643.63,[3460.54,6073.96,71.0949]],[1643.64,[3459.61,6083.31,71.6406]],[1643.64,[3459.61,6083.31,71.6406]],[1643.64,[3459.61,6083.31,71.6406]],[1643.64,[3459.61,6083.31,71.6406]],[1643.66,[3458.69,6092.58,72.0459]],[1643.66,[3458.69,6092.58,72.0459]],[1643.66,[3458.69,6092.58,72.0459]],[1643.66,[3458.69,6092.58,72.0459]],[1643.67,[3457.77,6101.77,71.6366]],[1643.68,[3457.77,6101.77,71.6366]],[1643.68,[3457.77,6101.77,71.6366]],[1643.68,[3457.77,6101.77,71.6366]],[1643.69,[3456.83,6111.25,70.3718]],[1643.69,[3456.83,6111.25,70.3718]],[1643.7,[3456.83,6111.25,70.3718]],[1643.7,[3456.83,6111.25,70.3718]],[1643.71,[3455.93,6120.28,67.7031]],[1643.71,[3455.93,6120.28,67.7031]],[1643.71,[3455.93,6120.28,67.7031]],[1643.72,[3455.04,6129.24,63.9799]],[1643.73,[3455.04,6129.24,63.9799]],[1643.73,[3455.04,6129.24,63.9799]],[1643.73,[3455.04,6129.24,63.9799]],[1643.74,[3454.19,6137.77,60.6124]],[1643.74,[3454.19,6137.77,60.6124]],[1643.74,[3454.19,6137.77,60.6124]],[1643.74,[3454.19,6137.77,60.6124]],[1643.76,[3453.31,6146.58,57.9178]],[1643.76,[3453.31,6146.58,57.9178]],[1643.76,[3453.31,6146.58,57.9178]],[1643.76,[3453.31,6146.58,57.9178]],[1643.77,[3452.44,6155.32,55.2917]],[1643.78,[3452.44,6155.32,55.2917]],[1643.78,[3452.44,6155.32,55.2917]],[1643.78,[3452.44,6155.32,55.2917]],[1643.79,[3451.56,6164.17,53.1226]],[1643.79,[3451.56,6164.17,53.1226]],[1643.79,[3451.56,6164.17,53.1226]],[1643.79,[3451.56,6164.17,53.1226]],[1643.81,[3450.71,6172.77,51.7675]],[1643.81,[3450.71,6172.77,51.7675]],[1643.81,[3450.71,6172.77,51.7675]],[1643.81,[3450.71,6172.77,51.7675]],[1643.82,[3449.84,6181.47,51.103]],[1643.83,[3449.84,6181.47,51.103]],[1643.84,[3449,6189.94,50.3103]],[1643.84,[3449,6189.94,50.3103]],[1643.84,[3449,6189.94,50.3103]],[1643.84,[3449,6189.94,50.3103]],[1643.86,[3448.17,6198.33,52.218]],[1643.86,[3448.17,6198.33,52.218]],[1643.86,[3448.17,6198.33,52.218]],[1643.86,[3448.17,6198.33,52.218]],[1643.87,[3447.34,6206.67,55.3333]],[1643.88,[3447.34,6206.67,55.3333]],[1643.88,[3447.34,6206.67,55.3333]],[1643.88,[3447.34,6206.67,55.3333]],[1643.89,[3446.53,6214.77,59.582]],[1643.89,[3446.53,6214.77,59.582]],[1643.89,[3446.53,6214.77,59.582]],[1643.89,[3446.53,6214.77,59.582]],[1643.91,[3445.71,6222.98,61.7181]],[1643.91,[3445.71,6222.98,61.7181]],[1643.91,[3445.71,6222.98,61.7181]],[1643.91,[3445.71,6222.98,61.7181]],[1643.93,[3444.92,6230.96,64.2169]],[1643.93,[3444.92,6230.96,64.2169]],[1643.93,[3444.92,6230.96,64.2169]],[1643.93,[3444.92,6230.96,64.2169]],[1643.94,[3444.12,6239.05,67.6158]],[1643.94,[3444.12,6239.05,67.6158]],[1643.94,[3444.12,6239.05,67.6158]],[1643.96,[3443.32,6247.07,72.666]],[1643.96,[3443.32,6247.07,72.666]],[1643.96,[3443.32,6247.07,72.666]],[1643.96,[3443.32,6247.07,72.666]],[1643.97,[3442.53,6255.04,76.9326]],[1643.98,[3442.53,6255.04,76.9326]],[1643.98,[3442.53,6255.04,76.9326]],[1643.98,[3442.53,6255.04,76.9326]],[1643.99,[3441.74,6262.95,83.5866]],[1643.99,[3441.74,6262.95,83.5866]],[1643.99,[3441.74,6262.95,83.5866]],[1643.99,[3441.74,6262.95,83.5866]],[1644.01,[3440.96,6270.8,89.473]],[1644.01,[3440.96,6270.8,89.473]],[1644.01,[3440.96,6270.8,89.473]],[1644.01,[3440.96,6270.8,89.473]],[1644.02,[3440.18,6278.59,90.5584]],[1644.03,[3440.18,6278.59,90.5584]],[1644.03,[3440.18,6278.59,90.5584]],[1644.03,[3440.18,6278.59,90.5584]],[1644.04,[3439.41,6286.33,89.1251]],[1644.04,[3439.41,6286.33,89.1251]],[1644.04,[3439.41,6286.33,89.1251]],[1644.04,[3439.41,6286.33,89.1251]],[1644.06,[3438.65,6294.01,88.6958]],[1644.06,[3438.65,6294.01,88.6958]],[1644.06,[3438.65,6294.01,88.6958]],[1644.06,[3438.65,6294.01,88.6958]],[1644.07,[3437.88,6301.79,88.5098]],[1644.08,[3437.88,6301.79,88.5098]],[1644.08,[3437.88,6301.79,88.5098]],[1644.08,[3437.88,6301.79,88.5098]],[1644.09,[3437.11,6309.51,89.7306]],[1644.09,[3437.11,6309.51,89.7306]],[1644.09,[3437.11,6309.51,89.7306]],[1644.09,[3437.11,6309.51,89.7306]],[1644.11,[3436.36,6317.03,90.8305]],[1644.11,[3436.36,6317.03,90.8305]],[1644.11,[3436.36,6317.03,90.8305]],[1644.11,[3436.36,6317.03,90.8305]],[1644.13,[3435.6,6324.65,91.292]],[1644.13,[3435.6,6324.65,91.292]],[1644.13,[3435.6,6324.65,91.292]],[1644.13,[3435.6,6324.65,91.292]],[1644.14,[3434.88,6331.92,90.9238]],[1644.14,[3434.88,6331.92,90.9238]],[1644.14,[3434.88,6331.92,90.9238]],[1644.14,[3434.88,6331.92,90.9238]],[1644.16,[3434.15,6339.28,90.4247]],[1644.16,[3434.15,6339.28,90.4247]],[1644.16,[3434.15,6339.28,90.4247]],[1644.16,[3434.15,6339.28,90.4247]],[1644.17,[3433.43,6346.45,89.2944]],[1644.18,[3433.43,6346.45,89.2944]],[1644.19,[3432.71,6353.72,86.6788]],[1644.19,[3432.71,6353.72,86.6788]],[1644.19,[3432.71,6353.72,86.6788]],[1644.19,[3432.71,6353.72,86.6788]],[1644.21,[3431.99,6360.93,84.2802]],[1644.21,[3431.99,6360.93,84.2802]],[1644.21,[3431.99,6360.93,84.2802]],[1644.21,[3431.99,6360.93,84.2802]],[1644.22,[3431.28,6368.1,83.6019]],[1644.23,[3431.28,6368.1,83.6019]],[1644.23,[3431.28,6368.1,83.6019]],[1644.23,[3431.28,6368.1,83.6019]]]

 

 

 

This will still only track every ~4ms or so.

Not sure if there's a more accurate way to get a measurement exactly every single ms.

 

Edit: Also what @Greenfist said, bullets only get updated every frame, can somewhat see that in the example output above.

 

Cheers

Share this post


Link to post
Share on other sites
Quote
40 minutes ago, Greenfist said:

The bullet's position is updated only once per frame. You'd have to calculate the position between them manually. 

You could slow down the time to get 1/1000s resolution. But why do you need so accurate data?

 

 I wrote app calulating firesolutions. however I'm getting diffrent results  in game. My algorithm used to work perfectly in ACE2 (in vanilla one doesnt use wind though ;) ). However it updates bullet data (position, velocity) every 1ms. Tell me please how often this data is updated in multiplayer (vanilla)? Maybe the problem lays in framework? Is this client side thing? Or server?

Share this post


Link to post
Share on other sites
24 minutes ago, Mariusz B said:

 I wrote app calulating firesolutions. however I'm getting diffrent results  in game. My algorithm used to work perfectly in ACE2 (in vanilla one doesnt use wind though ;) ). However it updates bullet data (position, velocity) every 1ms. Tell me please how often this data is updated in multiplayer (vanilla)? Maybe the problem lays in framework? Is this client side thing? Or server?

Fire solutions for what exactly? Rifles?

Artillery basically needs a simple parabola formula and can hit up to 73km (max range with 810m/s muzzle velocity and 45° angle) at pinpoint precision.

Doing 1ms checks on anything isn't really recommended in MP.

 

Cheers

Share this post


Link to post
Share on other sites
3 hours ago, Mariusz B said:

 I wrote app calulating firesolutions. however I'm getting diffrent results  in game. My algorithm used to work perfectly in ACE2 (in vanilla one doesnt use wind though ;) ). However it updates bullet data (position, velocity) every 1ms. Tell me please how often this data is updated in multiplayer (vanilla)? Maybe the problem lays in framework? Is this client side thing? Or server?

 

Yep! good questions. I can't imagine all bullets synced on all PCs... but, if the ballistic calculation is done locally, how does it work for getting the exact same hits, deflections or else? For example, when you make an AI play an animation, there is no real sync between two PCs. when you shoot at it, what's happens on each PCs? I didn't find any clear explanation. If ballistic is well documented (fine video), did you find something about the network sync?

Share this post


Link to post
Share on other sites

Ive run few test and I came to conclusion (cant confirm 100% though). Bullet position is updated with every client frame. However position calculation is with 1ms accuracy. So every frame, algorithm is running number of itterations for missing timeticks. So for 60FPSit  is 17 timeticks and then bullet update. In result every client will get same trajectory no matter lag. But its only my guess based on data Ive gathered :D

 

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, Mariusz B said:

Ive run few test and I came to conclusion (cant confirm 100% though). Bullet position is updated with every client frame. However position calculation is with 1ms accuracy. So every frame, algorithm is running number of itterations for missing timeticks. So for 60FPSit  is 17 timeticks and then bullet update. In result every client will get same trajectory no matter lag. But its only my guess based on data Ive gathered :D

 

Sounds about right and makes sense. Wish that the devs would show up and explain stuff like that from time to time, wouldn't hurt.

 

Cheers

Share this post


Link to post
Share on other sites

That's not the calculation for trajectory which makes me perplex. Same parameters will end with the same mathematical results everywhere. It's the fact that some players can have more than 200 ms for ping, some other only 20 ms. If your AIs is moving, how can you get the same hits/damage everywhere? Just with a simple delay due to (a variable!) ping?

I suggested firing on animated Ais (like a guy repairing a vehicle) because it's evident. I tested and I'm sure JIP will not have a synced sequence with others. You can have a ending sequence on server and a starting one locally. If you shoot dead the guy at head (from hosted for example), you kill it but the head can be elsewhere in client animation, even considering the ping delay....

 

read: can have more than 200 ms of ping...

Share this post


Link to post
Share on other sites
20 hours ago, pierremgi said:

That's not the calculation for trajectory which makes me perplex. Same parameters will end with the same mathematical results everywhere. It's the fact that some players can't have more than 200 ms for ping, some other only 20 ms. If your AIs is moving, how can you get the same hits/damage everywhere? Just with a simple delay due to (a variable!) ping?

I suggested firing on animated Ais (like a guy repairing a vehicle) because it's evident. I tested and I'm sure JIP will not have a synced sequence with others. You can have a ending sequence on server and a starting one locally. If you shoot dead the guy at head (from hosted for example), you kill it but the head can be elsewhere in client animation, even considering the ping delay....

I was only considering bullet path. You also raise importnant question. Game mechanics after syncing back has to decide which events to confirm.

Share this post


Link to post
Share on other sites
On 11.2.2018 at 11:18 AM, Mariusz B said:

Hi :)

 

I want my script to report bullet position every milisecond including a moment of fire. However loop occurs every game frame.

Impossible. Just like you can't tap your finger on something every milliseconds. Your body is just not fast enough for that.

 

On 11.2.2018 at 1:34 PM, Mariusz B said:

 I wrote app calulating firesolutions. however I'm getting diffrent results  in game. My algorithm used to work perfectly in ACE2 (in vanilla one doesnt use wind though ;) ). However it updates bullet data (position, velocity) every 1ms. Tell me please how often this data is updated in multiplayer (vanilla)? Maybe the problem lays in framework? Is this client side thing? Or server?

It definitely doesn't update every 1ms.

 

Can you explain exactly what you are trying to do? Calculate point of impact with vanilla Arma based on muzzle velocity?
Or ACE3 Advanced ballistics or what exactly.

Share this post


Link to post
Share on other sites
On 19.02.2018 at 10:23 AM, Dedmen said:

It definitely doesn't update every 1ms.

 

As ppl said and my findings came to same conclusion.

 

On 19.02.2018 at 10:23 AM, Dedmen said:

Can you explain exactly what you are trying to do? Calculate point of impact with vanilla Arma based on muzzle velocity?
Or ACE3 Advanced ballistics or what exactly.

Vanilla. And its working perfectly :D now when i found out how exactly its simulated. So no further assistance is needed :D

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

×