Player feedback is a critical part in good design. In Triage, we rely on a blinking light to indicate to the player how long a patient has left before dying. The light will blink at 4 different rates before they die. This system is simple, but it doesn’t distinctively show the rate of decline diegetically.
Instead of blinking the light, I want it to pulse, and for the pulse rate to increase over time as the patient’s remaining time declines. For creating a pulsing light, I will need the intensity to move along a sine wave, for which each period is a regular interval decreased by a normalised value of the patient’s time remaining.
And the equation for determining the interval:
Putting this together in code, we get:
This function reproduces the intensity of the light from a sine wave, gently peaking and troughing the intensity faster and faster before the patient dies (below):
Using this method, the gurneys communicate their states to the player more diegetically to the player, and the player is able to identify the colours more easily, since they don’t become invisible.