Anyway to change build rules?

Lets say I have a project that includes 2 games with all the assets for each game.

When I build the project I want to be able to choose that assets from only one game gets included in the build but the assets from the other game do not get included. Is there any way to do this in Playcanvas?

If not, is there another approach for this as, I want to keep everything as a single project if possible.

Many Thanks

You could tag the assets and then when the build is done, you could process the zip file and strip those out?

What we do is that we have a master branch that has shared assets. And then each game is in its own branch, merging master into them. This way each game can have own assets without conflicting with other games.

1 Like

That sounds interesting but pretty complicated (to me at least). Especially when my team members (8!) each have their own branches as well, along with separate branches for some of the environment templates; I suspect things could get messy fast :slight_smile:

Also, we are already well into development and so re-organizing everything like that sounds like it would take a lot of work.

I think the zip file processing idea sounds like it could work well and might be the simplest approach for us at this timeā€¦

Cheers

Just keep in mind the conflicting script and other assets names, if they are all under the same branch. Not a big deal if you have only a few games, but will become an issue when the number of games grow.

Im just looking briefly at the structure of the zip. I can see that I could look at the projectID.JSON for all the entities that have a certain tag, and the resulting entity name looks something like:

JSON.entities.3a653bba-d99c-4f5e-bf74-df41809301da

Thatā€™s all fine, but then I can see anything in the files/assets where I could delete anything with this name.

I guess my next question is; how do I find the files/assets related to entities so I can delete them? Maybe Im looking at the wrong JSON file?

Cheers

Those are entities in the scene hierarchy. For assets you want to look into config.json.

ok I think I see it. So I need to check through all the

entities>tags and find the entities with tags I want to delete.

Then I search through just those entitiesā€¦

entities>components>render> ā€œassetā€

get this number for each asset ( eg: ā€œassetā€ : 127823327)

ā€¦and then delete all the folders in files/assets with those names.

Sound about right?

I tried to search through this manually and the first 2 assets I found dint actually have any corresponding folder in the files/asset directory of the build. Why would this be? Could they be marked as ā€˜exclude from buildā€™ in the editor but still show up in the JSON?