Why do programs (like games for example) crash when overloaded? Why cant it just keep processing the code but updating less often?

108 views

I.e how Minecraft usually crashes if you explode too much tnt at once.

In: 0

2 Answers

Anonymous 0 Comments

That has a bit to do with your own Computer specifications. Minecraft is a CPU loader, in that meaning being it depends mostly on it. Think of it this way:

If you play a sandbox game other than minecraft, ex: garry’s mod, if you place so many entities in said sandbox (This being TNT), it begins to place a load on your CPU/GPU. There’s a certain line depending on how powerful your said CPU/GPU is, but when that load becomes so much, you lose more and more FPS and stability. Once it overloads, Say after the massive amount TNT entities explode and all the particles show up, the game recognizes it, and crashes to avoid damaging your components.

This is similar to if you try running your CPU without a CPU fan. The CPU heats up so much, that your computer then shuts itself off to avoid that damage.

Anonymous 0 Comments

There’re many different types of overloaded, but I’ll focus on the most relevant two:

1) You’ve overfilled your memory. The game crashes because it’s trying to track more individual pieces of data than it has room to store on your computer – it can’t do it slower because time isn’t the limiting factor in this case, storage is.

If it needs to store the location of a million objects, and it only has the space to store a hundred thousand locations, it has no choice but to crash.

2) The game would be slow for a significant length of time. Perhaps the explosion has 2 seconds in-game-time, and the program would have to run it at a thousandth the speed – so you’d be waiting over 30 minutes for the explosion to finish.

The people who program games and operating systems are well aware that you don’t want to wait 30 minutes for a 2 second explosion to finish; that you’d be much happier overall if the game crashed at that point rather than locking you in to looking at a very very slow explosion. So they *deliberately* make it crash in those circumstances.

Notably some programs are designed specifically not to crash in that sort of situation – physics simulations of the sorts used in professional contexts (such as by engineers or animators) are often designed to keep going even when it’ll take months to fully detail the next two seconds; but they’re also designed with manual cancellation in mind and all sorts of other controls to make such lags manageable.