I have just completed my first project, and when I package it (windows 32bit) and run the built game, my audio cues no longer play. And my default level loads, but none of the buttons that load other maps work anymore. I’m stuck in default map with no sound.
Everything works perfectly if I play in the editor though. But packaged game and “Launch” from in the editor give me these problems.
Edit: maybe a little clarification. Everything that’s in the same folder as the default level seems to load. But the other levels and audio are in separate folders. Not subdirectories of level1, but still under “Content”. Maybe not everything is getting packed? I have “full rebuild” and “cook everything in the project content directory” checked, for what it’s worth.
I created a new FPS template, made a new folder named “levels” and added a new map into it. Bound a key event to the “Open Level” node to warp to this new level. On the first build, it seemed to recreate the problem, but upon rebuilding it worked again. Sadly rebuilding isn’t helping on my problem project. And attempting to recreate the issue a second time in another new project failed.
I have tried building for 64bit, and adjusted those settings like you suggested. No luck. But I’ve uploaded my zipped project if that helps. 281MB Project UE4.10 (WASD to move, click doors to load a level)
So I have attempted as much as I know how to get your projects sounds and levels to work properly. As you mentioned, which I have also tried, reproducing this in a blank project is not causing the same issue to occur.
I have noticed that you have a good bit of sub-folders within your Content folder directory. I attempted to do some rearranging of your levels and sounds, but when I packaged and launched the game it immediately crashed without any callstack.
Unfortunately I cannot enter a bug that is project specific, but I can keep trying a few different things like modifying your sounds audio compression and some more packaging settings. I will let you know if I find a resolution.
Update So I found some helpful information that you might be able to work with and get your project to package correctly. Your player controller blueprint has some compile warnings, which are connected to your Game instance. I got your sound to work correctly by checking the auto-activate options on your sounds placed in the levels. I am assuming you have them unchecked for a reason and you are activating them elsewhere.
A really helpful tool is to use the Project Launcher, and take a look at the log warnings. I am assuming the opening levels issue is directly related to the player controller warning message.
I’ve addressed those blueprint warnings, and it didn’t immediately solve anything. My sound is activated in the level blueprint through a Fade-In node, and the sound component is found by looping through all audio components and looking for a name. I switched that out with referencing the audio component directly, and that seemed to fix it. I switched back to the original method just to be sure, and that works now too. So I guess audio is working now?
Well it seems you are on the right path, so I will let you continue to troubleshoot on your own. If you get absolutely stuck and cannot figure out how to clear the log warnings I will continue to nudge you in the appropriate direction.
In my project, I load a level with a timer after my fade-out matinee plays. I find my matinee actor by looping through all matinee actors, and playing the one with the proper name. Problem is, TRUE is never returned in the packaged game (and thus my open level node never gets called). It works in the editor, however. Playing all matinees without checking for name, and referencing the matinee actor directly in the level blueprint both work in packaged games.
The sound issue is the same. I can’t find audio cues by checking names, but playing all or referencing the actor/resource directly works fine.
I have been able to reproduce this in a blank project, too.
Bypassing the display name method and referencing these assets directly allowed me to successfully package my game
I was able to test and confirm the issue on my end that the get display name function is not working as expected in a packaged build. To be honest, your game might run better if you called those matinees and sounds directly instead of running through a ForEachLoop every time the game begins.
You can even use the PlaySound at Location or PlaySound2D which doesn’t even require an audio component being placed in the level. Try out these suggestions and see if you can’t get your project to package and run correctly!