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

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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
Attachments
2016-05-26-235033_802x630_scrot.png
2016-05-26-235033_802x630_scrot.png (184.75 KiB) Viewed 2011 times
2016-05-22-005026_802x630_scrot.png
2016-05-22-005026_802x630_scrot.png (159.19 KiB) Viewed 2011 times
Last edited by vitalie on Tue Jun 28, 2016 05:57, edited 8 times in total.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

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

by Krock » Post

This is a bombastic good mod. Are there plans for stronger landmines? Perhaps to make sure that someone's really dead.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

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.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

cool! would like to see it in an army modpack ;)
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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).

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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").

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

I guess I should have tried it out before leaving my comment. ;)
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

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

by ExeterDad » Post

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!

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

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?
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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!!!
Last edited by vitalie on Thu May 26, 2016 14:44, edited 2 times in total.

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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?

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

scenario1:yes
scenario:2 Sure!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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.

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

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

by Desour » Post

  • 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
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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!

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

@Ds-Minetest, i prefer running like a KAMIKAZE and to have luck than waiting two hour for disamring a bomb!LOL
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

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

by Desour » Post

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
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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.
Attachments
2016-06-02-015826_802x630_scrot.png
2016-06-02-015826_802x630_scrot.png (128.14 KiB) Viewed 2011 times

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

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

by sofar » Post

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.

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

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.

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

Is a mesh any better than a nodebox?

Image

b3d model 54 kiB + one texture 159 kiB sounds like too heavy to me.
Attachments
2016-06-02-235504_802x630_scrot.png
2016-06-02-235504_802x630_scrot.png (106.99 KiB) Viewed 2011 times

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

+10000
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

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

by Desour » Post

the good old nodebox was nicer
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

Obj might be smaller than the b3d file.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

vitalie
Member
Posts: 66
Joined: Wed Feb 24, 2016 07:38
GitHub: ciubotaru

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

by vitalie » Post

Nathan.S wrote:Obj might be smaller than the b3d file.
Yes, .obj turned out to be smaller. Let it be .obj then.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests