Scene Loading System

Hello! I saw your video announcement about UOPs and I’m excited to contribute to this game’s development. I’m interested on working on the Scene Loading System, since I already dealt with this on other projects of mine.

In the case of the scene management system, it is not taken from any external Unity package or code from a third party; I came up with it myself and, since I use it on many of my own projects, I’d like to port it to this game, which would solve the issue fairly quickly. If it’s not allowed, there’s no problem as well, I just want to contribute to this as much as I can anyway.

So, how it works? I propose using a simple SceneSelector component which will require a scene to be selected from the build index, and expose a LoadScene() method to be called either from events, other components on the GameObject, or from other GameObjects. To avoid any typos or user error, the scenes will display on editor thanks to a custom inspector made for the component which will loop through the scene list and list all scenes by name in a dropdown so there’s zero errors by virtue of typing the scene’s name manually. This way it would be more comfortable for designers to load scenes, and it can be easily integrated within the boundaries of having an empty scene where many other scenes an be loaded, we just add other SceneSelector objects.

This is how I deal with scene management on my games, and I think it makes it easier to deal with scene management without much hassle.

This is now the official thread for the Scene Loading System (card on roadmap)

Please start with simple implementations that generally stick to what the card on the roadmap is saying. There will be time to expand the functionality.

Also, I don’t know if you noticed by the there is already an implementation of this in the repo, on a different branch (https://github.com/UnityTechnologies/open-project-1/tree/Scene-Loading). Did you take a look at it?

1 Like

Yup, I noticed it shortly after writing this post. I’ll take a look and see where I can help. Thanks! :wink:

@CharlExMachina do you need help with that? I was gonna volunteer for it, but since you already have something done, we can work with that, I think

1 Like

Hey! Sorry for the late response. Of course, feel free to contribuite. I just submitted a pull request to the Scene-Loading branch in GitHub, so feel free to check out the code!

1 Like

Always post a link please. Added custom inspector for GameScene ScriptableObjects by CharlExMachina · Pull Request #31 · UnityTechnologies/open-project-1 · GitHub

Looking at it initially, I dislike this approach a lot but who knows, maybe I don’t know something.

  1. How do you find references to a ScriptableObject event?
  2. Can you modify respond to an event (adding/removing listeners) without modifying a scene?

I think level SO needs to contain list of SO events that would be triggered on enter/exit

Still doesn’t answer my questions, doesn’t scale well (what if you have 50 levels?) and doesn’t cover all other events that don’t run on enter/exit. I dislike SO events in general, tried them in my project and they were terrible. I would only use them if I had 9 designers and 1 programmer in a team.

With other approaches you can quickly see all references/listeners/raisers.

In this example wrappers can be made to let designers use them in editor (for ex. ButtonLoadMenu) and they give more context than very generic “GameEvent”.

Can you give better example on how you used them?

Very similar to how current Scene Loading is implemented and how it’s described on

I remember creating custom editor drawers to be able to see at least current scene references but it still wasn’t enough. It’s a mess in mid-bigger projects.

Hmm, I feel like it’s not completely the right way of using ScriptableObjects. I would call this “overmodularity” :slight_smile:
SO events and data sharing is increadibly powerful, but we need to handle it smartly, yet simply

Enemies health-bars example is an interesting one, I’ll take a sit tomorrow at rethinking these approaches

can we do this on discord or something

there is already a thread for discussing this and the Unity officials are also discussing this.

Hi everyone :slight_smile:

I wanted to work on this functionality, but observing the PR mentioned in this thread, it seems it has been merged already. Is there anything left to implement that I could work on here? If not, I suggest updating the card on Codecks, as I came through there.

The scene loading system in the main branch seems not to work. I played the main menu scene and pressed the start button, nothing came on screen but no cameras rendering. When I checked, the button was bind to disable the menuelements gameobject and a scripts function. But the next screening wasn’t loading up.

Hey, the reason why it is not working is because you are starting from the Main Menu scene. Did you try to enter play mode from the Scene called ‘‘ScenesLoader’’ ? This scene will take care of loading the Main Menu scene and if you press play, you should be able to start the game.
I can also add the possibility to start the game from any scene that way we can test the different scenes quicker and easier in the future. I will add the script to do so very soon :slight_smile:

I have made few updates and pushed them to the main branch in the Git repository. Now it is possible to start from any scene :slight_smile:

3 Likes

Where should be talk about Scene related things, here or anywhere else. Because this thread is too old.