[Mod] Modified Physics, Sprinting, Hunger [sneak_jump]

Post Reply
User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

[Mod] Modified Physics, Sprinting, Hunger [sneak_jump]

by jas » Post

Hello! This is a quick mod I made to enable modified physics only while holding down the Use key (default [E]). Includes optional stamina drain and hunger.

Download or View
LGPL 2.1+

Video showing some movements using this mod: https://www.youtube.com/watch?v=6CdSJ9T1_aw

Features:
  • Sound for eating
  • Silent footsteps while sneaking
  • Toggle sneak jumping by depressing the sprint key
  • Optional stamina/sprinting & satiation/hunger with heart regeneration
  • HUD meters
  • Bandage item for restoring hearts immediately
Image
Last edited by jas on Thu Apr 19, 2018 12:38, edited 4 times in total.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics [sneak_jump]

by jas » Post

Updated. Added optional stamina with configuration settings:

Code: Select all

sneak_jump.stamina_drains (Stamina drains) bool true
sneak_jump.drain_rate (Stamina drain rate) float 0.1
sneak_jump.fill_rate (Stamina fill rate) float 0.25
sneak_jump.speed (Sneak jump sprint speed) float 1.5
sneak_jump.jump (Sneak jump height) float 1.25
sneak_jump.gravity (Sneak jump gravity) float 0.95

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics [sneak_jump]

by jas » Post

Updated to show bubbles in the correct place when damage is enabled but stamina is not.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics [sneak_jump]

by jas » Post

Added hunger. It's optional, and the starvation rate is adjustable (see settingtypes.txt).

Ps. I forgot to mention there's a bandage to repair hearts. I'm going to add a very slow regen now.
PPs. Added heart regeneration when sated.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics [sneak_jump]

by jas » Post

Updated:
Limit item eat amount, fix bugs. …
Hunger bar is lowered if hearts are off.
Stamina is lowered if satiation is low.
Damage taken frequency is reduced if not sated.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics [sneak_jump]

by jas » Post

Updated. Digging, sprinting, and moving around now take fewer hunger points.

User avatar
googol
Member
Posts: 83
Joined: Mon Dec 09, 2013 09:23

Re: [Mod] Modified Physics [sneak_jump]

by googol » Post

Good job.
I am groot!

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics [sneak_jump]

by jas » Post

Thank you.

I updated the mod to increase [stamina] drain rate depending on how hungry the player is. I'm not terribly happy with the code, I hope it's alright. At full satiation, the player can sprint longer, now.

I'll likely also change the fill rate to be lower if the player is moving.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics [sneak_jump]

by jas » Post

jas wrote:I'll likely also change the fill rate to be lower if the player is moving.
Done.

Update: Also, here's a video showing some movements using this mod: https://www.youtube.com/watch?v=6CdSJ9T1_aw

User avatar
googol
Member
Posts: 83
Joined: Mon Dec 09, 2013 09:23

Re: [Mod] Modified Physics, Sprinting, Hunger [sneak_jump]

by googol » Post

Maybe when the player jumps the stamina should decrease to?
I am groot!

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics, Sprinting, Hunger [sneak_jump]

by jas » Post

Hm, right now the stamina only decreases when jumping if holding the sprint key. In fact, that's the only time stamina is ever depleted. It would be interesting to decrease stamina when jumping. (Actually, the stamina is depleted down to zero if starved.)

Another idea I'm thinking about is implementing a cooldown timeout, such that if the player totally runs out of stamina, they have to wait for it to fully recharge before it can be used again. I should also lessen the effect of the "stamina fill rate when moving" multiplier.

Okay, I've created three issues on the GitHub issue tracker. Thank you googol, it's a good suggestion and one that touches on a bigger aspect: what else besides sprinting does stamina relate to?

https://github.com/jastevenson303/sneak_jump/issues

Update: The player is now silent while sneaking, making no footstep sounds. Secondly, there's now a crunch sound that plays at various pitches when eating. Update #2: Players are now physical, unless they're dead, then they're not until they respawn.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [Mod] Modified Physics, Sprinting, Hunger [sneak_jump]

by jas » Post

I started a server with this mod, again. It's a minetest-0.5.0-dev server, and is located at dcbl.duckdns.org:30000. I'm going to tweak this mod such that it's a little more efficient, if I can.

I added at least one obstacle course, but I'm going to make more. The one I made is vertical, so I'll probably extend it out horizontally at the top. Here's a video:

https://www.youtube.com/watch?v=8XpeRwOB3nI

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests