Skip to content

Optimize wires with selective network recalculation #58

@SkimnerPhi

Description

@SkimnerPhi

At large scales, the most noticeable form of lag when interfacing with wires is the full network recomputation that triggers after buildings are placed or destroyed. While a full recalculation is needed on loading a savegame, it should be unnecessary for any further building.

By merging in NetworkBuddy the methods to only clear nearby networks become available. In short, only those that would connect to newly modified buildings should be cleared for recalculation. A new hook should be added so that mods can trigger the update as well, for unique buildings such as Wires-'s dynamic transmitter.

Additionally, merging NetworkBuddy adds some maintainability to the project, the mod predominantly breaks up one of the largest methods, recomputeWiresNetworks(), into manageable methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceAn improvement in performance is desired

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions