Jump to content

Help with loading game scene using Sectr Streamer


Roman
Go to solution Solved by Peter,

Recommended Posts

I'm trying to create a save/load system, so far I got everything working, except for loading specific sectors of the main scene

For reference:

-Main menu scene, which also includes loading into the main scene. They're not 'additively' loaded, the main menu is gone once the main scene is in.

-Main Scene: The main scene contains the main player, hud, gameplay manager, and contains all sectors. The main camera has these sectr components, when the scene starts, it loads the first sector chunk.

image.png.3889abe36889b738d12744a327face7c.png

 

The Sectr Member component is portal determined with no assigned "force start sector" setup. Even without that set up, the game does load the 'first' sector (I'm guessing because it's the camera's position seems to be within the first sector's bounds?)

For reference, the game plays akin to resident evil 2 in terms of interconnected rooms, and special safe rooms where the player can save their game. Ideally, I could save what the current sector is when the player saves game (for checkpoints or force quitting), but I'm willing to just use an array of sectors that are the safe rooms and simply pick from those.

So, without a defined "force start sector" the first sector loads with no problem, but the issue is that if the player saves game on a different room farther away, when the scene loads, it will still load the 'first' sector while the player loads into an empty area. So when the player is exploring the empty terrain making way to the starting area, crossing other sector portals in the way don't seem to alter the neighbors and it's like the game still thinks the player is in the starting area, it's not until the player reaches the start and crosses the first portal that the neighboring sectors will begin to load.

I want to preface that I can't use region loader because there are caves under the terrain, or some buildings have multiple stories, I've been designing my game world to be gateway oriented with 1 neighbor loaded in all directions, so complex scenes full of lights could cause my game to struggle just keeping up, however, not everything loads by opening doors, some open areas are tight corridors or U shaped narrow passages. Again, I designed my whole game world with portals in mind.

It's a good note to say I'm using EasySave3 if that helps.

 

 

So I had a script for testing purposes where I would try to assign the "force start" sector to the member that's attached to the main camera, but even by setting the force start sector in Awake(), the game would still load the first sector and not the one that would be assigned... so I'm assuming there's more to it than just that.

 

I just need to wrap my head around the concept of using portals and neighbor loaders.

 

So I'm wondering, is there a way to load a specific chunk and have its neighbors load too at the start of the scene without messing up the portals? Or is my mainMenu/mainScene relation incorrect?

 

Link to comment
Share on other sites

  • Solution

Hi @Roman, first off thanks for the detailed issue description, this helps us a lot in understanding what the issue is and what you are trying to achieve, much appreciated! 

Regarding the issue: From your description, I assume the player / camera that has the neighbor loader component on it is saved as part of the scene, and then when the save state is loaded, it puts the player / camera into the right spot in the scene?
If this is the case, I assume the following is happening:
On the first frame of the scene, all the sectr components (Sectr Member / Neighbor Loader) get initialized - at this point it already figures out it needs to load the first room that the Neighbor Loader is in right now.
Later / In Parallel Easy Load is being run and loads the saved game state from disk and the player is put into the correct position. While this is happening the first room is already loaded, or still in the process of loading.
The player ends up in an empty area, while the other "original" room is loaded in.


I tried to experiment with the Neighbor Loading demo scene to reproduce the case, and if the above is the issue, the following should work:

Keep the Sectr Member and Neighbor Loading component deactivated by default on your player. When the scene starts, nothing should be loaded in now. In your game, wait until you restored the save state from easy load, move the player in the correct spot, THEN activate the Sectr Member and Neighbor Loader component on the player.
When I try to simulate this in the Neighbor Loader demo scene, I have the correct room loaded in when I activate those components.

Link to comment
Share on other sites

Thanks! That actually works! I think I had to make a few adjustments to the camera (trying to make sure it's not within any sector's bounds). My script already had a delay timer before giving control to the player, so I included the enabling of those sector components on that delay just to really make sure the camera is within bounds before enabling said components.

I appreciate the help!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...