Page 1 of 1

Remove the stuttering that occurs in weapon firing every sec

Posted: 02 Mar 2014, 02:03
by Forboding Angel
We all know it. If you have a unit that fires continuously (around 0.1 reload) you will get stuttering at random times, even when the unit is just sitting still firing at the ground. It makes things like beamlasers and fast firing cannons very difficult to accurately balance, because the target sweet spot for damage is always moving.

Re: Remove the stuttering that occurs in weapon firing every

Posted: 02 Mar 2014, 12:04
by knorke
Example?

I have not noticed weapon fire stuttering unless:
-there is problem with script
-or with defs
-or shooting the ground craters it a bit -> unit reaims

for example see attached gadget, it shows time (in frames) between two shots. In this picture both units have the same weapon with funny reloadtime=0.09
One unit shots like 2 2 2 2 2 2 2 2 2 2 2 2 2
other unit shots like 2 2 2 2 3 2 2 2 2 3 2 2 2
Image
The difference between them is the script. (actually yes the model too, forgot to use same one. but imo it is the script anyway with its threads)

Here put name of weapon to be tested:
Script.SetWatchWeapon (WeaponDefNames["machinegun"].id, true)
Here put how many frames it should usually take for it to fire: (for the abnormal warning, otherwise chat scrolls too fast to notice)
local usual=3

Also imo putting "remove the bug" in front on of a bug report does not turn a bugreport into a feature request?

Re: Remove the stuttering that occurs in weapon firing every

Posted: 02 Mar 2014, 13:04
by FLOZi
If script is problem, please also attach scripts for comparison :-)

Re: Remove the stuttering that occurs in weapon firing every

Posted: 02 Mar 2014, 15:29
by Silentwings
I am also not able to reproduce what you''re claiming - more info pls.

Re: Remove the stuttering that occurs in weapon firing every

Posted: 03 Mar 2014, 03:07
by Forboding Angel

Re: Remove the stuttering that occurs in weapon firing every

Posted: 03 Mar 2014, 06:26
by Google_Frog
I just converted a unit from bos to lua and it lost a 4 frame stutter. The unit has beamtime 0.1 and reload time 0.1.

Re: Remove the stuttering that occurs in weapon firing every

Posted: 03 Mar 2014, 06:58
by Forboding Angel
Thanks Google. I was talking to smoth earlier and we more or less came to the conclusion of "because bos". It's very nice to have that confirmed. Huge thanks.

Re: Remove the stuttering that occurs in weapon firing every

Posted: 03 Mar 2014, 07:20
by jK

Code: Select all

AimWeapon1(heading, pitch)
{ 
signal SIG_AIM; 
set-signal-mask SIG_AIM; 
turn turret to y-axis heading speed <1000>; 
turn barrel1 to x-axis <0> - pitch speed <1000>;  
wait-for-turn turret around y-axis; <------------------
wait-for-turn barrel1 around x-axis; <------------------
start-script RestoreAfterDelay(); 
return (1); 
} 
+

Code: Select all

RestoreAfterDelay()
{ 
<-- missing signal-mask, so it restores/turns even when there were AimWeapon() calls between!
sleep 3000; 
turn turret to y-axis <0> speed <60>; 
turn barrel1 to x-axis <0> speed <30>;  
} 

Re: Remove the stuttering that occurs in weapon firing every

Posted: 03 Mar 2014, 08:09
by FLOZi
Functions inherit the signal mask of the function that called them...

Re: Remove the stuttering that occurs in weapon firing every

Posted: 03 Mar 2014, 10:06
by Forboding Angel
JK, I don't think anyone includes the signal masks in their RestoreAfterDelay() functions. As flozi said, I always understood that because Aimweapon1() called it, the signal was inherited.


Edit: Just tried it, adding signal to restoreafterdelay has no effect.

Re: Remove the stuttering that occurs in weapon firing every

Posted: 15 Mar 2014, 02:35
by Noruas
If I remember correctly there is a command you can add to the weapon info that you can call that adds an angle tolerance so that it can fire smoothly regardless of any jittery or slight aiming calibrations so you don't have to point straight at the target. I believe it was called Tolerance. To see or verify if its an aiming issue you could try setting "turret" to false so that aiming is void and see if it still fires inconsistently.

Re: Remove the stuttering that occurs in weapon firing every

Posted: 15 Mar 2014, 10:11
by FLOZi
Noruas wrote:If I remember correctly there is a command you can add to the weapon info that you can call that adds an angle tolerance so that it can fire smoothly regardless of any jittery or slight aiming calibrations so you don't have to point straight at the target. I believe it was called Tolerance. To see or verify if its an aiming issue you could try setting "turret" to false so that aiming is void and see if it still fires inconsistently.
Reasonably sure the problem in OP is not the tolerance problem.

Re: Remove the stuttering that occurs in weapon firing every

Posted: 15 Mar 2014, 10:49
by Forboding Angel
Nah, it's not tolerance. As mentioned, it is almost undoubtedly due to BOSfail.