Page 1 of 2

[Mod] Explosives [WIP] [git] [explosives]

Posted: Sat May 21, 2016 15:52
by vitalie
When they invented explosives, they thought they were helping miners. Put a TNT block, add a gunpowder trail, touch it with a torch and get a nicely shaped explosion crater, all from a safe distance. However, their peaceful invention turned into deadly weapons -- bombs, grenades, and mines. All it took was a fuze.

Imagine yourself doing your usual tasks: digging some stuff, placing some other stuff. You thrust your shovel into the dirt, but instead of the usual earthly sound you hear ... a click. A fuze! You have just touched a land mine, and all you have left is a short moment before it explodes... Boom!!!

ImageImage
ImageImage

Mod details
This mode is build on top of the standard TNT mod (it's part of the standard subgame, but you still need to enable it in minetest.conf). It adds mines and techniques to conceal them in the ground. Punch a mine -- boom. Step on it -- boom. Place something on it -- boom.

Attach a bottle and some cable to a land mine and you get a naval mine. It will float in water and acoustically detect nearby players.

Attach a DIY clock to a land mine and you get a time bomb. You can set the time (1 second to 1 hour) and it will blow up right in time.

Warning: A placed mine needs to be armed (by right-clicking and pressing the 'Arm' button). It takes 30 seconds, and can be canceled. After a mine is armed, there is no way to disarm it. Same with time bombs, after the timer was started, there's no way to stop it (you can git the bomb though).

New items
  • Fuze ('explosives:fuze')
  • Land mine ('explosives:landmine')
  • Land mine concealed in dirt ('explosivese:landmine_dirt')
  • Land mine concealed in dirt with grass ('explosives:landmine_dirt_with_grass')
  • Naval mine
  • Cable reel for naval mines ('explosives:navalmine_cable')
  • Time bomb
  • Hourglass for time bombs
  • A warning sign ('explosives:minefield_sign')
  • more to come
Crafting recipes:
Spoiler
Fuze

Code: Select all

--- ingot     ---
--- gunpowder ---
--- ingot     ---

Result: 10 fuzes
Land mine

Code: Select all

tnt + fuze
Land mine concealed in dirt

Code: Select all

landmine + dirt
Land mine concealed in dirt with grass

Code: Select all

landmine + dirt + grass
Cable for naval mines

Code: Select all

ingot ingot ingot
ingot wood  ingot
ingot ingot ingot

Result: 1 reel of cable
Naval mine

Code: Select all

landmine + any vessel + cable
Hourglass

Code: Select all

--- glass bottle ---
---     sand     ---
--- glass bottle ---
Time bomb

Code: Select all

tnt + fuze + hourglass
OR

Code: Select all

landmine + hourglass
Minefiled sign

Code: Select all

wooden sign + orange dye + red dye + black dye
Mod dependencies: default, tnt, intllib (optional), dye (optional), vessels (optional)
Download latest dev branch
GitHub https://github.com/ciubotaru/explosives

License
  • Code: GPLv3 or later
  • Resources: CC-BY-SA 4.0 or later
ToDO
  • More concealed mines (sand, gravel etc.) -- suggested by Naj
  • 'Anti-personnel mine' style, doing more damage to players and less to the terrain
Spoiler
In real life, the use of land mines is prohibited by a series of treaties and conventions, inlcuding:
  • Convention on the Prohibition of the Use, Stockpiling, Production and Transfer of Anti-Personnel Mines and on their Destruction (aka the Ottawa Treaty), 1997
  • Convention on Prohibitions or Restrictions on the Use of Certain Conventional Weapons Which May Be Deemed to Be Excessively Injurious or to Have Indiscriminate Effects (aka the UN Convention on Certain Conventional Weapons), 1980
  • Protocol on Prohibitions or Restrictions on the Use of Mines, Booby-Traps and Other Devices, 1996
  • Protocol on Explosive Remnants of War, 2003
  • Convention on Cluster Munitions, 2008
Just for you to know.
------
Last updated: June 2, 2016

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Sat May 21, 2016 15:57
by Krock
This is a bombastic good mod. Are there plans for stronger landmines? Perhaps to make sure that someone's really dead.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Sat May 21, 2016 21:42
by Nathan.S
This looks great for PVP gameplay.

Would there be anyway to make the land mines explode when a player walks on top of them? I know Mesecons has pressure plates which can detect when a player stands on them, maybe some of that code could be used to make the mines detonate when a player walks on them.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Sun May 22, 2016 08:18
by azekill_DIABLO
cool! would like to see it in an army modpack ;)

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Sun May 22, 2016 15:01
by vitalie
Krock wrote:Are there plans for stronger landmines? Perhaps to make sure that someone's really dead.
No specific plans. Everything depends on users' feedback.

Currently, the explosion functionality is identical to TNT (a detonated landmine turns into burning TNT and explodes).

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Sun May 22, 2016 15:08
by vitalie
Nathan.S wrote:Would there be anyway to make the land mines explode when a player walks on top of them?
They do explode when a player walks on them. However:
* It's being checked by ABM once a second. So if a player moves over a landmine quickly enough, the landmine might miss him.
* The detection radius is a bit less then one block. This means that a landmine will not detonate if the player only steps on the corner.
* Detonation is not immediate. The player has about 3 seconds to run away after the landmine locked ("clicked").

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Sun May 22, 2016 22:55
by Nathan.S
I guess I should have tried it out before leaving my comment. ;)

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Mon May 23, 2016 00:39
by ExeterDad
This is a fun mod for sure :D
It did feel a bit cruel placing "grass blocks" in the area of my kids houses. They blend right in.

I love being me sometimes!

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Wed May 25, 2016 15:12
by Nathan.S
Is there a reason that the grass turns into the mine once triggered and then turns into tnt? I guess I understand it turning into the mine as a visual cue for players, but why turn it into TNT?

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu May 26, 2016 03:39
by vitalie
Nathan.S wrote:Is there a reason that the grass turns into the mine once triggered and then turns into tnt? I guess I understand it turning into the mine as a visual cue for players, but why turn it into TNT?
1. Yes, it goes click as a sound clue and turns into a normal mine block as a visual clue for players to run away.
2. Currently the mod lacks the explosion functionality. So in order to blast a mine, I had to shortly turn it into a burning TNT block and set timer to 0. Of course, it doesn't have to stay this way. Moreover, besides visual inconsistency, this mechanism has another drawback -- a landmine is a 'falling node', so if the mine is falling down, sometimes the TNT block will not replace it, but will appear above it.

Update: now the mod calls the explosion function directly from TNT mod (who knew it's a public function?!), without replacing mines with TNT blocks.
Naj wrote:Two ideas :
- Make landmines explose even if they are hidden one block below surface (allow to hide normal lanmines under a bloc of dirt, sand or whatever) when player walks on the above block.
- Make it possible to have random landmines (that does not explode everytime a player walks on it).

And why not also sea mines ?
Thank you for the ideas.
#1 is doable, but I think it's not realistic. One block is supposed to be 1 meter deep. Hiding a landmine 1 meter deep and expecting it to explode doesn't sound natural to me. I would rather create more camouflage options (like sand, gravel.
#2 is sort of implemented. The mine checks for players once a second, so if a player normally walk over a landmine without stopping, it might not 'notice' him/her.
Krock wrote:Are there plans for stronger landmines? Perhaps to make sure that someone's really dead.
I guess I will have to change the explosion mechanics to deal more damage to players and less to surrounding blocks.
A naval mine sounds great! That should be an acoustic naval mine, that explodes when a player moves in water around it. Thank you!!!

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu May 26, 2016 03:48
by vitalie
A question to everyone: should landmines react to other (non-player) objects?

Scenario 1: A player drops something on a land mine. Should it explode? If yes, should it destroy the object?

Scenario 2: A mob (think sheep or rat) walks over a land mine. Should it explode? If yes, should it destroy the mob?

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu May 26, 2016 07:15
by azekill_DIABLO
scenario1:yes
scenario:2 Sure!

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Sun May 29, 2016 16:54
by vitalie
Updates:
  • Mines are crafted unarmed (sorta harmless). After placing, they need to be armed (right-click button). It takes 30 seconds for a landmine to arm (can be canceled/unarmed).
  • Landmines (armed and unarmed alike), just like TNT blocks, will explode if punched by a torch.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Mon May 30, 2016 16:26
by Desour
  • the mines take a too much time to explode after a player walks on it
  • (the explosion should maybe go further along the y axis)
  • +a mine, when you walk on it its ok, but if you go away then, it explodes
  • disarm:click with screwdriver 10 times, wait 10-20 seconds between clicks, if less than 10 seconds, it explodes, if more 20 seconds, you have to begin again

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Mon May 30, 2016 16:55
by vitalie
DS-minetest, thank you for the comments.
DS-minetest wrote:the mines take a too much time to explode after a player walks on it
Yeah, I guess 3 seconds is too long for a typical player in normal circumstances. On the other hand, if it explodes immediately and instantly kills the player, he/she won't even understand what happened (which is not fair). Maybe 1 second would be more balanced.
DS-minetest wrote:(the explosion should maybe go further along the y axis)
Good idea, but a lot of work.
DS-minetest wrote:+a mine, when you walk on it its ok, but if you go away then, it explodes
Yeah, but we can do "/home", "/spawn", "/teleport" etc., or just log out. On a related note, naval mines with acoustic detonation are underway -- they explode even if you simply pass by.
DS-minetest wrote:disarm:click with screwdriver 10 times, wait 10-20 seconds between clicks, if less than 10 seconds, it explodes, if more 20 seconds, you have to begin again
Great idea!

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Mon May 30, 2016 17:18
by azekill_DIABLO
@Ds-Minetest, i prefer running like a KAMIKAZE and to have luck than waiting two hour for disamring a bomb!LOL

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Tue May 31, 2016 16:19
by Desour
azekill_DIABLO wrote:@Ds-Minetest, i prefer running like a KAMIKAZE and to have luck than waiting two hour for disamring a bomb!LOL
well, 100-200 seconds, so only ~2-3 minutes..., yeah, but it would be unfair for the player who placed the mine to simply let other players remove it

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Wed Jun 01, 2016 17:01
by vitalie
Announcing naval mines.

Image

Attach a bottle and some cable to a land mine and you get a naval mine! The bottle works as a flotation device, i.e. makes it float (sometimes even drift) just under the surface of water, and as an acoustic sensor, i.e. detects players around and detonates if someone comes too close. The reel of cable attaches the mine to the seabed.

To craft a reel of cable place a block of wood in the middle and 8 steel ingots around.
To craft a naval mine, randomly place a bottle (or any other vessel), a reel of cable and a land mine.

To arm a naval mine, place it on seabed and activate. After arming it will go up to the surface and stabilize there. If you destroy the cable, the mine will randomly drift.

Disclaimer: Don't attempt this at home.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Wed Jun 01, 2016 17:51
by sofar
If you use a NodeTimer instead of an ABM, it's possible to achieve much higher accuracy detecting players. If the server owner changes the minetest.conf setting nodetimer_interval to e.g. 0.1, then node timers can be executed 10x per second. ABM's have a maximum frequency of 1/second, but nodetimers have no frequency limit and can get executed 10s of times per second if configured properly.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu Jun 02, 2016 03:21
by vitalie
sofar wrote:If you use a NodeTimer instead of an ABM, it's possible to achieve much higher accuracy detecting players. If the server owner changes the minetest.conf setting nodetimer_interval to e.g. 0.1, then node timers can be executed 10x per second. ABM's have a maximum frequency of 1/second, but nodetimers have no frequency limit and can get executed 10s of times per second if configured properly.
Thank you for the hint! I didn't know ABMs can not fire up more than once per second.

Actually I think once per second is just enough for our purpose (some false negatives make it more realistic). Moreover, early explosion is undesirable -- the player will never get close enough to sustain high damage.

A more important issue is CPU usage -- if timers are more efficient than ABMs then I would rewrite the code.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu Jun 02, 2016 14:59
by vitalie
Is a mesh any better than a nodebox?

Image

b3d model 54 kiB + one texture 159 kiB sounds like too heavy to me.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu Jun 02, 2016 15:21
by azekill_DIABLO
+10000

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu Jun 02, 2016 17:09
by Desour
the good old nodebox was nicer

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Thu Jun 02, 2016 23:29
by Nathan.S
Obj might be smaller than the b3d file.

Re: [Mod] Land mines [WIP] [git] [landmine]

Posted: Wed Jun 08, 2016 15:56
by vitalie
Nathan.S wrote:Obj might be smaller than the b3d file.
Yes, .obj turned out to be smaller. Let it be .obj then.