- Version: 7.0; however, since black market traders did not get much dev attention in recent years, suffice to say the bug existed over several game versions at least since v3.0
- Modified: yes; but should not matter since I am just reading the vanilla MD files and doing static analysis
- Game start: (open universe); but should not matter since black marketeer spawning does not really depend on the game start as revealed from said static analysis
---------
Over the past few days doing sanity checks on my black marketeer (shadyguy) setup by re-reading md/npc_shadyguy.xml several times over and doing debug printing with my mod Market Discovery, I found several potential problems with their spawning. This basically matches some complaints seen in the past several years, and it is suprising these problems are left unresolved.
Problem 1: Not checking all the illegal drugs
(Edit: refer to viewtopic.php?t=464246)
Problem 2: Not checking for tradestations
(Edit: refer to viewtopic.php?t=464247)
Problem 3: Strange interaction with DLCs
The plug-and-play DLC policy means that late-joining DLCs may initialize their contents as the game is loaded/started. This includes setting up the shadyguys in the DLCs' space.
However, because cues are asynchronous in nature, there is very likely a problem if the DLCs are enabled when a new game is started. The exact mechanism is unclear, but my understanding is that, there may be a race condition.
Supposedly, the timeline should be the following:
- The player elects to start a new game with some DLCs enabled
- The md.NPC_ShadyGuy.Init cue is fired; this triggers md.NPC_ShadyGuy.EvaluateSectors
- By the cue md.NPC_ShadyGuy.EvaluateSectors, all sectors (including DLC sectors) are given black marketeers
- The md.NPC_ShadyGuy.Init enters "completed" state
- DLC shadyguy init scripts are fired, and check that md.NPC_ShadyGuy.Init should be "waiting", fails the check, and does nothing
- Black marketeers are available basically everywhere in the galaxy
- The player elects to start a new game with some DLCs enabled
- DLC shadyguy init scripts are fired, and check that md.NPC_ShadyGuy.Init should be "waiting", passes the check (because md.NPC_ShadyGuy.Init not fired yet!), and spawns black marketeers in their own sectors
- The md.NPC_ShadyGuy.Init cue is fired (late); it checks that there should be no spawned black marketeers, fails the check (DLCs already spawned their black marketeers), and cancels itself
- Setup complete; black marketeers are only found in DLC sectors
- viewtopic.php?t=426497 (2020)
- viewtopic.php?t=447260 (2022)
- https://www.reddit.com/r/X4Foundations/ ... space_why/ (2022)
- viewtopic.php?t=463749 (2024)
-----
There are now a lot of rumors and misinformation surrounding black marketeer spawning; to name a few:
- It is tied with faction rep (false)
- It is tied with the gamestart (technically true; Timelines DLC missions may have their own spawning logic)
- It is tied with "sector security" and "lawlessness" (false; not even quantifiable)
- Reports about "black marketeers not spawning" must be fake because the OP is delusional (false; I shall demonstrate in this bug report)