Drillgon200 / Hbm-s-Nuclear-Tech-GIT

My fork of the HBM's nuclear tech mod.
47 stars 19 forks source link

Large nukes not affecting the top hemisphere #216

Closed abel1502 closed 2 years ago

abel1502 commented 2 years ago

From (admittedly, little) experimentation, it appears that placeable nuclear bombs (tested with Little Man and Tsar Bomba) do not affect exen nearby blocks at higher elevations, leaving quite unrealistic floating hills with trees over craters

abel1502 commented 2 years ago

Found the problem: I believe, the initial value for y should also be multiplied by the coefficient here:

https://github.com/Drillgon200/Hbm-s-Nuclear-Tech-GIT/blob/30df900f4f7f3827133bc58fb26f922da5f3d909/src/main/java/com/hbm/explosion/ExplosionNukeAdvanced.java#L106

abel1502 commented 2 years ago

(Supposedly) patched this in #217

Drillgon200 commented 2 years ago

That is not even part of the mk4 explosion code. If you want to see that code, look at ExplosionNukeRay.java. I can't replicate this bug myself, the little boy affects blocks above it just fine.

abel1502 commented 2 years ago

Okay, thanks, I'll try to look into that

abel1502 commented 2 years ago

While setting off the tsar bomba in a clean environment, in an attempt to replicate the issue myself, I noticed a lot of "cascading woldgen lag" messages appear in the log. This gave me an idea that, perhaps, before removing the blocks with an explosion, it might be a good idea to somehow force the chunks in the affected radius to get generated in the correct order. Just a side note.

(As for the test itself, the explosion is still in progress, so no results so far)

abel1502 commented 2 years ago

Another side note: apperently, the explosion entity can despawn if the player flies out of render distance. At least, that has just happened to my tras bomba. I'm pretty sure that the entity is gone, because when I place blocks in the destroyed areas, they aren't removed anymore, yet ticks do seem to take place, judging by the grass growing in an adjacent chunk

abel1502 commented 2 years ago

But now, I guess, the test is done. The Little Man, when set off in the jungle, indeed removed the blocks above it thoroughly, but the Tsar Bomba only covered a narrow arc upwards, and then proceeded to ignore the top blocks until it disappeared. I guess it might be somehow linked to lag and the server dropping frames to compensate for it (which it did log about), but I'm not sure. I'm attaching a screenshot of the aftermath of the Tsar Bomba exposion.

screenshot.png

Drillgon200 commented 2 years ago

I've looked into this again today, fixed it. Every ring around the nuke has a certain radius that increases from bottom to the center, and decreases from center to top because the sphere circle radius gets smaller. This variable is never reset, so it only works correctly for the lower hemisphere.

abel1502 commented 2 years ago

Thanks!