Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Mods To Disable Breath Regen #8042

Closed
benrob0329 opened this issue Jan 2, 2019 · 9 comments
Closed

Allow Mods To Disable Breath Regen #8042

benrob0329 opened this issue Jan 2, 2019 · 9 comments
Labels
Concept approved Approved by a core dev: PRs welcomed! Feature request Issues that request the addition or enhancement of a feature @ Script API

Comments

@benrob0329
Copy link
Member

Issue type
  • Feature request
Minetest version
0.4.17.1
Summary

Some mods may want to handle breath in a nonstandard way depending on the effects on and actions of the player. Currently mods need to fight against the automatic breath regeneration which can results in jumpy values for the player.

@SmallJoker SmallJoker added @ Script API Feature request Issues that request the addition or enhancement of a feature labels Jan 2, 2019
@nerzhul
Copy link
Member

nerzhul commented Jan 3, 2019

@benrob0329 i agree. Do you know where it's defined ?
We will not include this in the 5.0.0 roadmap but it sounds reasonable for 5.1.0

@nerzhul nerzhul added this to the 5.1.0 milestone Jan 3, 2019
@Desour
Copy link
Member

Desour commented Jan 3, 2019

Do you know where it's defined ?

It's done here:

setBreath(m_breath + 1);

@nerzhul
Copy link
Member

nerzhul commented Jan 3, 2019

thanks, i was in the train didn't checked. It's anoying to see it's in the engine itself. I think we can add a property or a lua call to enable/disable breath on a player object, do you think it's an acceptable solution ? it should permit to define it per player if needed on some gameplays

@benrob0329
Copy link
Member Author

A property probably makes the most sense here.

@hecktest
Copy link
Contributor

Why is this even built in, and not a part of minetest game? Move it out.

@rubenwardy
Copy link
Member

I totally agree, breath shouldn't be part of the engine.

I also wish that hp wasnt't part of the engine, but at least that is more tied into mechanics which need engine support (ie: punching entities client-side)

@hecktest
Copy link
Contributor

Punching and hp can and should be moved to clientside lua eventually.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Feb 9, 2019

I agree with the feature request. I like to add some basic (!) customization options for player breath handling would be even more useful:

  • Speed of breath loss in liquids
  • Speed of breath regen when outside a liquid.

Why? Because these seem to be the most obvious ones.

That, together with the settable breath limit, would cover 90% of what games need. The 10% can disable breath regen and handle it their own way.

breath shouldn't be part of the engine.

Nooooooo!!
Don't remove breath from the engine! It's way too useful and important for many games.
It would be a serious downgrade.
If you downgrade breath to the Lua level we would lose the standard (!!) API calls set_breath and get_breath which will be replaced by a 1000 incompatible crappy Lua APIs and we end up in dependency hell for a very basic feature. We would also lose drowning in the node def. Just registering a simple liquid node with drown damage that would work in multiple games would become an absolute nightmare, as with any other mods which like to mess with breath.
And detecting where the player's head is sitting and whether it is submerged is likely to be crappy and inefficient in Lua. As long there is no reliable, standard and FAST way to detect this in Lua, the “it could be done in a mod” defense is worthless.
Also, breath would become laggy again, which was precisely the reason why the original breath mod that started it all became a core feature in the first place. The move from the breath mod to core was a huge improvement, and you seriously propose to roll this improvement back. :O

I don't know what kind of elaborated breath mods you envision, but I wanna bet that most mods would just boil down to the same mechanic: If player in liquid → reduce breath, if player outside of liquid → increase breath.

While you're at it, why not outsourcing liquids to Lua as well? It's basically just meshnodes and ABMs. It's so much simpler that way!!111!oneoneeleven Who needs the engine anyway? Eveything in Lua!

@benrob0329
Copy link
Member Author

benrob0329 commented Feb 10, 2019

Perhaps there should be a general block "damage" API that allows games to define different effects that should be applied to the player if they're in a certain node. Such as drowning=1, poison=3` etc in the groups. It'd be up to the game to decide how to handle them but the engine should provide an easy way of knowing when a player if in these kinds of blocks.

@paramat paramat removed this from the 5.1.0 milestone May 8, 2019
@paramat paramat added the Concept approved Approved by a core dev: PRs welcomed! label Jan 8, 2020
@grorp grorp closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Concept approved Approved by a core dev: PRs welcomed! Feature request Issues that request the addition or enhancement of a feature @ Script API
Projects
None yet
Development

No branches or pull requests

9 participants