Cubyz icon indicating copy to clipboard operation
Cubyz copied to clipboard

Dynamite!

Open Argmaster opened this issue 7 months ago • 9 comments

Description

This pull request introduces sulfur based explosives:

  • dynamite stick
  • dynamite block

Dynamite stick is crafted from 2 sulfur and 2 coal

image

It can be placed like torch and can be ignited with torch. Explosion is instant and does not harm player.

Dynamite block can be crafted with 16 dynamite sticks

image

It has significantly higher block damage and damage radius

Explosions are done with ray casting and take resistance and health of block they break into account to reduce the radius of the explosion. Blocks marked as air and fluid are not destroyed.

Links

Depends on: #1313 Related to: #849

Argmaster avatar Apr 16 '25 13:04 Argmaster

image

image

image

Argmaster avatar Apr 16 '25 13:04 Argmaster

image

Argmaster avatar Apr 16 '25 22:04 Argmaster

I cannot accept this until #610 (to avoid lag spikes) and #81 (to avoid griefing) are resolved. Alternatively, a gamerule to disable explosives could be a short-term workaround for the survival world until we have those features.

IntegratedQuantum avatar Apr 17 '25 08:04 IntegratedQuantum

The dynamite block model is clever, but it stops you from making a giant pile of dynamite (without there being a bunch of gaps). I think a standard cube would be fine: image

careeoki avatar Apr 17 '25 20:04 careeoki

Question: would a pile of dynamite increase its range, or its power?

ikabod-kee avatar Apr 17 '25 20:04 ikabod-kee

Both, preferably as emergent behavior. I would prefer to avoid dynamite blocks flying around like in minecraft tho. With #1261 we can make dynamite explosion damage blocks it can not break, so consecutive explosions would break blocks damaged by previous ones. As for range, I would like to count how many TNT blocks are touching and merge their explosion strength and range as an optimization.

That said current tag based system (explosionSmall and friends) for explosion control is not acceptable long term. IMO we should allow for arbitrary attributes (that are not performance critical, not for rendering control) for blocks to be stored in hash map of ZonElements. This problem will re-appear every time we add some non-binary configurable trait of a block (or item!), to name few:

  • food value,
  • explosion strength and radius,
  • fluid spread radius, viscosity
  • inventory capacity for storage blocks 3-rd party modifications will be interested in this kind of parameters too.

Argmaster avatar Apr 17 '25 21:04 Argmaster

Resolved conflicts with network refactor.

Argmaster avatar Apr 28 '25 20:04 Argmaster

Damage for stone and mud

image

image

Argmaster avatar May 18 '25 19:05 Argmaster

Future improvements:

  • [ ] Sticks of dynamite should be throwable
  • [ ] Sticks of dynamite should be placeable on bottom of a block
  • [ ] Delayed explosions with dedicated EntityDataClass
  • [ ] Chained explosions
  • [ ] Ignition animation
  • [ ] Explosion particles
  • [ ] Damage to blocks which were not broken but were in explosion radius (#1261)
  • [ ] Entity damage
  • [ ] Scale damage with number of dynamite sticks placed in one block
  • [ ] Block drops
  • [x] Batched block updates
  • [ ] Placeable string / gunpowder to be used as fuse for igniting dynamite from afar
  • [ ] Torches replace dynamite when placed on same block and vice versa
  • [ ] VTable based item interactions?
  • [ ] Maybe we should have system for arbitrary properties? Explosives could use explosionStrength and explosionRadius but adding them for all blocks doesn't make sense.

Argmaster avatar May 18 '25 19:05 Argmaster

Closing until it's a priority to integrate similar stuff into engine.

Argmaster avatar Oct 23 '25 13:10 Argmaster