[SOLVED] Error Loading Asset When Project Is Downloaded

Double clicking on the index file @yaustar.

PlayCanvas projects don’t run correctly when ran from disc. They have to be served from a web server unfortunately.

If you have python installed, you can use Simple Server otherwise you can try Portable XAMPP https://portableapps.com/apps/development/xampp

It works on my old games. Is there a way to run the web server via HTML? I have to host the game.

What do you mean? If you have to host the game, then upload the files to your web server host and it should be fine.

As in, something like so

function {
          RunServer() 
   } 

I’ll try what you said.

If you simply upload the files generated when you publish the project to a folder on your web server, all you then have to do is point your browser to that folder. The browser will see the index.html file and run the app.

FWIW, we do run from the local drive with and iPad by using a kiosk web app. We have also used so-called “document readers” on the iPad. With these you do the same thing as we do with the web server. We just put all of the files in one folder and point the app to either that folder or the index.html file in that folder. We are currently using this app on the iPad.

There may be similar apps for Windows or Linux based machines. But I haven’t checked.

@wturber I’m on mac. Is this on Mac App Store?

It is the app store for the iPad. I’m not a Mac oriented person, so I don’t know if there is another store for Macbooks etc. I just know this is the store you access from the iPad.

Oh! I just remembered. I’m pretty sure Microsoft Edge will run a Playcanvas project from the local drive. is Microsoft Edge available on the Mac?

If you are on Mac, python is already installed so you can use Simple Server

Yes, but the new Chromium version. Will that work?

@yaustar, I am mainly a Full Stack Python developer. I am aware of the possibility of using local testing server. However, I need to put this on another site using git clone [Koji if you remember].

Doesn’t Koji run the files from a web server? Koji uses Git under the hood but I expected all the files to be served from a web server.

It simply runs my index.html file.

Looks like Koji are doing something different in their publish pipeline as I’m having trouble trying to work out where files go and how their scripts modify existing sources. Koji does run the index.html but not in the same why as double clicking on it as you mentioned here:

You have to work with Koji to work out a way to get the exported project from PlayCanvas Editor to something that works in Koji. As I mentioned before, Koji is not really designed for this workflow and uses the more mainstream approach of NPM build systems.

I’ve been trying to get the Model Viewer example project working and failing. It can’t find the logo.png even though it looks like it is in the right place in the build folder and the cubemap doesn’t render which causes a crash.

Looks completely fine in the preview, just not the published version.

1 Like

This is the closest I’ve got working around/with the Webpack system and Koji. It’s not loading DDS files correctly from the looks of things :confused:

https://withkoji.com/~dfdsf7/webpack-model-viewer

1 Like

Let me link this project and send it to the Koji admin. Are you on Discord @yaustar? Then I could send the invite to the Koji server.

Hi all – Koji dev here. Just fixed the issue with deployed Koji apps loading DDS files, so your example works now, @yaustar. I’ll be curious to see if Koji & PlayCanvas workflows can be complementary either now or at some point in the future!

Thanks for fixing the DDS issue.

The PlayCanvas Editor and Koji platforms overlap in workflow somewhat which was why I was confused earlier in the thread.

The files that get created by Editor for the scenes, texture compression, models and fonts can only really be easily modified in the PlayCanvas Editor and not in Koji.

Using PlayCanvas in engine only makes more sense and would be similar to three.js that Koji have a scaffold for.

Thanks @Sean_Thielen. This has made stuff much easier.