Skip to content

Fix hpbar on hud is not compatible visually with MAX_HEALTH stat #3807 #3929

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

Closed
wants to merge 3 commits into from

Conversation

FileEX
Copy link
Contributor

@FileEX FileEX commented Jan 6, 2025

Fixed #3807

This PR modifies the calculations for the width and values of the health bar. By default, the maximum HP in SA is 176. However, based on experiences with other versions, players assume the maximum value is 200, and certain parts of the MTA code make the same assumption. Therefore, to avoid potential backward compatibility issues by limiting health to 176, a better solution is to extend the maximum value to the assumed 200

@TheNormalnij
Copy link
Member

setElementHealth can set > 176 health to a ped. This is an actual bug. Why can't we fix this and keep vanilla behavior?

@Kinimel
Copy link

Kinimel commented Jan 7, 2025

setElementHealth can set > 176 health to a ped. This is an actual bug. Why can't we fix this and keep vanilla behavior?

I totally agree why not solve this real bug once and for all since it is related to players' lives so it would be one less bug to solve once and for all unless it is related to something more important or other bugs, etc.

@FileEX
Copy link
Contributor Author

FileEX commented Jan 7, 2025

setElementHealth can set > 176 health to a ped. This is an actual bug. Why can't we fix this and keep vanilla behavior?

For years, players have believed that the maximum value is 200. Suddenly limiting this value to 176 after so many years seems like a backwards incompatible change, and I don't want this PR to sit for years with such a label. If the current solution isn't acceptable, I'll close this PR.

@Kinimel
Copy link

Kinimel commented Jan 7, 2025

setElementHealth can set > 176 health to a ped. This is an actual bug. Why can't we fix this and keep vanilla behavior?

For years, players have believed that the maximum value is 200. Suddenly limiting this value to 176 after so many years seems like a backwards incompatible change, and I don't want this PR to sit for years with such a label. If the current solution isn't acceptable, I'll close this PR.

I fully agree with your argument that at the time it was an important solution to limit the player's life to 176, but now it is the most acceptable solution for this time and for significant changes such as removing the 176 life limit and changing it for good to 200 life

@ghost
Copy link

ghost commented Jan 7, 2025

If we take a look at other 3D era GTA games we can see that the maximum health number is always a normal exact number such as 100, 150 or 200. 176 being the max health in GTA:SA feels odd that's why I tried to dig up a little to understand why that number was used back then. Turned out that there is no problem at all in the code, other game mechanics got broken.

The width of the health bar shows a maximum of 176 hp for a reason.
The "normal" maximum health supposed to be 150 which you can earn by doing paramedic side mission or simply exercising to get more muscle, stamina, etc. The +26 should come from having sex with prostitutes.
Problem is that the paramedic side mission/exercising gives +76 and not only +50.

I guess when the designers made the health bar they checked how big(wide) it should be. Later they set it to be able to show 176 hp because they knew that the game mechanics would give you that number of health. In theory the health bar should be a bit shrinker and the current width of it should only be visible after the sex minigame.

The paramedic/exercising minigames developers messed up something thats's why these already give you +76 which makes the sex minigame broken in GTA:SA.

The situation with MTA has nothing to do with this I guess. The person(s) who developed MTA couldn't fix the 150 armor bug, The flag doesn't work so you can't have 150 armor, only 100. So I guess they choosed 200 max health in MTA to compensate. We don't know why the armor flag doesn't work. There was a rumour that on PC even if you do vigilante side mission you don't get +50% armor, but this is false.

Conclusion: I agree that everyone used to have 200 max hp now for years, and now it shouldn't be changed. There is a fear that it would let this PR laying here for years with a backward incompatible flag.

I don't see a problem at all by changing that calculation which is a game mechanic. The game mechanics is already broken atm.

I myself would like to have 176 max hp with 150 armor but I understand that's not possible.
If I understand it well this PR doesn't change the width of the healthbar (changing it would be visibly odd) it only changes how much ammount of hp can it show just like the other two bars. So it will support 200hp.
For example the armor bar can show 100 and 150 units but the same width applied, the same goes to lung capacity bar. The lung capacity shows 1000 unit to 4000 unit with the exact same width.

Oh and why 176 and not 175? Why the sex minigame gives +26 and not only +25? Well I couldn't find anything for that ...

@Kinimel
Copy link

Kinimel commented Jan 8, 2025

If we take a look at other 3D era GTA games we can see that the maximum health number is always a normal exact number such as 100, 150 or 200. 176 being the max health in GTA:SA feels odd that's why I tried to dig up a little to understand why that number was used back then. Turned out that there is no problem at all in the code, other game mechanics got broken.

The width of the health bar shows a maximum of 176 hp for a reason.
The "normal" maximum health supposed to be 150 which you can earn by doing paramedic side mission or simply exercising to get more muscle, stamina, etc. The +26 should come from having sex with prostitutes.
Problem is that the paramedic side mission/exercising gives +76 and not only +50.

I guess when the designers made the health bar they checked how big(wide) it should be. Later they set it to be able to show 176 hp because they knew that the game mechanics would give you that number of health. In theory the health bar should be a bit shrinker and the current width of it should only be visible after the sex minigame.

The paramedic/exercising minigames developers messed up something thats's why these already give you +76 which makes the sex minigame broken in GTA:SA.

The situation with MTA has nothing to do with this I guess. The person(s) who developed MTA couldn't fix the 150 armor bug, The flag doesn't work so you can't have 150 armor, only 100. So I guess they choosed 200 max health in MTA to compensate. We don't know why the armor flag doesn't work. There was a rumour that on PC even if you do vigilante side mission you don't get +50% armor, but this is false.

Conclusion: I agree that everyone used to have 200 max hp now for years, and now it shouldn't be changed. There is a fear that it would let this PR laying here for years with a backward incompatible flag.

I don't see a problem at all by changing that calculation which is a game mechanic. The game mechanics is already broken atm.

I myself would like to have 176 max hp with 150 armor but I understand that's not possible.
If I understand it well this PR doesn't change the width of the healthbar (changing it would be visibly odd) it only changes how much ammount of hp can it show just like the other two bars. So it will support 200hp.
For example the armor bar can show 100 and 150 units but the same width applied, the same goes to lung capacity bar. The lung capacity shows 1000 unit to 4000 unit with the exact same width.

Oh and why 176 and not 175? Why the sex minigame gives +26 and not only +25? Well I couldn't find anything for that ...

I understand very well the understanding and clear view on this topic and that there are many considerable points to really as I said there is not much information on underwater pulmonary PH

FileEX and others added 2 commits January 8, 2025 18:11
Co-authored-by: Uladzislau Nikalayevich <thenormalnij@gmail.com>
Co-authored-by: Uladzislau Nikalayevich <thenormalnij@gmail.com>
@ghost
Copy link

ghost commented Jan 8, 2025

Kinimel So we have now temu chatgpt robots on github cool

@Kinimel
Copy link

Kinimel commented Jan 8, 2025

Kinimel So we have now temu chatgpt robots on github cool

Interesting and good to know that this can make it easier for users to use support.

@TheNormalnij
Copy link
Member

The situation with MTA has nothing to do with this I guess. The person(s) who developed MTA couldn't fix the 150 armor bug, The flag doesn't work so you can't have 150 armor, only 100. So I guess they choosed 200 max health in MTA to compensate. We don't know why the armor flag doesn't work. There was a rumour that on PC even if you do vigilante side mission you don't get +50% armor, but this is false.

GetMaxHealth method was commened with "TODO: Verify this formula". So it's MTA bug. Max armour is a byte value in the CPlayerInfo class. Nobody added a lua function to change this value.

I don't see a problem at all by changing that calculation which is a game mechanic. The game mechanics is already broken atm.

A player doesn't know real HP and damage numbers. MTA should not change HP bar to save vanilla damage feelings.

We can allow 200 HP with the unlimited setPedStat function. The game handles up to 255 max HP without graphical issues.

@FileEX FileEX closed this Jan 10, 2025
@FileEX FileEX deleted the bugfix/MAX_HEALTH-stat branch January 10, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hpbar on hud is not compatible visually with MAX_HEALTH stat
3 participants