-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blowing up a huge amount of TNT causes performance fail #3010
Comments
I'd say this is roughly to be expected. TNT explosions simply are expensive. Even if you got them down to 1ms per explosion, blowing up a million (100³) TNT nodes at roughly the same time is expected to take a thousand seconds. That said, there very likely is potential for optimization (even though such "HUGE" amounts will always slow the game down to a crawl). Might take a look using the LuaJIT profiler eventually. Some options I see:
What would you suggest? |
I have no suggestions yet, but there is one other thing to look at:
But yeah I believe this is hard to do right, especially due to possible exponential growth. :-( I also agree with low priority; I don't really care that much about the bug but I posted it anyway for documentation purposes. |
If the blow takes longer (i.e. happens over many server-steps), the affected area could be hidden by a big fireball or mushroom cloud mesh. Or the view of nearby players could be obstructed by a hud element filling the entire screen. |
Yes, mostly an engine issue (although again "batching" as described by Desour could be seen as mod responsibility) |
Agree'd, massive tnt explosions can bring any system to a crawl which is why I limited particles and disabled some non-essential functions for it to work a little more smoothly for my own fork: https://notabug.org/tenplus1/tnt |
I could see a flag in the game that when a large enough amount of TNT is detonated, then the game will skip the visuals of the detonation and skip straight to the result. Mojang did this in minecraft pi edition as well as early versions of minecraft pocket edition too. |
The TNT mod could make better use of ...
As soon the affected volume size is known, such performance optimizations could be applied dynamically, and quite trivially on top of that. |
If you blow up a HUGE amount of TNT (like, a 100×100×100 cube), the game quickly slows down to a crawl after the first explosion.
The text was updated successfully, but these errors were encountered: