eli5 They say that in programming a game, removing some arbitrary asset will inexplicably cause random bugs to pop up. Why?

304 views

Is it that during compilation, the compiler tries to compress and optimize the code in such a way that it “grows roots” into the assets (or vice versa) that if the asset is removed without proper care, the whole thing will collapse into itself? Like, the compiler realized that part of the binary code in one part of the program coincidentally is the same as a snippet of binary code in a nearby asset, so it chops code out to save space?

In: 0

7 Answers

Anonymous 0 Comments

An “asset” generally refers to either a piece of art (a car model, texture etc.) or a fully-defined object that can be placed into the game world which might have its own coding (e.g. a fully-functional car the player can get in and drive).

The impact of improperly deleting an asset really depends on what the asset is and how the engine/game is programmed.

For example, the level might have an event where the player has to blow up a generator to open a door in order to progress. The level will have a trigger defined that only opens the door once the generator is destroyed.

Deleting the generator asset itself could cause the game to crash if the level tries to refer to an asset that no longer exists, or it is hopefully programmed to check for such a situation and handle it gracefully. In that situation, the generator is missing and the player cannot progress and is soft-locked. The game might even detect the missing asset and kick you back to the main menu with an error asking you to verify your game files or something.

Similarly, deleting the generator *model* but not the functional generator asset could crash the game, mean the generator works fine but is invisible, or could mean the generator is invisible AND has no collision so the player can’t damage it any more.

It could also just lead to situations where a missing rock opens a void in the map the player can fall into.

In short, deleting an asset could do anything from nothing to crashing the game to making it unplayable depending on what the asset is, how it is used in-game and how well the engine can handle stuff it expects to have access to suddenly disappearing.

You are viewing 1 out of 7 answers, click here to view all answers.