More Enemies


Simple idea of just having more enemies, with larger and/or more enemy attack groups. Comes with five preset difficulties: Easy(0.1), Vanilla(1), Vanilla+(1.75), Hard(4), and Insanity(11). Each added setting can be configured independently of the selected difficulty to personal taste. Engineer beware - they come for you.

Tweaks
a month ago
2.0
1.85K
Enemies
Owner:
TheEckelmonster
Source:
https://github.com/pje279/more-enemies
Homepage:
N/A
License:
MIT
Created:
6 months ago
Latest Version:
0.7.2 (a month ago)
Factorio version:
2.0
Downloaded by:
1.85K users

What does this mod do?

Be warned, this is not a light-weight mod; depending on your settings, expect performance degradation.

Comes with five preset difficulties: Easy(0.1), Vanilla(1), Vanilla+(1.75), Hard(4), and Insanity(11). Each setting can be configured independently of the selected difficulty to personal taste.

Makes no changes by default, i.e. you won't notice any changes unless you explicitly change the settings.

Born out of a desire to have increased difficulty by way of simply increasing the amount of enemies and/or attack groups.

Adds several settings for both startup and runtime to configure the amount of enemies up (or down).

Enemy entities (biters, spitters, pentapods) will be cloned based on the selected Difficulty (and other configured settings).

Enemy unit groups (the groups that form and attack from pollution or for retaliation) will be cloned based on the Difficulty setting (and other configured settings).

If attack groups are enabled (on by default), after 45 minutes (default, configurable) from the start of the game/initial mod installation/surface creation (e.g. arriving at a planet), there will be a chance for proactive attack groups to form.

  • Chance is affected by difficulty and current evolution factor; i.e. the higher the difficulty and/or the evolution factor, the more likely an attack group will spawn
  • Proactive attack groups will seek out and attack the closest non blacklisted hostile entity to them (beware, this can make Gleba significantly harder)

Have successfully "played" on Insanity with max settings, but is NOT RECOMMENDED; your game will lag, but hey, there will be more enemies.


Future Plans

  • Additional, more granular settings
    • Option for custom, specific difficulty - i.e. setting the difficulty to a specific number other than one of the preset difficulties (0.1, 1, 1.75, 4, & 11)
  • Possibly a configurable cloning cooldown timer for entity and unit group cloning
  • Potentially configurable proactive attack groups
    • Would attack of their own accord, independently of pollution or artillery strikes
    • -> Added as of 0.7.0
  • Refine/improve the logic by which attack groups are formed/targets are selected to be more intelligent
    • Presently simply attacking the closest non-blacklisted entity they can find
    • Currently developing an "overmind" that scales with evolution factor and difficulty, and will "learn" to an extent about the player and their factory
    • -> Would be toggleable/configurable, as usual
  • Potentially configurable proactive expansion groups
    • Would be independent of normal enemy expansion
  • Bug fixes/Compatibility
  • Performance optimization
    • Continue to improve compatibility/performance with B.R.E.A.M.
  • Requests
    • Feel free to ask, and I'll see what I can do

Technical details:

Hooks into,

  • on_entity_spawned
  • on_entity_died
  • on_unit_group_created
  • on_unit_group_finished_gathering
  • script_raised_built

Listens to those events to track the creation and death of enemy entities.

Also hooks into on_tick to control the actual cloning of the enemy entities.

When an enemy entity is created, or a unit group is created, they are each added to a list.

This list is iterated over up to a configurable limit per tick cycle (also configurable). While iterating through this list, if a valid entity is found, it will be cloned N amount of times, where N is an aggregate calculated based on the user settings; the overall Difficulty setting has the largest influence.


Startup settings:

Settings exposed for prototypes: "biter-spawner", "spitter-spawner", "gleba-spawner-small", and "gleba-spawner":

  • max_count_of_owned_units
  • max_count_of_owned_defensive_units
  • max_friends_around_to_spawn
  • max_defensive_friends_around_to_spawn
  • max_spawning_cooldown *
  • min_spawning_cooldown **

*Parameter one of property "spawning_cooldown"
**Parameter two of property "spawning_cooldown"

Map and path finding settings exposed:

  • max_gathering_unit_groups
  • clients_to_accept_any_new_request
  • clients_to_accept_short_new_request
  • direct_distance_to_consider_short_request
  • short_request_max_steps

Known Compatibility


Want something to be compatible/actively work with more-enemies?
  • Just let me know, and I'll see what I can do
  • Only real need is for the mod in question to raise the 'script_raised_built' event

    • i.e. add this line when creating an entity that should be detected by more-enemies

    script.raise_event(defines.events.script_raised_built, { entity = --[[entity that was created]], name = defines.events.script_raised_built, tick = game.tick })


Current Development Status

2025-09-16

  • The "overmind" is coming along very well. Still a bit rough and unpolished, but it's very much coming to life; attacks aren't just random anymore; it learns; it has a sense of memory; it sends out probing/scouting parties; it has a sense of personal space; it really doesn't appreciate being attacked, and will retaliate in kind; and proactively expands itself.
  • All of this is intended to be, and will be, configurable as usual, such that features/mechanics can be enabled disabled as desired
  • Will need to do another pass over the existing code for spawning/cloning units/unit groups to improve/optimize it further
  • Once again, the difficulty is being raised (potentially a fair bit this time) - apologies, or, you're welcome?

2025-08-14

  • Custom, user-defined difficulty settings have fallen by the wayside, as I have instead focused on improving the logic by which attack groups are created, controlled, and/or dispatched
    • Attacking the closest possible target works for the current implementation, but left me unsatisfied with quite how it felt -> wanting something more nuanced/intelligent
    • Have started developing what I have dubbed the "overmind" - i.e. the mind over the enemies; the the mind that is controlling them and their behavior

2025-08-10

  • Working on optimizing certain search functions for the attack group feature
  • Continuing to chip away at writing tests
  • Currently planning a custom, user-defined, difficulty setting as the next potential feature

2025-08-06

  • Figured out how to incorporate unit tests with the mod; am working to add tests and fix bugs/logic errors discovered as a result of said testing
  • Currently planning proactive attack groups as the next potential feature

If you've read this far, hello and thank you for doing so! I hope you enjoy the mod, and may your factory ever expand!