Eye for an Eye fixed


Biters that damage your structures take a portion of that damage in return – turning every breach into a self‑defeating attack. (Modular testing ongoin) Fully compatible with Factorio 2.0 and 2.1 (and Space Age). Now with a modular codebase, dynamic polling for instant setting feedback, clean scientific‑notation display, and optional debug logging. Every enemy kill reduces evolution; nest destruction evolution gain is toggleable. All settings are runtime‑global and take effect immediately.

Tweaks
a day ago
0.17 - 2.1
715
Enemies
Owner:
gearsgod
Source:
N/A
Homepage:
N/A
License:
CC BY SA 4.0
Created:
7 years ago
Latest Version:
2.10.20 (a day ago)
Factorio version:
0.17 - 2.1
Downloaded by:
715 users

Eye for an Eye

A huge thank you to both myself and everyone in the DabriaTeam for making my dream come true. This was the one mod I personally loved and made the game just more playable for me.

Fully updated for Factorio 2.0 and 2.1 (and Space Age).


Overview

When an enemy damages your buildings, they get a taste of their own medicine. Eye for an Eye reflects a configurable percentage of damage back to any attacker that hits a player‑owned structure. Every enemy kill also reduces the global evolution factor, giving you a tangible reward for successful defence.

"An eye for an eye makes the whole world blind" – but in Factorio, it makes the biters think twice.


Features

  • Reflection Damage – Any enemy that damages your buildings receives a configurable percentage of that damage back (default: 20%). Fully adjustable from 0% to 10,000%.
  • Evolution Reduction – Every enemy kill reduces the global evolution factor by a configurable amount. Turn the tide against the biters!
  • Nest Destruction Control – Optionally prevent spawner destruction from adding evolution (enabled by default).
  • Fully Configurable – All settings are runtime‑global and take effect immediately. No restart required.
  • Reliable Notifications – See a chat message whenever the evolution reduction setting is changed – works for both the Map tab and Player tab, even when on_runtime_mod_setting_changed would not fire.
  • Chat Spam Control – Disable chat messages for mass killing sessions.
  • Performance‑Friendly – Dynamic polling starts fast for testing, then gracefully slows to once per hour when no changes are detected. The polling counter resets correctly on changes, ensuring you always get instant feedback when you tweak the setting.
  • Debug Logging – Optional verbose logging to factorio‑current.log for troubleshooting.

How It Works

  1. Reflection: When an enemy attacks a player‑owned building, the mod calculates a percentage of the damage dealt and applies it back to the attacker as electric damage.
  2. Evolution Reduction: Each time an enemy entity dies, the mod subtracts the configured amount from the global evolution factor.
  3. Nest Destruction: By default, destroying spawners adds zero evolution – you can disable this in the settings.

Settings

All settings are available in Settings → Mod Settings → Runtime Global:

Setting Default Description
Reflection Damage Multiplier 0.2 Damage reflected back (0 = none, 0.2 = 20%, 1 = 100%, 100 = 10000%)
Evolution Reduction per Kill 0.005 Evolution subtracted per enemy kill (0.01 = 1 percentage point)
Prevent Evolution from Nest Destruction true When enabled, destroying spawners adds NO evolution
Show Evolution Changes in Chat false Print evolution changes to chat (can be spammy)
Enable Debug Logging false Log detailed messages to factorio‑current.log

Commands

Command Description
/evolution-down Reduce evolution by the configured amount (testing)
/evolution-get Display current evolution with full precision
/eye-for-an-eye-set-reduction <value> Admin override – set the reduction directly (value between 0 and 0.5)
/eye-for-an-eye-check-setting Show the current reduction value

Why Use This Mod?

  • Punishes breaches – Biters that break through your walls will destroy themselves in the process.
  • Rewards defence – Killing enemies actively lowers evolution, making future waves easier.
  • Customisable – Tune the reflection strength and evolution reduction to your liking.
  • Lightweight – No tick‑based overhead for core logic; the mod only reacts when damage or death occurs, and the setting poller uses exponential backoff with a correctly reset counter for instant responsiveness.

Compatibility

  • Factorio 2.0.77+ – Fully compatible.
  • Factorio 2.1.0+ – Fully compatible (includes support for new events like on_entity_destroyed and on_player_color_changed).
  • Space Age – Fully compatible and verified on both versions.
  • Multiplayer – Works in multiplayer; settings are global.
  • Other mods – Uses standard API events (on_entity_died and on_entity_damaged). Conflicts are rare.

Credits

  • Original idea: abregado
  • Previous fixes: gearsgod
  • Factorio 2.0 / 2.1 rebuild and updates: Dabria

Support

Found a bug or have a suggestion? Report it on the Factorio Mod Portal with your factorio‑current.log file attached.


Version: 2.10.19
Last Updated: 2026-07-28
Factorio Versions: 2.0.77+ and 2.1.0+