[Mod] Sprint w. hudbars, hunger, monoids support [hbsprint]

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

[Mod] Sprint w. hudbars, hunger, monoids support [hbsprint]

by texmex » Tue Jul 11, 2017 23:25

License: LGPLv3/CC BY-SA 3.0. Particle code: copyright (c) 2017 Elijah Duffy, licensed MIT.

Description
A flexible sprint mod supporting stamina, hunger and coexistance with other physics altering mods.

Notes
hbSprint can be played with Minetest 0.4.16 or above.
It has no dependencies, but supports hudbars, hbhunger and player_monoids.

List of features
  • Displays and drains stamina (by default, if hudbars is present). Hides stamina bar if full.
  • Displays and drains satiation (by default, if hbhunger is present)
  • Drains air faster while sprinting on walkable ground but in water (by default)
  • Requires only forward key to be pressed, not left and right (by default)
  • Requires walkable ground (no water sprinting)
  • Particle spawning based on ground type (Thanks to octacian)
  • All variables customizable in Advanced settings or directly in minetest.conf

Known issues
  • Forward double tap support not implemented

Bug reports and suggestions
You can report bugs or suggest ideas by filing an issue.

Links
Last edited by texmex on Fri Sep 01, 2017 08:59, edited 4 times in total.
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Tue Jul 11, 2017 23:43

My motivations for writing this mod are

  • that minetest-mod's stamina mod doesn't use hudbars
  • that GunsshipPenguin seem to have abandoned sprint
  • that octacian wanted to keep his mod light and not use hunger factors
  • to support player_monoids
  • the need of a customizable, optimized sprint mod
  • to learn writing a mod pretty much from scratch
 

Byakuren
Member
 
Posts: 812
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by Byakuren » Wed Jul 12, 2017 00:55

Thanks for the monoids support.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Wed Jul 12, 2017 01:42

Byakuren wrote:Thanks for the monoids support.

Thank you for making it. I have trouble with concurring speed events from another mod currently however. A speed potion gets cancelled out by this mod, in a similar way to the problems of the override method. Does anything look wrong with the code? Hbsprint works fine on its own.
Last edited by texmex on Wed Jul 12, 2017 16:42, edited 1 time in total.
 

Byakuren
Member
 
Posts: 812
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by Byakuren » Wed Jul 12, 2017 02:23

texmex wrote:
Byakuren wrote:Thanks for the monoids support.

Thank you for making it. I have trouble with concurring speed events from another mod currently however. A speed potion gets cancelled out by this mod, in a similar way to the problems of the override method. Does anything look wrong with the code? Hbsprint works fine on its own.


What's the mod? player_monoids only ensures compatibility between mods that use player_monoids. Ideally I would be able to override stuff like set_physics_override, but I can't because you can't tell what mod the call is coming from.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Wed Jul 12, 2017 08:44

Byakuren wrote:What's the mod? player_monoids only ensures compatibility between mods that use player_monoids. Ideally I would be able to override stuff like set_physics_override, but I can't because you can't tell what mod the call is coming from.

The mod is herbs (also supports player_monoids). Its green tincture is supposed to increase speed sixfold, but it gets cancelled out shortly after activating it. It also works fine on its own, without hbsprint.

Update: I added a boolean check to not do monoid calls unnecessarily. This made the tincture speed cancellation happen a bit less and is now only invoked whenever that boolean is changed. So whenever hbsprint's monoid is updated, the tincture speed monoid is cancelled. "Simple sprinting" mod has the same issue.


All fine now! I was a clutz.
Last edited by texmex on Wed Jul 12, 2017 16:43, edited 3 times in total.
 

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

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Mon Jul 24, 2017 19:40

Now drains air faster while sprinting on walkable ground but in water (by default).
 

User avatar
Lone_Wolf
Member
 
Posts: 1933
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 

User avatar
Stix
Member
 
Posts: 1249
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: Stix + Stix_
In-game: Stix

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by Stix » Fri Aug 04, 2017 15:34

i wish you would add double-tap support so this could work with your item-drop mod
Playing at Elkien3 Factions.
Need to know something? "Google it" --GreenDimond
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by AntumDeluge » Sat Aug 12, 2017 16:08

+1 Great mod.

Stix wrote:i wish you would add double-tap support so this could work with your item-drop mod


I think it's a good idea too.
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Thu Aug 24, 2017 12:38

Stix wrote:i wish you would add double-tap support so this could work with your item-drop mod

The mod already works with item-drop. Either by using Use key for both or by reconfiguring the item-drop pickup key in its settings.
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Thu Aug 24, 2017 12:45

A multiplayer bug was fixed (caused everyone to sprint once one player sprinted). 3 fine PRs by Antum were merged.
 

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

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by azekill_DIABLO » Thu Aug 24, 2017 13:09

texmex wrote:A multiplayer bug was fixed (caused everyone to sprint once one player sprinted).

and the effect stacked or not?
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Sun Aug 27, 2017 14:33

azekill_DIABLO wrote:
texmex wrote:A multiplayer bug was fixed (caused everyone to sprint once one player sprinted).

and the effect stacked or not?

Fixed since forever.
 

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

John_Constructor
Member
 
Posts: 76
Joined: Thu Jun 01, 2017 20:06
Location: On Minetest 24/7
GitHub: John-Constructor
In-game: Nooberton

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by John_Constructor » Wed Aug 30, 2017 23:22

Tried it out, I found it slightly unnoticeable when I first tested it and a little later it seemed to work, but for some reason it seems not to last for more than about 5 to 10 blocks, this might be an illusion/something I am missing though.
Constructing mechs and wingless aircraft since 2016.
 

User avatar
AntumDeluge
Member
 
Posts: 166
Joined: Sun Aug 07, 2016 05:42
GitHub: AntumDeluge
IRC: AntumDeluge

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by AntumDeluge » Wed Aug 30, 2017 23:56

You can set sprint_speed & sprint_jump in minetest.conf.

I changed the default values to my liking:
  • Speed: 1.5 (instead of 1.3)
  • Jump: 1.3 (instead of 1.1)
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Fri Sep 01, 2017 09:01

John_Constructor wrote:Tried it out, I found it slightly unnoticeable when I first tested it and a little later it seemed to work, but for some reason it seems not to last for more than about 5 to 10 blocks, this might be an illusion/something I am missing though.

It could be that you ran out of stamina (on by default) or that you ran out of food when using hudbars + hbhunger.
 

turducken
Member
 
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by turducken » Fri Feb 16, 2018 23:43

Having similar issues. I sprint for a few blocks, then it returns to normal speed. If I continue to hold the use key my stamina drains, as well as my food simultaneously, but there is no sprinting.
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Sun Feb 18, 2018 09:46

Both issues probably relatera to both of you using other mod(s) that use minetest.physics_override continously, therefore not playing nice with other physics mods. Turn those off and you should be able to use it again.

On that note, this mod actually does play nice with other physics mods by using player_monoids, given that those other mods also use player_monoids.
 

turducken
Member
 
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by turducken » Tue Feb 20, 2018 04:25

texmex wrote:Both issues probably relatera to both of you using other mod(s) that use minetest.physics_override continously, therefore not playing nice with other physics mods. Turn those off and you should be able to use it again.

On that note, this mod actually does play nice with other physics mods by using player_monoids, given that those other mods also use player_monoids.


It seems that the "playerplus" mod is the culprit. It adds nice effects like knockback, cactus hurting, slow walking on snow and suffocation when inside a node. I'm attempting to make it player_monoids compatible now.

EDIT: I went to go submit a patch for playerplus, and see you beat me to it on github. :)
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Tue Feb 20, 2018 13:53

turducken wrote:I went to go submit a patch for playerplus, and see you beat me to it on github. :)

Heh, good to hear of more people who care. There's many minetest.physics_override based mods out there that also need love btw. :D
 

turducken
Member
 
Posts: 23
Joined: Fri Feb 02, 2018 01:43

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by turducken » Tue Feb 20, 2018 17:10

texmex wrote:
turducken wrote:I went to go submit a patch for playerplus, and see you beat me to it on github. :)

Heh, good to hear of more people who care. There's many minetest.physics_override based mods out there that also need love btw. :D


Yeah, I do care. It's a fun game with a good variety of mods.

I have noticed a lag when attempting to jump in caves (that extra boost needed to make the next block.) It would be nice to have a "lunge" option. To that effect I've been messing around with sprint_timer_step and noticed another physics issue.

If I set sprint_timer_step to 0.1, and adjust the drain and replenish values, while jumping it will stop sprinting. This slows you midair, where one would think your momentum would keep you at the faster speed until landing (I guess ignoring things like changing direction midair as possible :)

So part of the problem with lunging is the large step timer and check for walkable I believe. I suppose one would have to check if initiated on walkable, then check for air nodes, wait until not an air node and stop the sprint after touch down. One would have to stop the stamina drain during air time as well (since you aren't pushing off anything.)

I'm talking to myself I suppose here... I see in the sprint mod they simply decrease the stamina by dtime in global step, but is dtime variable, as that would throw a wrench into reducing hunger in predictable ways.
 

User avatar
texmex
Member
 
Posts: 1005
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Sprint w. hudbars, hunger, monoids support [hbspri

by texmex » Wed Feb 21, 2018 14:06

Good spotting, turducken. This relates to the the walkable check, correct. It was mainly implemented with water in mind, so that you can't sprint run in or on the water surface which you can do with the other sprint mods available. I suppose I could check for walkable or air nodes instead of just walkables.

decrease the stamina by dtime in global step, but is dtime variable, as that would throw a wrench into reducing hunger in predictable ways

I agree, stamina should be independent of dtime, with its own timer. I'll se if I can get around to it.
 

Next

Return to WIP Mods



Who is online

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