Minetest_game: TNT: Less particles for big explosions

Created on 3 May 2016  路  11Comments  路  Source: minetest/minetest_game

Hello!
I suggest to reduce the amount of particles for big explosions. Atm, big explosions (100+ TNT) will spawn very much particles, what is bad for the performance and stability. Maybe there should be a fixed amount of particles for explosions, not per TNT node.

Request / Suggestion

Most helpful comment

Maybe an upper limit?

All 11 comments

Maybe an upper limit?

Maybe an upper limit?

Sounds good to me.

The amount of particles for clustered TNT explosions is constant, there are not any more particles when you explode 1 TNT or 125 TNT.

https://github.com/minetest/minetest_game/blob/master/mods/tnt/init.lua#L232

Maybe my client only spawned always more particles because of the huge calculation amount for the big explosion.

Thanks for your efforts. BTW, I really like your TNT changes.

There is no code that spawns more particles.

If you're comparing with an old release (0.4.13), there were the following particles:

  • 128 smoke particles

In the current state of minetest_game, the count is:

  • 64 smoke particles
  • 64 ejecta particles
  • 1 tnt_boom particle

The only difference is that the ejecta particles are "collision_detection" enabled, which may impose an impact on the client performance.

As you can see, there is only an increase of 1 (ONE) particle.

There have also been particle problems with the old version.
I guess the following:

  1. The TNT starts to explode.
  2. The server tells the client to spawn particles.
  3. The server handles the explosion.
  4. The server "forgets" to tell the client to stop spawning particles.
  5. The client spawns always more particles.

Very big explosions (~1k TNT):

  1. The server crashes.

Medium explosion:

  1. The server has finished the explosion.
  2. The server tells the client to stop spawning particles.
  3. The client stops spawning particles.
  4. Everything fine again after a few seconds of irregular behaviour.

Blowing up 1K TNT (e.g. 32x32x32) crashes the old code, and the new code won't do much better.

You're exceeding the capabilities of the minetest engine and game client code (and design). You could as easily break it with other game mechanics (e.g. technic/pipeworks stuff)

It's not a bug, period.

If TNT is breaking your server, disable it or modify it according to your needs.

Thanks for your answer.

It's not a bug, period.

I know, that's why I never called it a bug.

I only wanted to help you making the TNT mod even more "stable", because I really like it (mainly thanks to the new changes made by you, @sofar).

Thanks for your efforts. The current behaviour is also ok for me. The reason why I opened this issue is, that I would really like it, if TNT once gets ready for the stable use on multiplayer servers.

I would really like it, if TNT once gets ready for the stable use on multiplayer servers.

Yes, I've been thinking about ways how to accomplish that as well, and I might make it so that the chain effect of TNT can be disabled to prevent the uncontrolled explosions.

TNT works quite well on my (small) VPS server, It'll lag really bad when a HUGE explosion is triggered, but even my desktop does that.

I think this can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juozaspo picture juozaspo  路  6Comments

FeXoR-o-Illuria picture FeXoR-o-Illuria  路  4Comments

HybridDog picture HybridDog  路  4Comments

Fixer-007 picture Fixer-007  路  6Comments

cdqwertz picture cdqwertz  路  6Comments