Page 1 of 1

Turret lowers framerate after first shot?

Posted: Mon Jun 13, 2016 3:41 am
by Galacticruler
I have a railgun turret in a mod I'm producing and for some reason it can shoot one shot and then the frame rate starts to plumet; if removed the frame rate returns to normal.
No special LUA is running on it, its just a long range turret (500m) with a low firing speed.

Re: Turret lowers framerate after first shot?

Posted: Mon Jun 13, 2016 8:45 am
by Rseding91
If the range is 500 then it's going to need to scan a 1000x1000 tile area around its self for things to shoot when it gets ready to shoot which is going to be slow.

Don't make the range 500 - problem solved.

Re: Turret lowers framerate after first shot?

Posted: Mon Jun 13, 2016 7:15 pm
by Galacticruler
Rseding91 wrote:If the range is 500 then it's going to need to scan a 1000x1000 tile area around its self for things to shoot when it gets ready to shoot which is going to be slow.

Don't make the range 500 - problem solved.
hmmm. I guess that is a bit excessive. so the math on that is range x2 ^2?

Re: Turret lowers framerate after first shot?

Posted: Mon Jun 13, 2016 7:48 pm
by ledzilla
Rseding91 wrote:If the range is 500 then it's going to need to scan a 1000x1000 tile area around its self for things to shoot when it gets ready to shoot which is going to be slow.

Don't make the range 500 - problem solved.
But wouldn't that also mean that the frame rate should drop upon placement, as well? Because the scanning for enemy targets should be constant upon placement, why would the frame rate drop when scanning after a shot is fired but not after being placed on the ground? Is there something different that occurs once a turret has fired its first shot?

Re: Turret lowers framerate after first shot?

Posted: Mon Jun 13, 2016 7:51 pm
by ledzilla
Galacticruler wrote:
Rseding91 wrote:If the range is 500 then it's going to need to scan a 1000x1000 tile area around its self for things to shoot when it gets ready to shoot which is going to be slow.

Don't make the range 500 - problem solved.
hmmm. I guess that is a bit excessive. so the math on that is range x2 ^2?
I believe the math would be a lot closer to pi * radius^2, as if I understand correctly, turrets have a circular firing area. With a 500 tile range, though, that's still a lot of ground to cover.

Re: Turret lowers framerate after first shot?

Posted: Mon Jun 13, 2016 8:58 pm
by Rseding91
ledzilla wrote:
Rseding91 wrote:If the range is 500 then it's going to need to scan a 1000x1000 tile area around its self for things to shoot when it gets ready to shoot which is going to be slow.

Don't make the range 500 - problem solved.
But wouldn't that also mean that the frame rate should drop upon placement, as well? Because the scanning for enemy targets should be constant upon placement, why would the frame rate drop when scanning after a shot is fired but not after being placed on the ground? Is there something different that occurs once a turret has fired its first shot?
Scanning only happens when an enemy is within range to fire else the game's performance would go to garbage with more turrets placed.

Re: Turret lowers framerate after first shot?

Posted: Wed Jun 15, 2016 7:03 pm
by ledzilla
Rseding91 wrote:Scanning only happens when an enemy is within range to fire else the game's performance would go to garbage with more turrets placed.
Ok. so does that mean that scanning is for detecting info on all enemy targets within range once an enemy has crossed the range threshold? Just trying to reconcile the game's behavior of my own preconceived notions of how I would interpret the functionality.

Re: Turret lowers framerate after first shot?

Posted: Wed Jun 15, 2016 7:13 pm
by Rseding91
ledzilla wrote:
Rseding91 wrote:Scanning only happens when an enemy is within range to fire else the game's performance would go to garbage with more turrets placed.
Ok. so does that mean that scanning is for detecting info on all enemy targets within range once an enemy has crossed the range threshold? Just trying to reconcile the game's behavior of my own preconceived notions of how I would interpret the functionality.
yes