Page 1 of 1

Gun Turret shooting speed.

Posted: Thu Oct 15, 2015 5:53 pm
by oLaudix
When fully upgraded Gun Turret's shooting speed shows: 10+16/s. So in theory it should use about 2.5 clip per second. I got curious because that gives much higher dps than laser tower and was very disappointed when i saw this: https://gfycat.com/SomeFinishedDuckbillcat. Granted it was recorded with 30 ups but still souldn't it shoot faster?

Re: Gun Turret shooting speed.

Posted: Thu Oct 15, 2015 7:07 pm
by cartmen180
gun turrets are op and dispense their ammo a lot faster than on that gif. I don't see the use of laserturrets. I need that powar elsewhere!!

Re: Gun Turret shooting speed.

Posted: Thu Oct 15, 2015 9:49 pm
by oLaudix
cartmen180 wrote:gun turrets are op and dispense their ammo a lot faster than on that gif. I don't see the use of laserturrets. I need that powar elsewhere!!
Turret was shooting at half of its normal speed since i only have 30 udp in that save. But still twice as that is not fast :/

Re: Gun Turret shooting speed.

Posted: Fri Oct 16, 2015 3:22 pm
by bobucles
Gun turrets have some lag when switching between targets, since they use simulated swivel turrets.

Make sure it's fully unloading on a big'n before recording.

Re: Gun Turret shooting speed.

Posted: Fri Oct 16, 2015 3:59 pm
by oLaudix
bobucles wrote:Gun turrets have some lag when switching between targets, since they use simulated swivel turrets.

Make sure it's fully unloading on a big'n before recording.
It was. Target switch occured only once during this short clip.

Re: Gun Turret shooting speed.

Posted: Sat Oct 17, 2015 3:01 am
by bobucles
It is common in games for fast weapons to suffer from an "integer rounding" glitch. What I mean is that the game counts each frame until a weapon is ready to attack, and then the counter is reset, eliminating the overflow. What you get are weapons that "round down" their attack speed to instead attack every X number of frames, and weapon speeds in between these values have no effect. Dealing with attack speed "breakpoints" was a major deal in the sprite based Diablo II game. Here's a little article on it:
http://diablo2.diablowiki.net/Breakpoints

I don't know how factorio tracks weapon attacks. But if a weapon attack occurs every X integer number of frames, you will get major issues with weapons that attack more than 10/sec, and weapons that fire faster than the frame rate will absolutely cap at 1/frame. The breakpoints would be as follows, given 60 game ticks per second:

Code: Select all

Att/s. frames
10     6
12     5
15     4
20     3
30     2
60     1
If there is a breakpoint issue, the fully upgraded 10+16 weapon would be frame capped to attack 20 times a second. But you clearly don't shoot at that rate. You claim the simulation is running at half, and the fire rate is closer to 5/sec. Doubling the measurement suggests the weapon is firing at about 10/sec. It is more likely that your attack speed isn't being properly augmented by the research at all.

It is also possible that the turret is losing attack frames to track a moving enemy target. You still suffer from a breakpoint issue here, where after every attack you lose some number of frames to re establish a lock on the enemy. In this case the loss of attack speed would be more unpredictable and depend on how well the turret can aim. Wasn't the turret code changed recently?

It would be nice to have a dev tool to step the simulation one tick at a time. It would have some nice niche uses for getting exact measurements on stuff.

Re: Gun Turret shooting speed.

Posted: Sat Oct 17, 2015 10:40 am
by oLaudix
bobucles wrote:It is common in games [...] for getting exact measurements on stuff.
I see. So it might be similar issue as modded Assembling Machines. 2 bad, since I wanted to replace my laser turrets with gun turrets.