Techcraft7 / TNTSim

Simulator/Calculator for m^3's Orbital Strike Cannon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tnt does not match game for complex shapes

Techcraft7 opened this issue · comments

using the settings from the world download does not create the nuke shape

I think something must be off with TNT.Explode or TNT.Tick

  • Using Normalize instead of NoramlizeFast had no effect (code)
  • The velocities for a single TNT falling from rest match vanilla
  • The following payload matches vanilla:
TNT Count Cancel Single Schedule Count Fuse
1 XZ Y 1 1
1 XZ Y 1 80

current result
image

The expected result can be found in m^3's video

It appears that none of the TNT gets their Y velocity capped by the limit, which is why none of it is flat on top.

This was tested by setting a breakpoint at the Y velocity and it didnt get hit so RIP

soo every other TNT created by charge 2 for the mushroom cloud appear to have a different Y
image

This causes the ring of TNT on the mushroom cloud to go up a little:
image
And is potentially the reason that the last 3 charges only produces one ring:
image

1 problem was here (dir was being normalized and then it's length was being used):
image

and now its back to before
image

also the powder snow logic forgot the 90% scaling

trying to make 2 rings gets this:
image

logs for less TNT
image

For clarification of the above:
You can create two rings by either using 4 charges or use 2 and use the breadboard with charge 2’s schedule count at 2

Also I think the above is somewhat intended, but if you add more they start going up instead of getting capped

I think I know what is wrong:
in the game when the each tnt warps to the target it gets unloaded

Basically any explosions that happen in the first tick will only affect the TNT that has warped to the target already.
The TNT has warped to the target after it is ticked for the first time.
Therefore, I added a loaded flag that gets set to true after the TNT is ticked for the first time.
And in the explosion method I skip any TNT that has not been loaded yet

So it looks like it works now but I need to confirm by comparing to vanilla

yep it works now