Powered Entities


This mod will create power lines between most of the base game's entities that require power.

Content
3 years ago
0.13 - 1.1
1.95K
Power

b Unresponsive when using blueprints

4 years ago

I'm having an issue with this mod making Factorio become unresponsive. I've disabled all other mods and can still recreate the problem, along with the log/debug info I can safely assume it is this mod. The best that I've been able to recreate this issue is while using this mod, if I lay down a blueprint that has two staggered rail 90s that intersect at the bottom and curve to the right and up when the intersection point doesn't have a straight section where they meet, I will get a loop from the Action Script:

function Actions.checkAreaForEntityToPower(surface, force, area)
local entities = surface.find_entities_filtered{area=area, force=force}
local largestEntity, largestPowerPoleSize = Actions.Filters.findLargestEntity(entities)

if largestEntity then
    -- If a larger entity was found, then we are under something and should be looking at the larger entity, so zoom out to it
    local largestEntitySelectionBox = largestEntity["selection_box"]
    if not Util.isEqualBoundingBox(area, largestEntitySelectionBox) then
        Util.traceLog("Found a larger entity, zooming out to " .. largestEntity["name"])
        return Actions.checkAreaForEntityToPower(surface, force, largestEntitySelectionBox)
    end

that causes >350,000 loops in less than 15 seconds as seen by turning on debug and seeing this message repeating:

Script @Powered_Entities/scripts/actions.lua:143: Found a larger entity, zooming out to entity-ghost

I have screenshots of the blueprint and orientation that I can upload to your GitHub if that would help. This just started with version 4.0 and I've been able to recreate it consistently with the conditions described. There were some other instances that it occurred but I wasn't able to narrow those down as easily.

4 years ago

Hm I never tried testing with any massive blueprints. The mod doesn't really need to care about blueprints and ghosts, so I'm just going to filter them out. I'll have a hotfix in a bit.

4 years ago

Thanks for the bug report, this should be fixed in 0.4.1.

I tested with a massive blueprint that lagged my computer just looking at it, and I got < 1 second of a freeze when placing it.

4 years ago

Looks like that fixed it. I can't recreate it anymore :-) Thank you!

New response