Package system duplicates scripts from dependencies

Describe the bug:

If you have a package called Foo, and it depends on a package called Bar, changing an asset in Bar will cause the packager to duplicate said script and include the duplicate in Foo. This results in the game having 2 scripts of the same name and purpose.

This is fine if Foo is actively using the modified asset from Bar, but that’s not the case. Simply including the Bar as a package dependency and not using any of its contents in Foo can cause this problem.

How do you cause this bug?

  • Create a template
  • Create a package from that template, and while doing so, drag any other package into the “Package Dependencies” section of the package creation dialog.
  • Modify an asset of the dependency, and update your new package

You should now have a duplicate script

Screenshots / video of bug:

You can see the note here that the inventory script will be duplicated, you can also see that I don’t actually use the inventory script in the package, it’s just a dependency.

Here is the resuslt:


One of those belongs to cMenu - Inventory, and one belongs to the Inventory apckage.

Which platform: PC / Stadia

Which input: Controller / keyboard + mouse

Your Crayta username: Cereal

Game seen in (including “Hub” or “Editor for XYZ”): Editor

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible): Every time

Time + date seen: September 28 2022

Version number (found in Help tab in Settings): 0.g3.9.128732

1 Like

A rather alarming side effect of this is that this inflates the load times of games.

Nothing is ever deleted in crayta. Every time the packager erroneously duplicates templates, scripts, assets, you’ve ruined your game’s loading time. You can go through the game and delete all the duplicates, but nothing you can do will remove that from the history of the game.

Hi @Cereal,

You say to drag any other package into the package dependencies. Can I check how you’re doing that? The video doesn’t seem to show the steps listed out, I think it may be for one of the other bugs you submitted.

I’ve looked for a way to drag a package in from the packages menu, but I’m not clear on how to do it.

Hi, sorry. That was an awful video.

This one’s better:

You can see that the example package has a dependency on the Inventory Package, but it’s not used anywhere in the package.
Changing anything in the inventory scripts shouldn’t add the changed file to the Example Package. Not unless I the modified asset actually in the package itself - like in a template or something.

@Cereal Cheers, I’ve entered a bug report for this now.

1 Like