Dynamic Time of Day
|
In the game you’re supposed to find survivors buried under the rubble of a bombed city and then dig them up. In order to meet deadlines, the game was designed with this feature abstracted to a press of a button and an ensuing cinematic sequence. In order to communicate to the player that time passes during this we decided to have a controllable day and night cycle. In order to save time we decided to use Unreal Engine’s built in blueprint that contains a sky sphere and a movable sun that you can connect to a directional light source. The blueprint I set up is relatively simple, rotating the directional light based on time. The directional light did shine through the floor though, so using dot product on the sun’s direction I could control the sun’s brightness (which at night would be 0), the skylights brightness and the exponential height fog density. It counts using hours, so setting up the start and finish times was easy. The sun is supposed to move during part of the search sequences to show that time is passing. Implementing this was difficult, as I couldn’t access the blueprint through the sequences. What I had to do instead was to create a timer function that was called when the sequence began playing. While the timer is active the sun moves faster. |
