Deadlock989 / IndustrialRevolution

Industrial Revolution 3 is an overhaul mod for Factorio.
51 stars 0 forks source link

Incompatibility with IR3, Lex's Aircraft, Spidertron Enhancements #404

Closed LEFD closed 3 months ago

LEFD commented 3 months ago

Game will display the following error message, when starting the game with Industrial Revolution 3, Lex's Aircraft and Spidertron Enhancements and its dependencies:

Error while loading technology prototype "lex-flying-heavyship-ships" (technology): Difficulty normal: Ingredient with type item and name "production-science-pack" is registered twice in the technology Modifications: Lex's Aircraft › Industrial Revolution 3 › Lex's Aircraft

The error only appears, if I have all 3 mods enabled. I tested this on a fresh install of Factorio. Not sure which mod cause this, so I will open this issue on the issue trackers of the aforementioned mods as well.

Log

0.001 2024-03-14 15:24:27; Factorio 1.1.104 (build 62119, win64, full) 0.001 Operating system: Windows 10 (build 19045) 0.001 Program arguments: "C:\GamesC\Factorio\Factorio_1.1.104\bin\x64\factorio.exe" "--wait-to-close" "20344" 0.001 Config path: C:/GamesC/Factorio/Factorio_1.1.104/config/config.ini 0.001 Read data path: C:/GamesC/Factorio/Factorio_1.1.104/data 0.001 Write data path: C:/GamesC/Factorio/Factorio_1.1.104 [158315/953223MB] 0.001 Binaries path: C:/GamesC/Factorio/Factorio_1.1.104/bin 0.006 System info: [CPU: AMD Ryzen 5 5600X 6-Core Processor, 12 cores, RAM: 9311/32694 MB, page: 12392/35254 MB, virtual: 4254/134217727 MB, extended virtual: 0 MB] 0.015 Memory info: 0.015 [0]: Kingston KF3600C16D4/16GX 16384 MB 3600 MHz 1.2 v 0.015 [1]: Kingston KF3600C16D4/16GX 16384 MB 3600 MHz 1.2 v 0.016 Display options: [FullScreen: 1] [VSync: 1] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en] 0.334 Video driver: windows 0.334 Available displays: 2 0.334 [0]: .\DISPLAY1 - NVIDIA GeForce RTX 2070 SUPER {0x05, [0,0], 2560x1440, 32bit, 180Hz} 0.334 [1]: .\DISPLAY2 - NVIDIA GeForce RTX 2070 SUPER {0x01, [335,-1080], 1920x1080, 32bit, 60Hz} 0.400 [Direct3D11] Display: 0, Output: 0, DisplayAdapter: 0, RenderingAdapter: 0; d3dcompiler_47.dll 0.584 Initialised Direct3D[0]: NVIDIA GeForce RTX 2070 SUPER; id: 10de-1e84; driver: nvldumdx.dll 31.0.15.5176 0.584 D3D Feature Level: 11.1, DXGI 1.5+, SwapChain: 3,flip-discard,-,-,-,none 0.584 [Local Video Memory] Budget: 7221MB, CurrentUsage: 24MB, Reservation: 0/3738MB 0.584 [Non-Local Vid.Mem.] Budget: 15579MB, CurrentUsage: 16MB, Reservation: 0/7917MB 0.584 Tiled resources: Tier 2 0.584 Unified Memory Architecture: No 0.584 BGR 565 Supported: Yes 0.584 MaximumFrameLatency: 3, GPUThreadPriority: 0 0.584 Graphics settings preset: very-high 0.584 Dedicated video memory size 7989 MB 0.614 Desktop composition is active. 0.614 Graphics options: [Graphics quality: high] [Video memory usage: all] [DXT: high-quality] [Color: 32bit] 0.614 [Max threads (load/render): 32/8] [Max texture size: 0] [Tex.Stream.: 0] [Rotation quality: normal] [Other: STDCWT] [B:0,C:0,S:100] 0.683 [Audio] Backend:SDL(default); Driver:wasapi, Device:Default device, Depth:16, Channels:2, Frequency:44100 0.764 Logitech LED Controller initialized. 0.814 Loading mod settings SpidertronEnhancements 1.9.1 (settings.lua) 0.814 Loading mod settings IndustrialRevolution3 3.1.20 (settings.lua) 0.814 Loading mod settings lex-aircraft 1.1.1 (settings.lua) 0.814 Loading mod settings IndustrialRevolution3 3.1.20 (settings-updates.lua) 0.816 Loading mod core 0.0.0 (data.lua) 0.849 Loading mod base 1.1.104 (data.lua) 0.982 Loading mod SpidertronEnhancements 1.9.1 (data.lua) 0.990 Loading mod IndustrialRevolution3 3.1.20 (data.lua) 1.109 Loading mod lex-aircraft 1.1.1 (data.lua) 1.123 Loading mod base 1.1.104 (data-updates.lua) 1.134 Loading mod SpidertronEnhancements 1.9.1 (data-updates.lua) 1.147 Loading mod IndustrialRevolution3 3.1.20 (data-updates.lua) 1.194 Loading mod lex-aircraft 1.1.1 (data-updates.lua) 1.205 Loading mod SpidertronEnhancements 1.9.1 (data-final-fixes.lua) 1.221 Loading mod IndustrialRevolution3 3.1.20 (data-final-fixes.lua) 1.986 Checksum for core: 607699937 1.986 Checksum of base: 1054619811 1.986 Checksum of simhelper: 0 1.986 Checksum of IndustrialRevolution3Assets1: 0 1.986 Checksum of IndustrialRevolution3Assets2: 0 1.986 Checksum of IndustrialRevolution3Assets3: 0 1.986 Checksum of IndustrialRevolution3Assets4: 0 1.986 Checksum of SpidertronEnhancements: 3395236550 1.986 Checksum of IndustrialRevolution3: 7158382 1.986 Checksum of lex-aircraft: 338524280 2.151 Error ModManager.cpp:1625: Error while loading technology prototype "lex-flying-heavyship-ships" (technology): Difficulty normal: Ingredient with type item and name "production-science-pack" is registered twice in the technology Modifications: Lex's Aircraft › Industrial Revolution 3 › Lex's Aircraft 2.236 Initial atlas bitmap size is 16384 2.236 Created atlas bitmap 2048x800 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level] 2.281 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82 2.412 Parallel Sprite Loader initialized (threads: 11) 2.619 Sprites loaded 2.634 Generated mipmaps (5) for atlas [0] of size 2048x800 2.634 Custom mipmaps uploaded (99) 2.636 Custom inputs active: 15 2.637 Factorio initialised 6.044 Quitting: user-quit. 6.319 Goodbye

Deadlock989 commented 3 months ago

I looked into what those two mods are doing. This is a loading order issue. Spidertron Enhancements (SpiderEn) is a red herring - it doesn't make any changes to technologies and isn't at fault. However in this situation, the presence of SpiderEn changes the loading order of IR3 and Lex's Aircraft (LA). IR3 does make massive changes to technologies (it is an overhaul mod so it can't not). But the problem (in my view) lies with LA.

LA has a dependency on SpiderEn which means SpiderEn will always load each of its data stages before LA does. If SpiderE isn't present, IR3 can end up loading after LA. But if SpiderE is present, IR3 is more likely to load before both SpiderE and LA. The presence of any other mod might also have the same effect.

The issue is that LA sets up that "heavy ships" technology with just a few science packs in the data.lua stage (the first of the three data stages). No problem so far. But in the data-updates.lua stage (the second stage), it then conditionally adds more packs to it. If Space Exploration is installed, it adds some kind of SpaceEx related pack. Otherwise, it will always add a production pack and a utility pack, and it assumes that the tech doesn't already have them. This assumption would be safe to make if it was also done in the first stage when the tech was originally created, but because every other mod has a chance to make their own changes to the tech by the time LA runs its second stage, it's not a valid assumption.

If IR3 loads before LA, then it has run its second stage tech pass before LA runs its own second stage. IR3 massively reorganises vanilla techs, but it mostly avoids unrecognised third party techs, including LA's. But one thing IR3 does do is enforce science pack dependencies, i.e. if a tech unlocks a science pack, all of its descendants must use that pack. LA's "heavy ships" tech has a vanilla tech as a prerequisite which comes after production science in IR3, so IR3 ends up adding a production pack to the LA "heavy ships" tech, if and only if it doesn't already have one. But in the other loading order where LA loads after IR3, LA then adds another production pack without checking.

I don't have an easy fix for this but from IR3's perspective, I don't believe it's done anything wrong. LA has left a data stage gap between setting up a tech and then modifying it. It should be checking first before it adds packs to techs which already have them. Every prototype in Factorio is up for grabs by literally any mod installed: if you assume otherwise, you get this kind of problem.

You can work around this by editing your copy of the info.json file in IR3's top level folder and adding "?lex-aircraft" as a dependency. That will force LA to load before IR3, avoiding the issue.

LEFD commented 3 months ago

Thanks a lot for the quick and detailed response! I will post a link to your reply on the threads I opened regarding this issue at the Factorio mods page of the other two mods. Hopefully, it could be of help to fix the issue.

And much thanks again, for providing a workaround!