Skip to content

Conversation

@LoneWolfHT
Copy link
Member

@LoneWolfHT LoneWolfHT commented Mar 5, 2019

I broke #279 when rebasing it so here's the updated PR

This PR only adds smoke/regular grenades. It'll be a bit of a hassle to do a flashbang grenade. So I decided to leave that for later

Todo:
Find bugs pls

@ClobberXD
Copy link
Contributor

ClobberXD commented Jul 4, 2019

I'm okay with not adding flashbang - it's not necessary. Will test soon. Is there anything I should look out for? Anything I should test more carefully?

@LoneWolfHT
Copy link
Member Author

I'm okay with not adding flashbang - it's not necessary. Will test soon. Is there anything I should look out for? Anything I should test more carefully?

Mainly physics. I'm not sure what looks fine and what doesn't. Or how far it should be possible to throw them

@ClobberXD
Copy link
Contributor

ClobberXD commented Jul 5, 2019

  • Sound files don't seem to follow MT's naming convention for sound files. Please prefix them with the mod name.
  • Could grenades_basic be merged into grenades? While API separation is good for standalone mods, that isn't really required when bundling it into a game, and it just adds to clutter.
    • grenades_basic/init.lua could be added as grenades/grenades.lua, and could be dofile-d at the end of grenades/init.lua.
    • Media from grenades_basic could be moved to their respective sub-dirs in grenades, and renamed accordingly.
  • Could you also remove grenades from shooter in this PR?

@ClobberXD
Copy link
Contributor

ClobberXD commented Jul 5, 2019

  • Grenades fly a little too fast to be realistic. Maybe reduce their initial velocity?
  • Their cooking time (clock acc. to the API) is too less. 5 seconds would be more realistic, IMO.
  • The duration of the smoke grenade is too less. An ideal duration would be between 30-60 secs.

@Thomas--S
Copy link
Member

Could you also remove grenades from shooter in this PR?

Didn't we want to convert shooter into a submodule?

I suggest to simply unregister shooter's grenade in this mod here.

@ClobberXD
Copy link
Contributor

Didn't we want to convert shooter into a submodule?

That doesn't seem to be happening anytime soon, unfortunately. Until that PR is merged, we'd end up with two grenades.

But on second thought, this PR removes grenade's treasure registration, which means that players won't be able to obtain it anyway. That's fine too.

@Thomas--S
Copy link
Member

I suggest to simply unregister shooter's grenade in this mod here.

I did actually mean to completely remove the shooter mod grenade entirely by using minetest.unregister_item.

@LoneWolfHT
Copy link
Member Author

LoneWolfHT commented Jul 5, 2019

* Grenades fly a little too fast to be realistic. Maybe reduce their initial velocity?

I was basing it off of the speed a rock flies when I throw it

* Their cooking time (`clock` acc. to the API) is too less. 5 seconds would be more realistic, IMO.

I thought 3 seconds was what it was for real life. But upon googling I got this:

Approximately 75,000,000 grenades were manufactured during World War I, used in the war and remaining in use through to the Second World War. At first, the grenade was fitted with a seven-second fuze, but during combat in the Battle of France in 1940, this delay proved too long, giving defenders time to escape the explosion or to throw the grenade back, so the delay was reduced to four seconds.

Changed to 4 seconds for the same reason lol

* The duration of the smoke grenade is too less. An ideal duration would be between 30-60 secs.

Changed to 45

@ClobberXD
Copy link
Contributor

Awesome, will test again soon ™️.

@LoneWolfHT
Copy link
Member Author

LoneWolfHT commented Jul 7, 2019

(-m/2) - (dir.y*2)

This little bit of code reduces/increases the weight of the grenades depending on how far up/down the player is looking. I can remove if you don't like the effect

@ClobberXD
Copy link
Contributor

(-m/2) - (dir.y*2)

This little bit of code reduces/increases the weight of the grenades depending on how far up/down the player is looking. I can remove if you don't like the effect

Interesting, will test.

@ClobberXD
Copy link
Contributor

I'm sorry, but the new behaviour seems to be inconsistent. Ideally, the initial velocity should be very high, and the acceleration, simulating air resistance and gravity, should be updated every step.

The x and the z components of acceleration should be set to -k * dir, where dir is the direction of the grenade at that point in time. So -k * dir is basically a force acting against the grenade's movement direction, a.k.a air resistance; the constant factor k needs to be decided upon by extensive testing. The y-component should just be -9.8.

@LoneWolfHT
Copy link
Member Author

I'll make those changes once I get on my computer. How does 'grenades:frag' sound?

@LoneWolfHT
Copy link
Member Author

The code for slowing the grenade velocity is on line 65+

@LoneWolfHT
Copy link
Member Author

@ClobberXD I've mostly forgotten how you wanted the grenade physics. I went and watched some videos of grenades being thrown and used that to base how the grenade physics work
Ready for testing though

@ClobberXD
Copy link
Contributor

ClobberXD commented Aug 8, 2019

The frag grenade's sound can still be improved. Currently, it's somewhat softer, more like a cannon firing, and there's also another sound being played in the background some where at the middle. (Sounds to me like an empty shell falling on a hard floor)

@LoneWolfHT
Copy link
Member Author

Ton of commits lol. Should be rebased though

This reverts commit 05dd6ff.
@ClobberXD
Copy link
Contributor

ClobberXD commented Apr 27, 2020

Thanks for shedding blood and tears to rebase this PR. ;)

@LoneWolfHT Please also note the following:

Physics seems a little better. I only noticed one oddity - grenades don't cover much lateral distance, when I'm throwing them at a steep angle. This happens IRL too, but the difference in-game is too high to be realistic.

@LoneWolfHT
Copy link
Member Author

Had some old code to account for increased grenade speed

@ClobberXD ClobberXD self-requested a review May 4, 2020 18:37
Copy link
Contributor

@ClobberXD ClobberXD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is as good as it can get, IMO. We can always improve upon this if required.

For now, this PR seems merge-worthy to me. Good work 👍

@ClobberXD ClobberXD merged commit 9c6f2dd into MT-CTF:master May 5, 2020
@ClobberXD ClobberXD mentioned this pull request May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants