So I’m developing a PlayCanvas game for a company for use on their own server, and I’ve run into an interesting issue and I’m not sure what the cause could be.
I’ve exported a .zip build from the editor. First I uploaded it on itch.io (restricted project) in order to see that it works and it all works 100% as expected. The tech team gave me a local server I had to set up using NPM in order to see if the game would work in their ecosystem. The only issue is that the animations seem to be missing. Everything else works fine and the game is playable.
Since it works perfectly fine on itch I have no idea what could be wrong. It’s especially strange since it’s ONLY the animation files that are missing.
I’m under strict NDA, so unfortunately I cannot link the project, which I know makes things a lot more difficult to help troubleshoot. I am in talks with one of the technicians in the company, but I’m posting this here in case someone has some insights that will be super helpful.
That seems like an issue with your local server. What happens if you copy/paste one of those missing assets urls in your browser? If it fails to find the file most likely it’s either a missing file from your assets folder or the local server isn’t configured correctly.
It’s possible that your company’s server is not set up to serve .glb files? Are your .glb model files loading?
The models themselves load perfectly fine (and they’re glb as well), it’s only the animations, which is extremely weird.
What happens if you copy/paste one of those missing assets urls in your browser?
I actually have tried copy pasting the assets into the correct asset ID folder (since the other assets in their respective asset folders seems to have been unaltered), but that doesn’t work either . According to the logs, it seems to attach more characters to the end of the file name it’s trying to find (After the .glb there is an added ?t=..., which isn’t added to any of the other assets), so I don’t know if that’s an indication of anything.
I also used the Python method just now to create a simple http server, and I’m getting the same errors. This might indicate itch is doing some additional processing? The original GLB (converted from FBX within PlayCanvas) that housed the animation glb files is included in the assets. Maybe itch is successfully getting the animation files from that file that the local servers don’t know how to do?
Just to check, I uploaded that exact build (zipped version) onto itch and it works perfectly fine. I see that itch uses a static library (sorry if wrong term) of some sort, could that have an influence? Here is a screenshot of what I mean in the Sources section of DevTools:
That is what’s so strange. The animation glb files cannot be physically found in the build. The model glb file, which the animation files are associated with, is there, and even without the animation glb files itch is still able to get the animations successfully. I tried downloading the animation glb files from the PC editor and just putting them in their respective folders, but that doesn’t work as well.
Yes, all of this mess was caused by “|”, and knowing that it’s a design choice on Blender’s side makes me so damn frustrated…
Thank you so much for your help! I REALLY appreciate it!!
I’m STILL really confused how itch managed this. Do they do a find and replace internally to the code to prevent this issue? I don’t know, but worth investigating. I think for future improvements to PlayCanvas it would be nice when importing an fbx that the importer would find and replace all the illegal characters, or at least throw a warning. (don’t know how to add a ticket to GitHub for this, so if someone can do that for me it will be greatly appreciated )
For future peeps who could possibly get this issue, I’m just going to paste the error message here for searchability:
GET <FILE PATH> 404 (File not found) Error loading animation resource: <FILE> 
<FILE> and <FILE PATH> are being used here for redacting purposes.
Just a note for developers working with animators, it’s not best practice to just rename files in the project. Luckily I’m the developer AND the animator for this particular project, but working in bigger teams it can get very messy. The modelers and animators need to be able to give you their files in correct naming. If their files contain “illegal characters”, please let them know and have them re-export the files without them (just in case renaming messes a different system up), to avoid more issues down the line.