truong-bui / AsyncLoadingScreen

Async Loading Screen is a free and open-source plugin for Unreal Engine. Async Loading Screen allows you to easily configure a Loading Screen System in the project settings, and automatically add a Loading Screen whenever you open a new level, without Level Streaming.
https://www.unrealengine.com/marketplace/en-US/product/async-loading-screen
MIT License
787 stars 99 forks source link

Server Startup Error - 'Couldn't find file for package' [Cosmetic] #24

Open Subressor opened 3 years ago

Subressor commented 3 years ago

After installing the Plugin (great work btw) and doing vanilla config, package and build check, there are errors on startup that reference 'MagicLeap' and 'OculusVR' content.

image

Not sure where these are referenced in the code. I expect this is because I package my project without editor content

infinstarlight commented 3 years ago

Are those plugins enabled in the project? They might be by default and removing them may solve the issue

truong-bui commented 3 years ago

Hi, this isn't related to Async Loading Screen, I think you should disable the 'MagicLeap' and 'OculusVR' plugin in Plugins settings

Subressor commented 3 years ago

Thank you for the reply @truong-bui

I have disabled the MagicLeap & Oculus Plugins and the last 2 errors have indeed gone. However, the first error still remains. This is the font that I used in the project settings ASync page for all font options available. Changing the font here also changes the error. Can you please advise? Disabling the ASync plugin removes the error.

I have tried adding the entire folder where I keep all of my fonts are included in the package (in packing settings). In-game, the font appears normally.

truong-bui commented 3 years ago

@Subressor Open Settings > Packaging > Packaging then add your font folder in Additional Aset Directories to Cook array image

Subressor commented 3 years ago

@truong-bui Hey,

Yes that is what I have already tried (similar experience with GAS)

image

However the error persists between builds. Is it possible that setting every font family (regardless if its used or not) could be causing this?

image

truong-bui commented 3 years ago

Try to build with default font to see if this issue still happens. I'll investigate this later.

Subressor commented 3 years ago

Thanks for your support :-)

I tried changing half back to the default (Roboto) and left half with the overlock font, and I now get both errors when running my packaged game

image

Let me try doing it with just Roboto and report back

image

Subressor commented 3 years ago

Yeap, same issue, just Roboto font erroring now

image

Build Settings for convenience: image Cooking by the book, only using levels that I need

truong-bui commented 3 years ago

@Subressor It's weird. Try to create an empty project with Async Loading Screen, and add your custom font, then build to see if you will be able to package the project. If yes, I think this is your project issue, not the plugin. Also, I have no problem packaging with custom fonts: image image

Subressor commented 3 years ago

Ah, I think I might have found it, apologies for missing out the detail: This error is only generated on the dedicated server. I double checked and don't get this error on the client from my side.

Tested in a blank project and getting these errors on basic server build. Can you see them from your side?

You can append the -log command argument when launching a server .exe to see the log output window, making it easier

truong-bui commented 3 years ago

Okay, glad that you found it. I think this issue isn't actually related to my plugin at all, so I'll close this, thanks.

Subressor commented 3 years ago

@truong-bui It is directly related to your plugin, because if I disable the plugin the error dissapears. I guess some code is needed to only make this relevant to be packaged/referenced on non-server builds?

When built, the plugin appears in the final packaged server bundle, including a content folder

truong-bui commented 3 years ago

I think you should disable this plugin for server build cause it doesn't suppose to use in server-side

Subressor commented 3 years ago

Thank you for your continued responses.

I don't think its possible to disable a plugin for server build unless it's in the C++ code of the plugin itself? I can see in your code you have dedicated sections and checks for if its playing on a dedicated server. Perhaps this could be reviewed? For example, in your Startup Module code:

image

And here also

image

truong-bui commented 3 years ago

This code just prevents MoviePlayer plays on the server, because the plugin doesn't suppose to be used on the server-side. You're better to set up a server build target. And add the plugin is DisablePlugin array in the server build target file, like in this answer suggests

Subressor commented 3 years ago

Hey, thank you for the reply and link!

I have updated my build server target as per your guidance using the links. Unfortunately there is a similar (but new) error: image

My Build Settings updated: image

It seems like the GameInstance spawned on the server is looking for the Plugin, which is now forcibly excluded from the build (which I guess is the root for why it's looking for the font).

Any guidance on the above?

truong-bui commented 3 years ago

You should use the IsServer node in the GameInstance to prevent the code runs on the server side.

Subressor commented 3 years ago

Yeah good shout. I tried that, still gave me an error. I moved the Stop Loading Screen Function out to a widget (which don't load on servers), still gave me an error on the server build.

image

It might be related to just that function (Stop Loading Screen). I am not calling it in my server code & it is protected by a 'Is Server'. It's just in the BPs for the clients to use, why is it erroring?

image

truong-bui commented 3 years ago

I think the best solution in your case is to disable this plugin completely in Plugins when you build for the server and enable it for the client. My networking knowledge is limited, so I couldn't help you more, sorry.

Subressor commented 3 years ago

Thanks for your reply's and support on this truong.

I've messed around with a lot more settings and I can't find any way to stop the errors appearing on the server. It doesn't affect the functionality from what I can see, but it is annoying and unclean for the builds going forward.

This doesn't seem to happen with other loading screen implementations, so I guess there may be a way somewhere (whilst still utilizing the ASync loading system) to prevent this from happening.

I would appreciate if you could keep the issue open, in case anyone else comes across this and knows of a way to fix or suppress this warning. I will change the title to reflect the actual issue.

To any future thread reader - ready and happy to implement any suggestions to fixing this, no matter how many years down the line it may be!

irajsb commented 1 year ago

When the issues like this arise best way to fix is to study other official plugins with similar functionality . For example WebMMedia plugin handles this with : "TargetDenyList": [ "Server" ] in WebMMedia.uplugin . IDK if its enough to prevent registering assets as missing though .