How One Line in a Text File Changed Jedi Starfighter

There’s a bug in Jedi Starfighter. It was caused by one line of data, and although we considered the bug pretty significant, and although we knew about it before we shipped, we didn’t fix it. This is the story of that bug.

In the original Starfighter, the damage done by laser blasts was a bit of data that was specific to each ship type (more or less), defined with a single line of our data definition language¹. Laser fire was defined by four floating point values as I recall: a minimum amount of damage, a maximum amount of damage, the distance before which the maximum was applied (i.e. shots closer than this distance did the maximum damage), and a distance beyond which the minimum was applied. In between, we interpolated between the two. This was meant to be a quiet inducement to the player to engage in dogfighting — close-up fights were more exciting, showed off the ships to better effect, and also better to reflect the feel of Star Wars space combat.

One source of the bug was this: because it was perfectly mathematically valid to have the maximum damage actually be lower than the minimum damage, the idiot programmer² who coded it up didn’t think to have the game warn if that were the case. Sure, it didn’t make any sense for a laser to do more damage the further it went, but it wasn’t harmful for that to happen, and anyway, this is Star Wars, who knows what kind of space lasers they might develop.

In Jedi Starfighter, the data for the player ship³ was tweaked so that this happened, which dramatically improved the ability for players to destroy ships from long range with just their lasers, using the camera zoom. Lasers became more powerful the further they traveled, up to some maximum amount. Effectively, what was meant to be a game about close-quarters combat became about at-edge-of-visual-range combat. We went from a game we thought was about handguns and knives to a game about sniping, metaphorically speaking.

No one involved in this bug was acting improperly. The implementation was general enough to allow for as wide a number of behaviors as possible. The person who made the change did so based on personal taste. When we played the levels, we all tended to shoot things from long range anyway, and when you play these things every day you might mistake sudden changes in the data as simply being much better at the game (because you play it all the time). At some point, the vision of JSF as continuing in the legacy of Starfighter and having that close-quarters feel was not reinforced enough, but we were a short project and most folks had worked on the first. Reiterating that design goal may have seemed unnecessary, or may have simply slipped through the cracks with the other pillars we were pursuing: Force Powers, improved performance, some other stuff.

Now, as I said, we discovered the bug before ship and didn’t fix it. That was the right call then, though it might not be today, hard to say. We discovered the bug once we were either in beta or very close to it. At this point, hundreds of QA hours had been put into the game already, and the game had been balanced around the fact of how the weapons worked, whether we liked that or not, whether it led to the gameplay we liked or not. For business reasons, the game absolutely could not slip, and so… we just left it. It was too risky to change. Balancing all those numbers is so often just a house of cards, and the amount of damage the player’s weapons does are one of the ones at the bottom of the pile. You can’t just pull it out and hope the whole thing will stand.

We had other options, but they weren’t good ones. We could have put the lasers back to where they were on Starfighter, and done a round of tests, but that might have simply ended up burning a test cycle to learn that wasn’t practical, and lost that time forever. As close as we were to ship, and with real bugs that had to be fixed for cert and what-not, that was simply too costly. Today, we might have patched it after more time could have been spent with it. At the time, the best decision we had available to us was to leave it as it was. We couldn’t afford the risk of other options.

So I feel for the folks who missed a typo in some data file on Aliens: Colonial Marines. I’ve been there.

 

¹I hesitate to even call it a language. It had no control flow statements in the original Starfighter and I don’t think even any variable support, both of which were added in minimal ways for JSF but which aren’t really germane. I just like to digress.

²I feel comfortable calling this programmer an idiot because it was a long time ago and also I was that idiot.

³OK, technically, there are several player ships and so this bug was replicated in several places, but essentially a single line each time. <waves hands in air>

2 thoughts on “How One Line in a Text File Changed Jedi Starfighter”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.