I updated the that NPCs load when the player takes off from a planet. Previously, the game essentially paused while the player was on a planet, so all NPCs would be in the same state they were before the player landed – if escorts had taken any damage they would still be damaged, and if there were any hostile ships they’d be right where the player left them, ready to continue the fight.
Since one conceit of the game is that when you spend time on a planet, a day of in-game time passes, this doesn’t make sense. So, I updated the behavior so that all of the player’s escorts are fully restored when you take off from a planet, and all of the non-escort NPCs are removed and new random ones are added. This also matches the behavior of NPCs in Escape Velocity and sequels, so players will be expecting it.
However – when I first introduced this new behavior it caused a bug so that all the NPCs ships that would load after taking off from a planet were broken – they had no targets and if you selected them and tried to use autopilot all ships (including the player’s) would stop rendering and completely disappear. A very strange issue. Eventually I got to the bottom of it and fixed it. Or so I thought.
The fix for that bug introduced another bug where if the player jumped to another system the non-escort NPCs would load fine but the player’s escorts would load twice, doubling the size of the player’s fleet. Not only that, but they would only be considered the player’s escorts in that they would follow the player in formation, but it would be possible to select them as if they were not escorts and the player could attack them and they’d start fighting back (and if there was more than one escort, even start fighting each other!)
Eventually I got all that sorted out and I think things are working well. But this was an interesting example of how one “simple” fix can lead to a cascade of little issues. Partly this was due to some really old (circa 2015) code being used to load NPCs that I had recycled from the first iteration of the game and it really wasn’t suited for the new paradigm, so that all had to get re-written, which was probably for the best anyway.
Leave a Reply