Hook
More breakout videos from this creator.
There's one with TNT that makes it much laggier than it needs to be. Being an accepted Minecraft part of Minecraft, it kind of makes sense, right? I mean, it's destroying tons of blocks at once and creating particles. But the intense lag is caused by one decision by Mojang, and there is a solution. The problem of TNT explodes, builds a 16 length cube around it and then draws a ray from the center to 1352 blocks on the edge. But it gets really bad when this ends up being 24,000 block samples for a single TNT blast and each block is considered multiple times. This one, for example, will be passed through 225 independent times, which really is ridiculous. But the solution is, first, spots one from the explosion, then from blocks just one block away from them, keeping the current power as only each block doing it once. Doing it like this is 20 times fewer samples. This is Breadth First Search in computer science.