Improved global effects

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
SWeini
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Mon Apr 04, 2022 6:43 am
Contact:

Improved global effects

Post by SWeini »

TL;DR
More freedom on global or per-surface effects to not need hidden beacons that often.
What?
What we currently have:
  • LuaSurface::global_effect
  • some TechnologyModifier, such as lab-productivity, lab-speed, mining-productivity, recipe-productivity
These offer some possibilities (exactly what was envisioned for space age), but not enough for many mods. I'd like to see some of those:
  • imaginary modules that affect one (or all) surface(s) for one (or all) force(s), but only if that module is allowed in that entity - basically like a single hidden beacon with infinity range, but not interacting with any beacon profiles.
  • TechnologyModifier for those imaginary modules in addition/instead of runtime scripted
  • TechnologyModifier for per-recipe speed/consumption/pollution changes (not just productivity)
  • TechnologyModifier for per-building speed/consumption/pollution/productivity changes (could also affect non-crafting entities, e.g. mining drills)
Currently LuaSurface::global_effects completely ignores any effect restrictions set in place by entity or recipe. Would also be great to make this configurable somehow.

I would also appreciate a way to add effects (via mentioned methods or via normal modules) that do not contribute to the "one and only" +X% pool, but instead work independently, e.g. a +30% speed effect that would always multiply the speed by 1.3 instead of changing 500% speed to 530% speed which is barely noticeable.
Why?
Hidden beacons do work, but they are a burden to set up. They also make the compatibility between mods a lot more difficult, e.g. when moving an entity with picker dollies the hidden beacons has to move as well. All the hidden beacons in mods that I know of are used to simulate global or per-surface effects.
MeteorSwarm
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Thu Sep 25, 2025 10:49 pm
Contact:

Re: Improved global effects

Post by MeteorSwarm »

This effect has been somewhat addressed by the addition of LuaEntity::local_effect, enabling global effects via scripting that adds effects to entities on the planet.
SWeini
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Mon Apr 04, 2022 6:43 am
Contact:

Re: Improved global effects

Post by SWeini »

Yes, it's somewhat addressed. Now there is a very flexible system to provide any module effect dynamically to any building. LuaEntity::local_effect eliminates the need for hidden beacons, but it comes with a few problems, such as
1) need to keep track of built/destroyed buildings so that you can adjust their effect
2) difficult to change effects with an update (previously you could just change the effects of the hidden modules)
3) multiple mods can easily get in each other's way (especially when combined with previous point)
4) terrible situation for "rate calc" type of mods, the extra effect has no icon attached to it, there is no way to know what the effect of a ghost will be
5) terrible situation for "factory planner" type of mods, to support mods using this you need to provide free input for all effects. easy to make mistakes with.
Post Reply

Return to “Modding interface requests”