Games and companies with yearly or frequent releases work with legacy code a lot. But reading old code you often see ugly fixes to weird problems, in the vein of "we don't know why we have to do this but if we don't the whole game crashes". There is a lot of time to be saved by using legacy code but there is also a lot of dev time dedicated to dealing with bugs that arise from old code shenanigans. How do companies discern which is the worse the two and what can be done about it?
There’s an industry term for what you’re asking about here - it’s called Technical Debt. Whenever you make a decision on a system that will require fixing or maintenance at some point in the future, it is incurring tech debt that must be paid later in the form of developer time, resources, etc. Putting in a temporary X just to make something work (e.g. make something work for E3) means that, at some point in the future, you need to replace the temporary X we put in with a permanent X, or suffer the drawbacks of the temporary X forever. That total amount of effort of replacing the temporary X with the permanent X is tech debt.
Like most other forms of debt, there’s a minimum payment for tech debt. This minimum payment is some amount of developmental resources that must be paid in order to keep the project moving forward. It could be something small like “don’t ever using this specific combination of options or the game will crash”, or it could be something large like “the process works fine for incremental builds but a full build takes sixteen hours to complete”, but it’s something the dev team must put up with in order to keep things going. If somebody forgets one day and doesn’t follow the weird requirements, it can end up breaking the level until it’s fixed (or requiring a sixteen hour full rebuild) for all of the devs working on that level, causing a lot of lost productivity. This additional constraint/requirement and potential loss of productivity is the minimum payment the team pays for incurring the tech debt.
Sometimes dealing with the tech debt is just too severe to deal with long term (e.g. a sixteen hour build time), so we seek to pay that tech debt off. This requires more development resources to fix the problem than the minimum, and the fix may incur additional tech debt of its own (though probably of a different nature than before). This isn’t necessarily proportionate to the minimum payment either; sometimes a full tech debt payment is exorbitant compared to the minimum payment. For example, I once discovered a bug in the level editor where the locations of trigger volumes that were rotated and scaled in different directions would be inaccurate when running the actual game. I’d place the volume in this place in the editor, but it would not actually be at that location in the game. I asked about this and one of the engineers looked into it, but declared that the problem was pretty deep in the code to handle the export process. Fixing this would require a lot of work and could have a lot of potential negative side effects because it affected the way we handled all 3D object placement and orientation in the game world. Because of the cost involved with paying off the tech debt, it’s a value judgement - is the benefit of clearing up the tech debt worth more to us long-term than the effort we’d need to spend for the rest of the project just handling the minimum payment? In this particular case, I promised that the designers wouldn’t ever use rotated trigger volumes because the minimum payment (not using rotated volumes) was cheaper than paying off the debt entirely (fixing the underlying problem).
You also have to keep in mind that paying off tech debt does not come from its own budget. New feature and content development also pulls from the same resource pool because it’s the same developers who are building new features and content. If I’m fixing old problems, I’m not building a new dungeon or creating new items or tuning a new monster. Also, you need to keep in mind that fixing tech debt often doesn’t garner the same reaction from the player base - new features get people to keep playing, while many of the tech debt issues (like reducing a sixteen hour build time) is not immediately felt by the players. This means that decision-makers often need to triage the tasks - is paying off the tech debt worth spending our resources on or should we build new content with those resources instead? Sometimes the answer is yes and sometimes the answer is no, depending on the costs and circumstances involved.
The FANTa Project is currently on hiatus while I am crunching at work too busy.
[What is the FANTa project?] [Git the FANTa Project]
Got a burning question you want answered?
Short questions: Ask a Game Dev on Twitter
Long questions: Ask a Game Dev on Tumblr
Frequent Questions: The FAQ