Remove the stuttering that occurs in weapon firing every sec
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Remove the stuttering that occurs in weapon firing every sec
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
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
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?
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
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
Re: Remove the stuttering that occurs in weapon firing every
If script is problem, please also attach scripts for comparison
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Remove the stuttering that occurs in weapon firing every
I am also not able to reproduce what you''re claiming - more info pls.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Remove the stuttering that occurs in weapon firing every
http://youtu.be/V6xDa-3iIKU
For the video, I modified the reload and beam time of the snake unit to 0.1 so that it would be easy to show.
Snake
https://code.google.com/p/evolutionrts/ ... bbuggy.lua
https://code.google.com/p/evolutionrts/ ... bbuggy.bos
Flash
https://code.google.com/p/evolutionrts/ ... mflash.lua
https://code.google.com/p/evolutionrts/ ... mflash.bos
For the video, I modified the reload and beam time of the snake unit to 0.1 so that it would be easy to show.
Snake
https://code.google.com/p/evolutionrts/ ... bbuggy.lua
https://code.google.com/p/evolutionrts/ ... bbuggy.bos
Flash
https://code.google.com/p/evolutionrts/ ... mflash.lua
https://code.google.com/p/evolutionrts/ ... mflash.bos
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Remove the stuttering that occurs in weapon firing every
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.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Remove the stuttering that occurs in weapon firing every
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
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
Functions inherit the signal mask of the function that called them...
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Remove the stuttering that occurs in weapon firing every
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.
Edit: Just tried it, adding signal to restoreafterdelay has no effect.
Re: Remove the stuttering that occurs in weapon firing every
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
Reasonably sure the problem in OP is not the tolerance problem.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.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Remove the stuttering that occurs in weapon firing every
Nah, it's not tolerance. As mentioned, it is almost undoubtedly due to BOSfail.