PadWorld-Entertainment / worldofpadman

World of PADMAN game repository
https://worldofpadman.net
Other
39 stars 9 forks source link

UI: Why to indicate empty HealthStations? #47

Closed kai-li-wop closed 1 year ago

kai-li-wop commented 3 years ago

The icon for the HealthStation is currently also displayed when the station is currently empty. Of course, this is stupid if the player just runs into this station and finds it empty. I have 3 suggestions for solving this issue:

  1. do not show the icon for empty stations as long as they are empty
  2. overlay the icon with the noammo cross, i.e. "cross out"
  3. design a new icon for it, e.g. a broken/cracked heart

I think the first suggestion would probably be the easiest to implement.

shot0001

kai-li-wop commented 1 year ago

I would go for the first solution: don't draw the icon as long as the health station is depleted. The icon is drawn in CG_DrawHealthstationIcon which takes a centity_t type variable. The code in g_stations.c uses s.angles[2] to store the health status information of the health station: 0 for empty and 1 for full. CGAME should be able to use it somehow, but I don't know how. My approach would be to add the following view lines to CG_DrawHealthstationIcon to skip the rest of the function if the health station is empty.

if (cent->s.angles2[2] == 0) {
   return;
}

The thing is that s.angles2[2] is not available for centity_t but for gentity_t. How can I use this in CGAME?

Also, the icon should not be drawn if the health station is very close and visible to the player. I tried to implement this with 96e4081, which uses existing code. The code works so far, but only for one of all health stations in a map. I can't figure out why, since all stations should be passed through due to the loop that calls CG_DrawHealthstationIcon.

Any suggestions @mgerhardy?

3aTmE commented 1 year ago

I just tried it out.

Seems to work fine.

Until now I've never realized that the Health Stations will only show up when you're under 50% health 😄

The icon also disappears when approaching the Health station like intended.

Image

Seems a good solution without cluttering the players screen with unnecessary information.

kai-li-wop commented 1 year ago

@3aTmE: Can you please test if the icon disappears for all health stations in a map when you come close? On my side it only works for one station but not for all, which is kind of strange.

3aTmE commented 1 year ago

@kai-li-wop You're right!

Just checked it out and yes, the icon disappears only on one health station when you come closer to it.

kai-li-wop commented 1 year ago

OK, thx. I created a new ticket for this (#189) because it is not connected to this feature.