GameDevHQ — Day 11 — Meter Management

Aloha!

For today’s chunk of progress I spent time working on implementing a fuel meter for the speed boost that the player can activate by holding down left shift. What this feature does is add a meter that tracks how long the player can activate their speed boost for. As the player uses their boost the meter will empty and once the meter is completely depleted the player is unable to continue using their thruster boost. In a previous post I spoke about providing restrictions to what the player can do can make a game more challenging and if tuned right more entertaining. With proper design you want to discourage certain undesired behaviors while incentivizing others. In this case the behavior that we were attempting to solve was that with an unlimited thruster the player was incentivized to hold down the shift key at all times to move the fastest they possibly could. To remedy that a restriction was put on how long the player can use their thrusters. However to add some depth to the mechanic the thruster meter has two major actions:

  • If the players uses all of their fuel they cannot use their thrusters again until the bar completely refills.
  • If the player stops using their thruster before it completely empties, they can continue using it at anytime.

This restriction incentivizes player be more mindful of their thruster usage with the cooldown restriction providing a minor punishment for overusing the thrusters. However to counteract the punishment of letting the meter empty the recharge rate for stopping their thrusters early is faster than the cooldown time from completely emptying the bar. This adds some depth to the thruster mechanic where a player who is better at managing their thruster meter can go faster for longer on average than someone who uses all of their thrusters in one go every time.

The newly implemented thruster bar (bottom left) with a full charge.
The thruster bar at half charge.

This mechanic was very heavy on the use of coroutines to get working and was a fun challenge to solve. The primary reason for this was determining a proper way to linearly decrement and increment the charge value of the meter at a controllable rate. This also included setting triggers to stop and start the coroutines during multiple conditions such as whenever the player stops pressing left shift or completely disabling the coroutine that enables the thruster activation once the meter is completely refilling after being emptied.

My next goal for tomorrow to close out this second week is to add in a screen shake effect whenever the player takes damage. In addition I would like to add some more text to the UI to better label the information it is trying to convey and clean up some of the code if there is time. With all of these features implemented that would be the end of the work for Phase 1: Framework of this project and I can move on to Phase 2. Mahalo for reading and aloha!

— Kurt