New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make TNT faster by using VoxelManip()
for removing nodes.
#816
Conversation
If people complain you might also want to queue 'on destruct' and 'after destruct' functions, although 'on destruct' is usually called before removing a node so this may have problems. |
vm:update_liquids() | ||
vm:write_to_map() | ||
vm:update_map() | ||
for i, data in ipairs(on_blast_queue) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is i
used ? Please ignore it with an underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@kilbith done. |
Needs input on whether 'on/after destruct' functions should be queued also. |
It should be rather easy for mods to use on_blast instead. It could break some mods that are no longer maintained . |
This should also help with server-freezing chain reactions. 👍 |
The possibility of destroying locked chests or protected nodes shoud be considered too. |
Add something like this to check node and if it's a chest drop all items inside.
|
red-001: the above code was for default chests in game either using tnt mod or edited for on_blast itself... I agree that user mods should handle drops on their own. |
@tenplus1 I would agree minetest game should use on_blast more. |
A dev has said there were reasons the voxelmanip wasn't used for removing nodes, you need to research why, try looking through the files history at previous commits. This PR cannot be merged until that research is done. |
@paramat I couldn't find any mention of the reasons in the file history or in the comments on #277 but like you said @ShadowNinja said there where reasons for not using |
There are lots of changes coming for TNT it seems, and too close to release, sofar is busy with his stuff, so it seems the best thing is to delay TNT changes until after release, then do a thorough rewrite. |
I'm counting 6 PRs with related changes. I'm rebasing all of them in a single PR, and making it a master WIP TNT PR that can be used to further improve TNT and comprehensively test all the changes collectively, which is rather cumbersome at this point. |
Rebased and folded in to #862 |
For testing I changed
tnt_radius
in minetest.conf to 20. Without my patch an explosion took 6 seconds and with it it took one second.