I am currently looking at using Playcanvas both professionally and For personal projects - and while I think the tool is going to be perfect for my personal projects - it won’t fit into my workflow at work.
So since the engine is open source - I was going to simply use the engine directly in some projects - however - I am a little unsure what the best way to architect this is. I would normally attempt to separate the model from the visual representation - but given playcanvas is an ECS style architecture it seems like fighting against the original intent.
Any thoughts? (I realize there is an excellent open source project for being able to code offline - but for various reasons that’s not suitable at this time).
If the ECS style is an issue, you could augment it. ie. Use the script components as the visual element and add your own system for the model that effective drives the PlayCanvas entities.
That’s an interesting thought. It’s not so much that I find the ECS concept problematic (on the contrary) - I’m just thinking of two issues. One is testability. The other is the scriptable components would appear to have to be loaded through the asset manager (I may be wrong on this) - which would imply many http requests to load components as opposed to say bundling with webpack.
I’m not sure yet, but I think I might start with an entity base class to represent all the assets in the world, and their state (the model). Then wrap the components - and have them bind themselves to the model on instantiation. And as you say, at least some of the components would be the view (meshes for example).
BTW - have you ever seen an attempt to use the editor for mesh placement only? I’m looking for an example of loading the assets from exported scene data.
I haven’t although I could imagine it wouldn’t be that hard to do.[quote=“ISOCain, post:3, topic:5475”]
The other is the scriptable components would appear to have to be loaded through the asset manager (I may be wrong on this) - which would imply many http requests to load components as opposed to say bundling with webpack.
On the publish process on PlayCanvas, all the individual scripts are bundled/built into one large .js file if that answers your question?