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

Advanced Stamina System #77

Open
BenCheung0422 opened this issue Jan 2, 2025 · 0 comments
Open

Advanced Stamina System #77

BenCheung0422 opened this issue Jan 2, 2025 · 0 comments

Comments

@BenCheung0422
Copy link
Member

Original: MinicraftPlus/minicraft-plus-revived#404

Background

The current stamina system takes effect on each action and refilled by hunger points. This includes eating, attacking, world interactions. There is also energy potion to temporary "turn off" the use of stamina points.

Action Cooldown

For most actions, an "action cooldown" could be made, that while it is in cooldown, the player may not or ineffectively interact. There is also an existing example of the implementation as in Minecraft. This system would be universal, but controllable, to allow features like potion effects.

Different actions would require different factors of cooldown time to recharge. Some actions may still allow partial interact, like attacking, but ineffectively, with a diminished factor effect. During an action cooldown, stamina would be consumed to recharge. The mechanisms would be global but would not be reset.

For example, the amount of damage made would depend on the percentage of action cooldown recharged with a kind of formula conversion, but food consumption action would require it to be fully charged, or in another kind of implementation, the hunger points charged by food consumption would depend on the percentage of action cooldown recharged. Actions no longer directly consume stamina, but with action cooldown. Action cooldown may also apply on switching hotbar slots.

Stamina Restoring

"Recharging" stamina, or restoring stamina, would be enhanced at this point. After each "use" of stamina, there is a delay (calculated by how "strong" the stamina has been used, likely quadratic) before any restoring. The restoring speed may depend on the hunger levels, like health regeneration. The "strength" of usage depends on the value (if it is an instantaneous use) or the rate (if it is a continuous use). During a continuous use, no restoring could occur, until the suspension.

Kinetic Stamina & Potential Stamina

Kinetic Stamina is separated from Potential Stamina. The former includes walking, sprinting, sneaking and jumping while the latter includes actions, hotbar, etc. However, the stamina restoring principles are similar.

Kinetic Stamina would be restored only when the player is at rest. So, the player would not be able to move constantly without any rest.

Potential Stamina not only supports Action Cooldown, but also supplies the stamina needed by various actions like attacking. If there is not enough Potential Stamina for certain action, like Action Cooldown, the action would be ineffective. When Action Cooldown is being restored by Potential Stamina, Potential Stamina is not restored until the restoring of Action Cooldown is completed.

Starvation

When the player is at starvation, the player is unlikely able to eat any food if both the Potential Stamina and Action Cooldown have been exhausted. However, it might be possible for a mechanism that would let other things (machines and such) or players to feed players at this point. It would be a good idea to remind players to eat food under this system. More mechanisms related to the Hunger System would be implemented in #50.

Energy Potion

There is currently no proposal on how to implement this Energy Effect in this new Stamina System, so it would be removed, unless there is a new proposal on this.

See Also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment