-
Notifications
You must be signed in to change notification settings - Fork 77
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
mods folder and fast_gauge.md #322
base: main
Are you sure you want to change the base?
Conversation
docs/index.md
Outdated
|
||
## Mods | ||
|
||
- [Fast Guage](mods/fast_guage.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Guage
-> Gauge
(applies to the file-name as well)
docs/mods/fast_guage.md
Outdated
|
||
This is a quick tutorial on how to modify the guage of exp and health bars of Plat so that the bar visually updates in subpixels per second instead of points per second. | ||
|
||
This mod is a backport of the healthbar fix made by the contributors of [pret/pokeheartgold](https://github.com/pret/pokeheartgold) for the heartgold/soulsilver decomp. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Provide a perma-link to the original fix in pokeheartgold
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the typos and provided a direct link to the line that's changed in pret/pokeheartgold.
Fixed typos and gave a link to the exact line in pret/pokeheartgold that changed hp bars to be faster if max hp is less than pixel width. The macro in line 22 is irrelevant to what actually is changed. Line 1497 is all that matters here.
docs/mods/fast_gauge.md
Outdated
if (max < corrected) { | ||
- ratio = max * 0x100 / corrected; | ||
+ ratio = (max >> 8) / corrected; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show a video of the difference here, by-chance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. Also noticed that I made a typo. Will fix that.
|
||
This is a quick tutorial on how to modify the gauge of exp and health bars of Plat so that the bar visually updates in subpixels per second instead of points per second. | ||
|
||
This mod is a backport of the healthbar fix made by the contributors of [pret/pokeheartgold](https://github.com/pret/pokeheartgold/blob/src/battle/battle_hp_bar.c#L1497) for the heartgold/soulsilver decomp. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that this is the correct link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The USE_SUBPIXEL_TEST
definition is just an abstraction of a common comparison in the pokeheartgold code. The main difference in pokeplatinum is that we don't use the same variable names in all cases where that comparison is used. Regardless, that comparison is still in the pokeplatinum codebase when dealing with guages. However, the difference is is that pokeplat calculates adjusts the bar at a constant rate of 0x100, while the pokeheartgold uses bit shifting in order to standardize the rate in which health bars increase and decrease, regardless of size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bitshift in pokeheartgold
is in the opposite direction (leftward instead of the rightward shift listed in this document below), and is functionally equivalent to multiplying by 0x100
. To illustrate:
15 * 0x100 = 0xF * 0x100
= 0xF00
= 3840
15 << 8 = 3840
So, I guess that I am confused... how does this mod work? What change does it institute? It may be worthwhile to further document the tiling system used by the HP bar as part of this PR.
Corrected bitshift
Adds
docs/mods
folder,docs/mods/fast_gauge.md
to explain a possible edit tosrc/battle/healthbar.c
for faster exp and hp bars, and added a link to the file indocs/index.md
.