Mod loading order confusion (2024)

Post Reply

  • Print view

5 posts• Page 1 of 1

Pi-C
Smart Inserter
Mod loading order confusion (1)
Posts: 1681
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Contact Pi-C

Send private message

Mod loading order confusion

  • Quote

Postby Pi-C »

One of my mods was reported to crash in the handler for on_entity_damaged because another mod had destroyed event.entity of the previous event (if damage_type is "impact", on_entity_damaged will first run for the damaged entity by event.cause, then the event will be raised again for event.cause of the first event, with event.entity of the first event becoming event.cause of the second). I couldn't reproduce that at first because the other mod was loaded after mine. Finally, I discovered that the mod loading order was changed when a third mod was present:

  • [-] autodrive + SchallTankWoodcutting: Neither of these mods depends on the other, so mods should be loaded in alphabetic order. As expected, autodrive is loaded first, so it gets the event before SchallTankWoodcutting can destroy the damaged entity and the game doesn't crash (see autodrive+woodcutting.log).

    [-] autodrive + SchallTankWoodcutting+ SchallTransportGroup: autodrive has an optional dependency on SchallTransportGroup, but neither SchallTransportGroup nor SchallTankWoodcutting depend on each other. I'd expect that mods are loaded in the order SchallTransportGroup --> autodrive -- SchallTankWoodcutting, but the actual loading order is SchallTankWoodcutting --> SchallTransportGroup --> autodrive (see autodrive+woodcutting+transportgroup.log).

Mod loading order sometimes works in mysterious ways, but I'd really like to understand how in a game with just these three mods the order of SchallTankWoodcutting (which neither autodrive nor SchallTransportGroup depend on) could be affected by the presence of SchallTransportGroup. Any explanation?

(Closing the circle: I know that the problem of my mod crashing when both SchallTransportGroup and SchallTankWoodcutting are active could be fixed if an optional dependency on autodrive was added to SchallTankWoodcutting. Unfortunately, Schallfalke hasn't been active for over a year, so there's no way to get that fix implemented.)

Attachments
autodrive+woodcutting+transportgroup.log
Autodrive is last mod
(3 KiB) Downloaded 1 time
autodrive+woodcutting.log
Autodrive is first mod
(2.46 KiB) Downloaded 2 times

A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Top

BrainGamer_
Long Handed Inserter
Mod loading order confusion (3)
Posts: 71
Joined: Sun Nov 14, 2021 9:52 pm
Contact:

Contact BrainGamer_

Send private message

Re: Mod loading order confusion

  • Quote

Postby BrainGamer_ »

https://lua-api.factorio.com/latest/auxiliary/data-lifecycle.html wrote:The game gives all active mods an order that takes into account their dependencies first and their internal names second. This order determines the load sequence of mods at game startup, as well as the order in which events are sent during runtime. Specifically, the depth of each mod's dependency chain is taken into account first, sorting the the shorter ones to the front of the queue. For mods with identical chain depths, the natural sort order of their internal names then determines the definitive ordering.

The game figures out the dependency chain length of each mod (as in: what is the longest dependency chain for a mod that needs to load before it can load) and then loads mods from the shortest chain length to the longest. Mods that have the same dependency chain length are sorted based on their internal mod name (case insensitive natural sort order).

In your example case here that results in the following:

  1. core (core is always the first thing to load)
  2. base (dep chain length: 0)
  3. SchallTankWoodcutting (dep chain length: 1)
  4. SchallTransportGroup (dep chain length: 1)
  5. autodrive (dep chain length: 2)

The order of 3 and 4 is determined by their internal mod name since they both have a dependency chain length of 1.

Top

robot256
Filter Inserter
Mod loading order confusion (4)
Posts: 615
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Contact robot256

Send private message

Re: Mod loading order confusion

  • Quote

Postby robot256 »

It looks all the mods without dependencies present are done first, then the dependent mods are done, probably in tiers.

Honestly it might be time to retire support for SchallTransportGroup. I went along with because it didn't seem to hurt anything, but Schallfake insisting that every other mod add a dependency and code was never the right way to achieve its goal. It ought to be entirely automatic and contained within the group mod's data-final-fixes file. Removing your dependency and compat code won't materially affect anyone's game, just the creating menu layout.

My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk

Top

Pi-C
Smart Inserter
Mod loading order confusion (5)
Posts: 1681
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Contact Pi-C

Send private message

Re: Mod loading order confusion

  • Quote

Postby Pi-C »

BrainGamer_ wrote:

Wed Jul 10, 2024 6:15 pm

The game figures out the dependency chain length of each mod (as in: what is the longest dependency chain for a mod that needs to load before it can load) and then loads mods from the shortest chain length to the longest. Mods that have the same dependency chain length are sorted based on their internal mod name (case insensitive natural sort order).

Thanks a lot for this very detailed explanation! I didn't know about the impact of dependency chains, but that actually makes a lot of sense and accounts for unrelated dependencies of unrelated mods messing up things.

robot256 wrote:

Wed Jul 10, 2024 6:29 pm

Honestly it might be time to retire support for SchallTransportGroup. I went along with because it didn't seem to hurt anything, but Schallfake insisting that every other mod add a dependency and code was never the right way to achieve its goal. It ought to be entirely automatic and contained within the group mod's data-final-fixes file.

I've removed the optional dependency on SchallTransportGroup. Originally I believed that it should load run first so its item-group would exist when I created subgroups for it in data.lua. Then I thought I'd have to move the code for assigning subgroups to data-updates.lua, but it turned out that isn't even necessary.

Unfortunately, removing the dependency on SchallTransportGroup will only fix my issue with SchallTankWoodcutting in some cases. It would work in the scenario from my original post, where autodrive is the only mod besides those two. But with lots of active mods (the saved game for which I've got the bug report contained >300 mods) chances are that loading order may be changed due to the mechanism described by @BrainGamer. I've already considered making a fork of SchallTankWoodcutting that includes a hidden optional dependency on my mod, but I'm still shying away from that as it is a temporary solution and temporary solutions usually stay forever and I'd have to take care of yet another mod … Mod loading order confusion (6)

A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Top

robot256
Filter Inserter
Mod loading order confusion (7)
Posts: 615
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Contact robot256

Send private message

Re: Mod loading order confusion

  • Quote

Postby robot256 »

I guess the only other solution is to mark it incompatible in your mod Mod loading order confusion (8)

My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk

Top

Post Reply

  • Print view

5 posts• Page 1 of 1

Return to “Modding discussion”

Jump to

  • General
  • ↳ Releases
  • ↳ News
  • ↳ General discussion
  • ↳ Multiplayer
  • ↳ Find Servers / Tools / Guides
  • ↳ Show your Creations
  • ↳ Videos
  • ↳ Combinator Creations
  • ↳ Mechanical Throughput Magic (circuit-free)
  • ↳ Railway Setups
  • ↳ Energy Production
  • ↳ Medium/Big/Gigantic Sized Structures
  • ↳ Fan Art
  • ↳ Gameplay Help
  • ↳ Spread the Word
  • ↳ Off topic
  • ↳ This Forum
  • ↳ Celebration Party
  • Support
  • ↳ Gameplay Help
  • ↳ Discover Factorio Wiki
  • ↳ Discover Others Creations
  • ↳ Discover Mods
  • ↳ Discover Tools Around Factorio
  • ↳ Technical Help
  • ↳ Bug Reports
  • ↳ Resolved for the next release
  • ↳ Fixed for 2.0
  • ↳ Assigned
  • ↳ Not a bug
  • ↳ Pending
  • ↳ 1 / 0 magic
  • ↳ Duplicates
  • ↳ Minor issues
  • ↳ Desyncs with mods
  • ↳ Won't fix.
  • ↳ Resolved Problems and Bugs
  • Factorio Direction
  • ↳ Ideas and Suggestions
  • ↳ Outdated/Not implemented
  • ↳ Frequently Suggested / Link Collections
  • ↳ Implemented Suggestions
  • ↳ Implemented in 2.0
  • ↳ Development Proposals
  • ↳ Balancing
  • Contributions
  • ↳ Mods
  • ↳ Download mods
  • ↳ Mod portal Discussion
  • ↳ Mods
  • ↳ Mod Packs / Libs / Special Interest
  • ↳ 5dim's mod
  • ↳ Angels Mods
  • ↳ Atomic Power
  • ↳ Bob's mods
  • ↳ DyWorld
  • ↳ F.A.R.L
  • ↳ Logistic Train Network
  • ↳ MoMods
  • ↳ Reika's Mods
  • ↳ Resource Spawner Overhaul
  • ↳ Yuoki Industries
  • ↳ PyMods
  • ↳ Questions, reviews and ratings
  • ↳ Modding Discussions
  • ↳ Modding discussion
  • ↳ Modding help
  • ↳ Ideas and Requests For Mods
  • ↳ Modding interface requests
  • ↳ Implemented mod requests
  • ↳ Implemented for 2.0
  • ↳ Already exists
  • ↳ Won't implement
  • ↳ Documentation Improvement Requests
  • ↳ Resolved Requests
  • ↳ Development tools
  • ↳ Tools
  • ↳ Mod and installation managers
  • ↳ Cheatsheets / Calculators / Viewers
  • ↳ Development tools
  • ↳ Special interest mods and libraries
  • ↳ Modding Development
  • ↳ Multiplayer / Dedicated Server
  • ↳ Multiplayer Board
  • ↳ Archive
  • ↳ Maps and Scenarios
  • ↳ Translations
  • ↳ Texture Packs
  • ↳ Fan Art
  • ↳ Wiki Talk
  • ↳ To be sorted
  • ↳ Campaign / Scenario suggestions
Mod loading order confusion (2024)
Top Articles
Nasus Pharma Announces Clinical Data Demonstrating Efficacy of Taffix®, Intranasal Antiviral Protection Against Common Cold and Upper Respiratory Infection
7 Best Websites To Buy A Used Car in Netherlands
Craigslist Livingston Montana
Yogabella Babysitter
Craigslist Campers Greenville Sc
Ymca Sammamish Class Schedule
Western Union Mexico Rate
Hotels Near 500 W Sunshine St Springfield Mo 65807
Free Robux Without Downloading Apps
Southland Goldendoodles
Find The Eagle Hunter High To The East
10 Great Things You Might Know Troy McClure From | Topless Robot
Thotsbook Com
Colts seventh rotation of thin secondary raises concerns on roster evaluation
Darksteel Plate Deepwoken
The Witcher 3 Wild Hunt: Map of important locations M19
This Modern World Daily Kos
24 Hour Walmart Detroit Mi
Echat Fr Review Pc Retailer In Qatar Prestige Pc Providers – Alpha Marine Group
Yakimacraigslist
Breckie Hill Mega Link
Yonkers Results For Tonight
Watch Your Lie in April English Sub/Dub online Free on HiAnime.to
Myql Loan Login
Piedmont Healthstream Sign In
Elite Dangerous How To Scan Nav Beacon
Urban Dictionary Fov
Dtm Urban Dictionary
Relaxed Sneak Animations
R/Airforcerecruits
The Powers Below Drop Rate
Ultra Ball Pixelmon
Kqelwaob
Possum Exam Fallout 76
Missing 2023 Showtimes Near Grand Theatres - Bismarck
Reli Stocktwits
Workday Latech Edu
Helloid Worthington Login
Caderno 2 Aulas Medicina - Matemática
How To Paint Dinos In Ark
Leena Snoubar Net Worth
Infinite Campus Farmingdale
manhattan cars & trucks - by owner - craigslist
Kenner And Stevens Funeral Home
Walmart 24 Hrs Pharmacy
Aznchikz
Abigail Cordova Murder
Latina Webcam Lesbian
Wild Fork Foods Login
Nfsd Web Portal
Costco Gas Price Fort Lauderdale
Swissport Timecard
Latest Posts
Article information

Author: Rev. Leonie Wyman

Last Updated:

Views: 5863

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Rev. Leonie Wyman

Birthday: 1993-07-01

Address: Suite 763 6272 Lang Bypass, New Xochitlport, VT 72704-3308

Phone: +22014484519944

Job: Banking Officer

Hobby: Sailing, Gaming, Basketball, Calligraphy, Mycology, Astronomy, Juggling

Introduction: My name is Rev. Leonie Wyman, I am a colorful, tasty, splendid, fair, witty, gorgeous, splendid person who loves writing and wants to share my knowledge and understanding with you.