Smart Enemy AI Enhancement


Smarter biter AI with adaptive resistance, breach reinforcement, scheduled raids, wall regen, and overhaul-mod compatibility.

Overhaul
a day ago
2.0
522
Combat

b 7.0.1 Crash

8 days ago

4.055 Loading mod smart-enemy-ai 7.0.1 (data-final-fixes.lua)
4.058 Script @smart-enemy-ai/data/validate.lua:65: [smart-enemy-ai] data-stage validation passed; processed 45 enemy projectile/stream prototypes
4.519 Script @smart-enemy-ai/data/resistance-variants.lua:79: [smart-enemy-ai] generated 3447 resistance-variant prototypes
4.519 Error ModManager.cpp:1767: Failed to load mod "smart-enemy-ai": smart-enemy-ai/data/validate-variants.lua:40: [smart-enemy-ai] validate-variants: arachnid-biter-leviathan-unit-smart-resist-fire-1 — resistance percent for 'fire' is -40; expected (0, 30]
stack traceback:
[C]: in function 'error'
smart-enemy-ai/data/validate-variants.lua:40: in function 'fail'
smart-enemy-ai/data/validate-variants.lua:99: in function 'check_one'
smart-enemy-ai/data/validate-variants.lua:108: in main chunk
[C]: in function 'require'
smart-enemy-ai/data-final-fixes.lua:14: in main chunk
4.552 Loading mod core 0.0.0 (data.lua)
4.649 Checksum for core: 1551277403
4.662 Error ModManager.cpp:1767: Error in assignID: recipe-category with name 'recycling' does not exist.

Source: default (utility-constants).

8 days ago
(updated 8 days ago)

Bug report – negative resistance causes crash on game startup

When it happens:
The error occurs during game loading / startup phase (data stage), before entering a save.

Error message:

Failed to load mods: smart-enemy-ai/data/validate-variants.lua:40:
[smart-enemy-ai] validate-variants: small-cold-spitter-smart-resist-fire-1 —
resistance percent for 'fire' is -90; expected (0, 30]

stack traceback:
[C]: in function 'error'
smart-enemy-ai/data/validate-variants.lua:40: in function 'fail'
smart-enemy-ai/data/validate-variants.lua:99: in function 'check_one'
smart-enemy-ai/data/validate-variants.lua:108: in main chunk
[C]: in function 'require'
smart-enemy-ai/data-final-fixes.lua:14: in main chunk

Cause:

In data/resistance-variants.lua, variant generation increases existing resistance with:

existing.percent = existing.percent + level * 10

However, some base entities (e.g. small-cold-spitter) have negative fire resistance (vulnerability), e.g.:

-100

This results in:

-100 + 10 = -90

The validator then rejects it because it enforces:

0 < percent <= 30

Solution:

Clamp negative base resistance to 0 before applying scaling:

local base_percent = math.max(0, existing.percent or 0)
existing.percent = base_percent + level * 10

Result:

Level 1 → 10

Level 2 → 20

Level 3 → 30

This keeps values within validator bounds and avoids startup crash.

Note:
This report and fix suggestion were generated with GPT.

8 days ago
(updated 8 days ago)

Thanks! I see two possible approaches for the gameplay change:

Flat progression: Adjust resistance from -100 at level 0 to -70 at level 3, keeping the increase relatively modest and controlled.

Scaling progression: Rework it to scale more significantly, going from -100 up to +30% over 13 levels, allowing for a full transition from vulnerability to resistance. (Your approach)

8 days ago

Fixed. Curently set to Scaling progression

8 days ago

looks good. game started and loaded :) thank you!

This thread has been locked.