Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-260762

Stacked TNT perform insanely redundant calculations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.3, 1.19.4 Pre-release 3, 1.21.1, 24w36a
    • None
    • Community Consensus
    • Performance
    • Normal
    • Platform

      If you have multiple TnT exploding in the same position, they will each perform their calculations of knockback and blocks broken independently. Despite the fact that the effect of their explosions can be combined linearly. This issue relates to MC-260743 and MC-238249. Features such as OptimizedTnT from carpet mod have working implmentantions which do not affect vanilla behviours:

      • OptimizedTnT is an ideal solution for optimizing TnT because if multiple TnT entities explode at the same location, instead of processing the blast knockback formula independently for each TnT, it simply combines their effects into a single calculation vastly improving performance while maintaining behaviour. This also includes a fix for MC-238249 which eliminates the redundant checks on the blast origin if the TnT is in a state where it does not deal damage to blocks.

      As an example here is a world download with a TnT cannon positioned at 4K,4K in the overworld and setup to fire a payload at 0,0:

      https://www.mediafire.com/file/vpf6ctq0cvfl0p7/Orbital_Strike_Crash_Test.zip/file

      Instructions are as follows: 

      • Join the world and wait 1 minute
      • Press the Button labelled "Start Cannon"
      • The player will be teleported to 0,0,0 and the cannon will begin charging
      •  Note the TPS drop significantly due to large quantities of TnT performing inefficient calculations
      •  Note that eventually the game becomes unresponsive due to excessive collision checks as the cannon fires
      •  Note that the cannon works perfectly fine with optimizations running

      You can also find the video about the cannon here:

      https://youtu.be/s_TKe16WASY

            Unassigned Unassigned
            cubicmetre
            Votes:
            61 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              CHK: