NPM Work-Around and Editor Extensions

Hello! I’ve been experimenting with PlayCanvas for a few days since my company has been considering switching our game to use a more web-focused engine. We’re developing an educational game that’s pretty data-driven with some simulation-style sandboxes. This drives our need for greater amounts of testability and to access the entire JS ecosystem, specifically React, Jest/Mocha/etc, and chart/graphing packages.

I’ve already integrated the engine with some NPM packages via webpack and that’s been very straight-forward. Unfortunately, this is outside of the editor and our team does need to use the editor for scene management. Since we can export our project data, I figured that I could write an importer so we can treat the editor like a scene manager and do all of our programming outside of the editor. Does anyone have any suggestions for this use case or reasons why an importer like this isn’t a good long-term solution? Ideally PlayCanvas could just support NPM via the editor but I know this isn’t currently supported or if it’s even on the roadmap.

Also, will there ever be plans made to extend the editor’s functionality with plugins? Ultimately this isn’t a huge concern for us, but we do have an internal, text-based content creation tool that would be better suited integrated into an editor someday.

Hi @Jameracho and welcome,

You can easily synchronize your local codebase with your Playcanvas editor with the following tool:

It’s quite handy for use with NPM, webpack/rollup, Typescript etc.

Your other idea to use the editor as a scene exporter can work too. You can use the Playcanvas rest API to easily export/download a build to use with your importer. In my experience this is a good compo, but the Playcanvas editor is powerful as well so I’d advice to not easily get away from it.

There isn’t an official API for plugin support in editor right now, though there is already an unofficial editor API and a solution that can help you write plugins today:

2 Likes

Yes, we are planning to do this officially in 2021 :slight_smile:

2 Likes

Awesome, thanks! I’ll take a look at that.