We released patch 1.2 of #TheOuterWorlds today, and it includes a fix for the dreaded "the game thinks my companions are dead" bug, which I believe I spent more time investigating than I have for any other individual bug in my career (1/18)
The gist of the bug was that, for some players, a companion quest would be marked as Failed in the quest log, with the reasoning that the companion was dead -- despite the fact that the companion was very much alive and well (2/18)
This was perplexing because (outside of SuperNova mode) companions *can't* die (3/18)
There were one or two cases before launch where this issue seemed to happen, but no one in QA ever managed to reproduce it and despite our best efforts we couldn't learn anything concrete about it (4/18)
One reason it was so hard to pin down is that it was impossible to tell when the bug actually happened -- all of the cases we had were essentially "hey something bad happened in the last ten hours and now my quest is broken" (5/18)
Investigating it involved figuring out the location of every script and line of code that could possibly make the game think that a companion was dead (6/18)
The only logical culprit was a bit of scripting that runs when a companion's health reaches zero: if they're in the party, it waits for combat to end and revives them; otherwise it marks them as dead "for real" (7/18)
The only place in the game when a companion is present but *not* in the active party is when the player is on their ship
The problem is, when companions are on the ship, they are undamageable (8/18)
Eventually we figured out that "undamageable" does not mean "invulnerable" -- they can't take damage from attacks but can still get hurt from other things
One of those things: falling a great distance (9/18)
The problem with *that* is that there are no spots in the player's ship that are high enough to result in a lethal fall
So now we had to figure out how companions were mysteriously ending up way above the level (10/18)
I looked into tons of theories, including "maybe their height data is preserved when fast travelling from other maps" and "maybe a physics interaction between two companions causes one to rapidly accelerate upwards" (11/18)
My personal fav was "what if a companion is standing *right* where a cow spawns in during a random event and they're launched into space"
Was genuinely bummed when that theory didn't pan out (12/18)
By this time, the game had come out, and all hopes of this being a weird fluke only a couple devs would ever see were dashed, as players all over the place started reporting their companion quests failing (13/18)
Eventually, an offhand comment in one user's review mentioned seeing a weird bug where a companion was "climbing nothing", and this comment led me to figuring the whole thing out (14/18)
On the dev side of things, the system for NPCs interacting with the environment is called "furniture"
Sometimes this is literal furniture, like sitting in a chair, but it covers everything from using a terminal to leaning on a wall (15/18)
Somewhere deep in the complex beast that is the furniture system, we had code that disabled all NPCs from starting new furniture interactions if the player was in a conversation (16/18)
The problem was that using a ladder is considered *two* different furniture interactions: one for getting on the ladder and starting to climb, and one to stop climbing and get off (17/18)
So, if someone started climbing a ladder and the player entered a conversation before they stopped, they wouldn't be able to exit the ladder, and, well…. (18/18)