renoth / factorio-alien-module

A mod for factorio
MIT License
14 stars 16 forks source link

Mod Incompatibility: Error while loading entity prototype "alien-wall" #76

Closed bikinavisho closed 3 years ago

bikinavisho commented 3 years ago

So this is a kind of weird incompatibility I've found

When these 6 mods are enabled at the same time, the game will crash after enabling them and restarting Factorio, with the following error

Failed to load mods: Error while loading entity prototype "alien-wall" (wall): Key "icon_size" not found in property tree at ROOT.wall.alien-wall Modifications: Alien Loot Economy

Mods to be disabled:

  • alien-module (1.2.4)

Mods Enabled:

  1. alien-module v1.2.4
  2. ArmouredBiters v1.1.4 : adds a new type of enemy
  3. Rampant v1.0.4 : modifies enemy AI
  4. rampant-alienmodule-compat v1.1.0
  5. Reinforced-Walls v1.1.2 : adds walls
  6. LSlib v2020.12.12 : dependency of Reinforced-Walls

Here's where the weird part comes in. While keeping alien-module enabled, if you turn off any of the above mods (while keeping dependencies together), the error goes away. You need all six of them to be enabled to cause this error. Disabling even one makes the error go away.

So I decided to just pick one and move on, so I removed ArmouredBiters. Then I added these mods, which all individually and together will cause the same crash:

With the new group [alien-module, ArmouredBiters, Rampant, rampant-alienmodule-compat, ReinforcedWalls, LSLib, bobenemies, Clockwork, SchallEndgameEvolution], when I removed ReinforcedWalls the error went away.


All I can think is that somehow the Biter modification / wall modifications are creating some sort of special concoction that causes alien-module to crash on startup. Mods that don't cause or affect this crash, even though they affect walls/biters:


Combinations of Mods I tested, with O meaning it worked, and X meaning it crashes (with the above error): [O] alien-module, ArmouredBiters [O] alien-module, ArmouredBiters, Rampant / rampant-alienmodule-compat [O] alien-module, ArmouredBiters, LSlib [O] alien-module, ArmouredBiters, Rampant / rampant-alienmodule-compat, LSlib [O] alien-module, ArmouredBiters, Reinforced-Walls, LSlib [X] alien-module, ArmouredBiters, Rampant / rampant-alienmodule-compat, Reinforced-Walls, LSlib [O] alien-module, Rampant / rampant-alienmodule-compat [O] alien-module, Rampant / rampant-alienmodule-compat, LSlib [O] alien-module, Rampant / rampant-alienmodule-compat, Reinforced-Walls, LSlib [O] alien-module, Reinforced-Walls, LSlib [O] alien-module, LSlib [X] alien-module, ArmouredBiters, Rampant / rampant-alienmodule-compat, Reinforced-Walls, LSlib, bobenemies, Clockwork, SchallEndgameEvolution [O] alien-module, ArmouredBiters, Rampant / rampant-alienmodule-compat, LSlib, bobenemies, Clockwork, SchallEndgameEvolution

BlueAgent commented 3 years ago

Seems like a mod is modifying entities in the Factorio's base mod in a way that might result in this issue?

https://github.com/LovelySanta/FactorioMod-ReinforcedWalls/blob/7d987d249e5acdda02ffcbc5cf9550410332f393/prototypes/entity/stone-wall.lua#L5-L10

I tried commenting out the above (in the Reinforced Walls mod) as shown below and the set of mods loads just fine:

-- make sure it has icons, and not icon/icon_size
stoneWall.icons     = LSlib.item.getIcons(stoneWall.type, stoneWall.name)
-- stoneWall.icon      = nil
-- stoneWall.icon_size = nil

Not sure why Reinforced Walls set those fields to nil. The comment in the snippet doesn't explain and just says what it is doing unfortunately. They probably have a reason for doing it though.

Walls seem to look just fine with the above change made as well.

Vanilla Walls, Reinforced Walls and Alien Walls

Edit: Apparantly mods are meant to set those fields to nil then set them when making a copy. Still though, that only applies to extending (making a deep copy) of a base game entity. The fields should probably be left un-touched for the base mod itself since a lot of other mods are extending them. In the alien wall's case it's intended to use the same icon as the normal wall but tinted so it's probably fine to not clear out the icon fields (as the advice is for modders having their own icon completely).

bikinavisho commented 3 years ago

Thanks for your help! I went ahead and just changed Reinforced-Walls locally and it works :)

renoth commented 3 years ago

Great analysis! Seems like you should contact the reinforced walls authors.