Lighting for Health Revision

During the development of Four Days Before School I worked on using lighting to represent the amount of health the player had. The decision to use lighting for health was made because we had one programmer and two artists, so since we would have more man hours for graphics work, we wanted to focus on the aesthetic and atmosphere of the game and chose a concept based on that. Since the game depicted a child dreaming, the idea of using light fading as you took damage in the game felt appropriate, so we decided on the idea.

The implementation simply uses a ___ light in Unity and has a script that linearly interpolates (”lerps”) the intensity and range towards a target value. That target value is modified whenever the player takes damage. This creates an effect where the light fades whenever the player takes damage, and fades faster the more damage is taken.

teddy-hp-light-test

Lighting levels at high health (from early build).

This system was developed early on, but needed a lot of revising, due to player feedback that it was difficult to tell how much health the player had. The early revisions focused on changing how drastic the change in lighting was, but after never getting any positive playtesting feedback on the lighting-as-health system, and the game entering beta stage, we needed to do more drastic reworks. The revision I worked on was one of changing the mathematical function from health to lighting intensity and range.

teddy-hp-light-test-2

Lighting levels at low health (revised system, from alpha build).

Originally the function used was just a linear one. When you lost x health, the intensity dropped by that much. However, after receiving feedback that towards lower health levels, the change in lighting felt more dramatic than at higher health levels, I decided to more closely analyze the change in lighting as intensity changes. I identified that the difference between intensity 2 and intensity 1 felt a lot stronger than intensity 4 to intensity 3, despite that the loss of hit points would be the same (the intensity difference being 1 in both cases) which was in line with playtesting feedback.

After further testing, I concluded that the perceived intensity difference between intensity 4 and intensity 2 felt about the same as that from intensity 2 to intensity 1 and that from intensity 1 to intensity 0.5. From that I concluded that it would be best to use an exponential function. That the target value that the lighting intensity tends towards should be 2^x, where x is health, divided by some number.

About Olof Wikmark

2016 Programming