How does IC2 do its realistic-ish explosion damage modelling?

  • Let me preface this by saying that I know this isn't really where to put this, but as I can't really find a place that actually fits, I thought this was as good a place as any. As well, I know that although IC2 is closed-source, Alblaka's policy is that when its no longer developed, it will be made open-source, so I hope that means that there's a chance I might get some leniency about this. So to my actual question, I'm wondering how the devs have been able to give IC2 its realistic-er explosion damage modelling. Keep in mind I'm not some random guy asking how modders to their fancy stuff, I'm a programmer myself, I just think that this is pretty cool, and want to know how it's done.


    If there's a better place for this, a mod is free to move it, just send me a PM, so I can know where to find it.



    Thanks,
    -Matrixmage

    • Official Post

    The basic concept is easy, it works by tracing a homogeneous ray pattern radially from the center of the explosion. The rays decay with distance and explosion resistance of the blocks they pass through and remove those blocks while not being decayed sufficiently.


    The ray resolution/spacing has to suffice the criteria of having full resolution even at maximum achievable distance, which means that the amount of rays required is easily in the 6-8 digit area. The trickery starts when it comes to making it fast, memory friendly and good looking through biasing the explosion resistance values and some other magic numbers and avoiding artifacts ;)

  • Huh, that's really cool, I was thinking of something a bit more mathy, involving proper formulas of how explosions dissipate... Although that was because I was told rays are the "hard" way, but this way is a lot easier then I thought... Thanks for the info!