- There are two mods, Client and Service
- Service provides a remote interface
- Client optionally uses the interface during initialisation (and so declares an optional dependency on Service)
- New game starts with Service, but not Client
- Client is introduced later in the game
- on_init is called for Client, which detects and calls Service's remote interface
- Now Service has code being called before its globals (or anything) are initialised
If factorio called on_configuration_changed after on_init for new games, it would remove the need to try and handle inter-mod communication in on_init. Instead, mod authors could use a single, safe callback for all initialisation that depends on other mods.
I realise that a proposal to change the lifecycle callbacks in any way at this point probably sets off all sorts of alarms, but would adding this extra call actually cause any problems? Because on_configuration_changed can be called at any point during a game, and mods need to handle arbitrary changes at this point, shouldn't it be quite safe to call it before the first frame?