Game crashes using Scene Portal

Announcements, support questions, and discussion for Save System for Opsive Character Controllers.
Post Reply
Doomchecker
Posts: 5
Joined: Thu Jun 17, 2021 9:11 am

Game crashes using Scene Portal

Post by Doomchecker »

Hi there,

I'm new to the save system and just used it for the first time in a project.

In the project play-mode everything works fine but when I use the same scene portal in a built game, the game crushes while trying to switch scenes.

Maybe there is something I have missed?

Thanks for any ideas!
User avatar
Tony Li
Posts: 20849
Joined: Thu Jul 18, 2013 1:27 pm

Re: Game crashes using Scene Portal

Post by Tony Li »

Hi,

Thanks for using the save system!

Are all of the necessary scenes included in your project's build settings? This includes the scene you're switching to, as well as the loading screen scene assigned to the Save System's Standard Scene Transition Manager (if any).

Make sure the Save System GameObject is in the first scene that uses any save system functionality. It's typically best to put it in the first scene listed in build settings.

By "crash," do you mean that it hangs or that it ends the program?

Try making a Development Build. When you play the build, it will show errors onscreen.

Double check the Scripting Define Symbols (Edit > Project Settings > Player > Other Settings). Unity allows you to specify different Scripting Define Symbols for different build platforms.

You can also review the Player.log file. Jump to the bottom and scroll up to look for the cause of the crash.
Doomchecker
Posts: 5
Joined: Thu Jun 17, 2021 9:11 am

Re: Game crashes using Scene Portal

Post by Doomchecker »

The game ends while trying to switch scenes.

Thanks for your advice, I tried to figure out what happened with a dev.build.
The following error appears:

"WindowsPlayer(User) Could not allocate memory: System out of memory!

OK, I guess this is a problem with some other stuff I have in the scene and has nothing to do with the save system.

But just allow me to ask:
Is there a way maybe in the save system to do something against this?
I tried building in 64bit but then all of the graphics get kinda screwed up (everything gets kinda white) but the scene switch works fine then.

In any case, thanks a lot for helping out.
User avatar
Tony Li
Posts: 20849
Joined: Thu Jul 18, 2013 1:27 pm

Re: Game crashes using Scene Portal

Post by Tony Li »

Hi,

If the same scene portal works in the editor but not in a build, there may still be a save system-related issue. Maybe it's getting into some kind of infinite loop. Can you try playing in the editor from the very first scene in build settings? (Make sure to save everything first, just in case you have set up an infinite loop that hangs the editor.)
Doomchecker
Posts: 5
Joined: Thu Jun 17, 2021 9:11 am

Re: Game crashes using Scene Portal

Post by Doomchecker »

Hi,
in the Editor everything works fine. I can switch scenes with the portal.
I'm not 100% sure what you meant by playing in Editor with build settings? (sorry)
User avatar
Tony Li
Posts: 20849
Joined: Thu Jul 18, 2013 1:27 pm

Re: Game crashes using Scene Portal

Post by Tony Li »

Hi,

Open the Build Settings window (File > Build Settings). Open the first scene that's included in the window's Scenes In Build list. Play that scene in the editor. Keep playing until you get to the point where the build normally crashes.

For this test, it's important to play from the first scene in Scenes In Build. This most closely represents what happens in the build itself. Don't load a different scene in the editor and enter playmode from that different scene.
Doomchecker
Posts: 5
Joined: Thu Jun 17, 2021 9:11 am

Re: Game crashes using Scene Portal

Post by Doomchecker »

Hi,
When I open the build settings and hit play from the first scene(this is what you mean?) then I can use the portal and it works. The Build settings window is not doing anything, it's just there?
User avatar
Tony Li
Posts: 20849
Joined: Thu Jul 18, 2013 1:27 pm

Re: Game crashes using Scene Portal

Post by Tony Li »

Hi,

Correct; it's just there so you can see which scene is first in the list to play from that scene.

Does only one scene change cause the crash, or all scene changes?

Can you send a reproduction project to tony (at) pixelcrushers.com?
Doomchecker
Posts: 5
Joined: Thu Jun 17, 2021 9:11 am

Re: Game crashes using Scene Portal

Post by Doomchecker »

Hi Tony,

much appreciated but the project is about 20Gigs large and has lots of garbidge inside.

I have an automated terrain-spawner when I switch to the scene. Only when I enable it, the game crashes.
I will create a new project and test it in the coming weeks and come back to you!

Thanks.
User avatar
Tony Li
Posts: 20849
Joined: Thu Jul 18, 2013 1:27 pm

Re: Game crashes using Scene Portal

Post by Tony Li »

Hi,

Okay, good luck! If the issue refuses to budge, it's fine to send me a 20 GB project.
Post Reply