Production: Multi Scene Architecture

I learned about multi scene loading in Unity while studying abroad in Montreal and it’s amazing. It’s nice on a solo project, but essential in a team project and pretty easy to implement. You can check out the script we used here.

Some sort of multi scene architecture is essential because handling unity scene merge conflicts is a huge hassle, and if the game is split into several different scenes it helps avoid them. Splitting each level into a scene is obvious, but you can also split sound, lighting, user interface, and whatever else you can think of into a separate scene.

The main problem we ran into is spawning the player in the correct place for different levels, which was really easily fixed by making sure it was always (0, 0 ,0). Although our level designers did complain a little bit about moving everything.

The other problem we faced was communicating data in between scenes since it’s harder to find objects in between scenes. One option is to simply get every object in the scene and then sort through. Another is to make everything a singleton which happens if you give the game designers free rein. The solution we went with was to create scene relay singletons to communicate information between scenes.

This solution started as a way to keep scripts in between scenes disconnected and avoid a tight pairing. I think it did help a little because as long as the passed data stays the same, any code changes can all be done in the same scene. It was also very easy to implement. However, it adds an extra step in passing data and making bigger changes is a little more confusing.

Overall I think this is a fine solution, but I’d like to find something that’s a little bit easier to work with and more architecturally sound in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *