Turret lowers framerate after first shot?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Galacticruler
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Sat Apr 16, 2016 5:18 pm
Contact:

Turret lowers framerate after first shot?

Post 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.
PC is best.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13343
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Turret lowers framerate after first shot?

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Galacticruler
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Sat Apr 16, 2016 5:18 pm
Contact:

Re: Turret lowers framerate after first shot?

Post 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?
PC is best.

ledzilla
Inserter
Inserter
Posts: 23
Joined: Wed Jun 08, 2016 5:55 pm
Contact:

Re: Turret lowers framerate after first shot?

Post 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?

ledzilla
Inserter
Inserter
Posts: 23
Joined: Wed Jun 08, 2016 5:55 pm
Contact:

Re: Turret lowers framerate after first shot?

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13343
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Turret lowers framerate after first shot?

Post 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.
If you want to get ahold of me I'm almost always on Discord.

ledzilla
Inserter
Inserter
Posts: 23
Joined: Wed Jun 08, 2016 5:55 pm
Contact:

Re: Turret lowers framerate after first shot?

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13343
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Turret lowers framerate after first shot?

Post 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
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding help”