Ray-tracing can be used to simulate explosions in voxel games like Minetest. The biggest advantage of using it is the ability to make different materials have different blast resistance. I have been working on an API to create ray-traced explosions in Minetest. This mod is the implementation of that API. The idea is that this mod can be added as an dependency for other mods, which want to simulate explosions.
Video
Here is a short video of the mod in action. The video is of another mod Explosions TNT which uses the API to create TNT:s of different strengths (TNT, C4, NUKE). The explosions mod itself does not come with any node or item definitions, only the API, to keep it small.
Video of the mod
Git repo and ZIP-download
Source-code is hosted at the Gitlab repository.
ZIP-file can be downloaded directly.
Dependencies
This mod has no dependencies.
Documentation
Refer to the README at the repository for how to use the API.
Features
- Can generate explosions of arbitrary strengths (from tiny explosions to the limit of what your computer can handle)
- Supports nodes of varying blast resistance (a wall of diamond stronger than a wall of wood)
- Supports node callbacks to change the behavior on blasts
- Implements entity damage and knockback
- Implements blast resistance from existing node groups
- Stronger nodes can get blown away after blasts
- Can be used to generate shaped explosions (like an explosion going only in one direction)
- Uses uniformly-distributed numbers to make explosions unpredictable and "stackable" (8 times TNT will approx. create 8 times the environment destruction)
The mod isn't 100% perfect. Here is a list of things I would like to get improved in the future. I don't think I have time to improve these points in the near future, and the mod is good enough to release now anyways. But if anyone wants to help, feel free to contribute on Gitlab, or create a fork.
- Implement entity callbacks. The way I tried (specifying callback when registering entity didn't work)
- See if it is possible to implement player knockback in some way
- Make the velocity of flying nodes after large explosions less random
- Add default node blast resistances for other common mods (like technic for example)
The mod is released under LGPL version 3.