Round End Cutscene Implementation

 Author: Yashwant Patel

Problem:

Before the very first round and in between each round the player has access to the upgrade system where they can spend the currency they earn to purchase upgrades. Currently the player has no idea about the upgrades since they aren't told about them. One thing that can help mitigate this problem is to have a "cutscene" at the end of each round that shows a ship arriving with supplies (upgrades). This would help mitigate the main problem and it also solves the mystery of where the upgrades are arriving from. The objective is clear, but how should it be executed? Could use Unreal's level sequencer to make an animation and then render it and play the video once the round ends. Another way would be to have a "dynamic cutscene". Sounds fancy, but what does this mean? Essentially it means that each round end cutscene would be unique. How can that be accomplished and why attempt it in the first place? The main problem with setting up the sequencer and rendering a video is that each time you change something in the level (it will be happening very frequently due to asset integration), you would have render a new video. Also animating by hand limits the camera to whichever view it was animated for. To solve this problem "dynamic cutscene" seemed like the better choice.

Solution: 

One downside to this route is that there is a large upfront cost in development time since a system has to be made, but once the system is setup it is easily adjustable. So what is this system? Essentially we would reuse the spline movement system we have in place and have the ship use these splines to dock and exit the dock. Each time a random spline would be chosen, so each time there is a chance for a different "cutscene" to play. However this doesn't make each cutscene unique since  the number of splines will be limited. In order to combat this there is another addition to this system, which is dynamic/random camera movement. This will decrease the chances of two cutscenes being the same. Now with this in mind it was time to implement the system. Although it is easy to explain on paper it was a little tougher to implement since I hadn't thought about the implementation before hand and dove right into coding the system. As always this was a mistake since it increased the development time. Another reason it took longer to implement the system is because I kept getting ideas on how to add even more randomness to the cutscene. One idea was to have three ships (each would have a different NPC) and choose between those ships and the upgrade system would display a different message (depending on the NPC) when there were no upgrades left. This added more complexity, so due to time constraints I decided keep one ship for now. In the future I plan to add dummy ships that will roam around the level to make the world feel more alive and larger. This would be a nice system, but having the ship just appear on the screen (in the distance) then arrive at the dock wouldn't look too great. 


So time to sidetrack and spruce up the level a little bit.
Looks a little better and the ship now has areas to come from. After the outskirts of the level were added it was time to go back to the implementation. The system uses a manager object which listens for the round end event. Once the manager has been notified it lerps a camera from the player's current camera (player movement and input is disabled) location to a position where the ship will arrive from. After a couple seconds of delay the camera switches to a random camera on the ship and each camera on the ship has a duration, rotation speed, and other variables needed for the system. After the duration for that camera has passed it changes to a new camera (if the same camera isn't rolled) and if the camera can rotate then it will rotate. Now not all players would want to sit through the cutscene each time especially when they know what it leads to. So it was time to add a skip cutscene feature. For this an event is fired once the player pressed Esc or Enter key. This fades the screen to black which allows the ship to be teleported to the dock (end of the spline), give player control back, and reset the camera to the player. After this is over another event alerts the UI that it can fade back in and once that happens the player is free to go and purchase their upgrades. When the cutscene initially starts all of the UI is hidden and two bars appear on the top and bottom of the screen to give it more of a cinematic feel. Currently the ship doesn't have a captain and the upgrade system hasn't been integrated with the ship, but the system is in place and tweakable to make it look nicer. 






Level design and the camera settings need to be tweaked to make it look nicer.

Comments

Popular posts from this blog

UI Polish

AI Navigation Problems - Yashwant Patel