Remove the stuttering that occurs in weapon firing every sec

Remove the stuttering that occurs in weapon firing every sec

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Remove the stuttering that occurs in weapon firing every sec

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Remove the stuttering that occurs in weapon firing every

Post 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?
Attachments
tp_projectile_counter.lua
(681 Bytes) Downloaded 12 times
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Remove the stuttering that occurs in weapon firing every

Post by FLOZi »

If script is problem, please also attach scripts for comparison :-)
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Remove the stuttering that occurs in weapon firing every

Post by Silentwings »

I am also not able to reproduce what you''re claiming - more info pls.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Remove the stuttering that occurs in weapon firing every

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Remove the stuttering that occurs in weapon firing every

Post 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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Remove the stuttering that occurs in weapon firing every

Post 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>;  
} 
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Remove the stuttering that occurs in weapon firing every

Post by FLOZi »

Functions inherit the signal mask of the function that called them...
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Remove the stuttering that occurs in weapon firing every

Post 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.
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Re: Remove the stuttering that occurs in weapon firing every

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Remove the stuttering that occurs in weapon firing every

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Remove the stuttering that occurs in weapon firing every

Post by Forboding Angel »

Nah, it's not tolerance. As mentioned, it is almost undoubtedly due to BOSfail.
Post Reply

Return to “Feature Requests”