Create IC2 nuclear explosion

  • I'm trying to create an IC2 explosion in code similar to the way nukes and reactors explode. Currently, I'm using java reflection to get access to the class and cause the explosion. The problem I'm having is sometimes the explosion goes off correctly (usually when its small), but when its large it encounters critical problems. In those cases it constructs the explosion correctly but when it tries to execute it the game hangs.


    The exact details of what I'm seeing is: The explosion object is created, the execute message is sent. Blocks drop in the world as if they were destroyed - but the original blocks remain there. And all entities stop ticking - mobs stop moving, tileentities become unresponsive, and the game has to be forcibly shut down. (for small explosions this does not happen).


    So I was wondering if there is an officially supported way to creating one of these explosions? Also, I have tried using a normal TNT explosion, but when that one gets large it creates a square blast instead of a sphere.


    Any advice/tips would be appreciated. Thanks

  • In IC2 for 1.5.2 I have noticed that the game cant handle explosioin powers over 100ish. My nukes used to be set around 140, now I have had to tune it back to 80.

    • Official Post

    The Code for Explosions in Vanilla is terribly derpy on large scale, and so the IC2 crew had to make a new one for Nukes or it was just plain wierd. That code is meant for a specific size and will work differently when changed, if you want to make an Explosion code bigger then a normal nuke, you need to do a new one from scratch.

  • The Code for Explosions in Vanilla is terribly derpy on large scale, and so the IC2 crew had to make a new one for Nukes or it was just plain wierd.


    How, how I miss my checkerboard board terrain after a violent blast... /le sigh

    Would anyone like to try a Slowpoke Tail?! Only 1 Million Yen!


    Quote

    this isn't about arrogance or ego, I have a block that I put a lot of freaking work into


    Every Mod Author, in existence. And yet, you STILL say otherwise.

  • He probably want to make explosion code for this nuclear reactors.


    Yes


    In IC2 for 1.5.2 I have noticed that the game cant handle explosioin powers over 100ish. My nukes used to be set around 140, now I have had to tune it back to 80.


    What happens when you explode one of these super-nukes? Does your game hang? Also, that could be part of the problem, in my tests it looks like small explosions (~20ish) work, but larger ones fail - I had a failure as low as 28 once.



    Did someone say "Multiblock Nukes"?
    ;D


    I'm a little tempted.

  • Both internal and dedicated would sometimes hang when over 100, never had issues below 100. With 1.4.7 an explosion of 135 would be done within a few seconds.

  • How about making the Explosion in multiple stages? Kinda like a shockwave which increases the explosion Radius every tick until 100 is reached?


    That's an interesting idea, but I'm concerned about possible side effects. It seems to me that coding it like this would destroy inventories and then subsequently destroy all the dropped contents on the next wave, unless I misunderstand how minecraft explosions work.


    Well the (integrated) server was just busy processing for a long time, it'd eventually finish.


    Is there any way to check this? When I run it in eclipse I cannot step through the explosion code, it just hangs so I can't verify which step causes the error.

    • Official Post

    ICBM Nukes do what Greg said, which is why they are much better Above ground then IC2, but absolute crap underground.

    • Official Post

    ICBM Nukes have the Problem of being executed in a different thread causing crashes under certain conditions (when Blocks get deleted during ticking). My Idea was to spread the explosion over 5 seconds or so, that makes the explosion less "spikey".