Blog

Short Giraffe Post 6: Challenging myself to learn something new

On every new project I find myself on I always make it a goal to learn something new about the tools and engine I am using. On Short Giraffe we were discussing as a team the way in which we wanted the game to end. We knew we wanted Agent G to foil the plans of the Meerkats, but like any agent, Agent G wouldn’t be down and out for the count after the credits roll. In my own personal time I set out on a personal mission to try and make a post credits level for our game. There was just one slight problems, we didn’t have the time to test a whole new level within the game and so I knew I had to get creative.

During a team meeting while discussing how the credits sequence would play out, we came upon the idea that it would be comedic to have the player land right back at the start of level one after the credits finished rolling and have them be able to play the whole game with the jet pack.

I had multiple ways of approaching this technical problem. I could have copy and pasted the current level 1 and slightly modify it for our purposes but then that would mean a whole new level to add to our already content packed production pipeline. It also is very inefficient for our needs. I could have also had a bunch of the necessary content just disabled in that level and just activate it afterwards but that also brings its own issues, especially adding more potential for human error when editing content.

The way I ended up going with was Unity’s additive scene loading functionality. Game levels within Unity are contained in files called scenes. The engine will swap out the currently loaded scene whenever the game tells it to, but another ability the engine has that is not as well known is the ability to load scenes additively. This means you could have your game level loaded along with another scenes entity’s loaded at once and interact with each other. Using this method had several benefits for us, the biggest one being no new levels had to be tested, and instead all that had to be tested were the changes made to suite the after credits scenario. In-game, after the credits are done, the game loads in the post credits scene which loads in all of the assets needed for the post credits sequence, then loads in the first level of the game. Once loaded in, the engine then moves the objects contained into the post credits scene into the games first level.

Once loaded in, the post credits scene is unloaded as it’s job is done and then the post credits sequence happens. The player falls down from space, hitting the ground in a huge explosion. They land right at the beginning of level one of the game with the jetpack. During the sene handoff process, the dialogue of all of the collectible Meerkats and story characters are swapped out from their level one variants to their post credits variant. Just like that the player is playing level one, as if they totally didn’t just fall from space onto solid rock. If it weren’t for this system, we most likely wouldn’t have had a post credits scene at all. I’m very proud of how that little system came together as I think it adds some more charm to the game that otherwise might have been lost. Besides it gives you a reason to actually watch the credits!

Dylan Alter