Facepunch / sbox-issues

177 stars 12 forks source link

Compiled asset file cleanup #1402

Closed DoctorGurke closed 11 months ago

DoctorGurke commented 2 years ago

What can't you do? easily clean up all compiled files of a specific type in an addon (vtex_c, vmat_c, vmdl_c, etc)

How would you like it to work? Have it as an option somewhere in the asset browser for Asset Cleanup to delete all compiled files of the specified formats (list of checkboxes for the formats or something)

What have you tried? Manually going through directories and sorting by type and deleting the specific formats.

Additional context Alyx had an asset cleanup function that had a similar function which worked well due to the content/game directory distinction, but it should probably be reevaluated since the alyx one had many flaws.

DoctorGurke commented 2 years ago

bump

DoctorGurke commented 2 years ago

bump :(

garrynewman commented 2 years ago

Can you give me a bit more info on what you want to do here? Why are you deleting these files? Where did they come from? Do you want to delete all in a single folder, all in a specific addon? How did the one from alyx work?

DoctorGurke commented 2 years ago

There's a couple things that might need to be addressed here.

I'm personally not a fan of storing compiled binary files on a project's github repository if they can be easily built locally by the dev. On top of that, the asset system often time seems to recompile and ever so slightly change assets despite no actual changes in source files, which leads to cluttered commit logs and potential headaches when merging. I have found myself having to discard numerous "changes" of compiled files on MANY occasions in the past. This is especially cumbersome when working with artists or other people on a project who aren't familiar with how asset compilation works, which just ends up confusing some parties involved. Ideally an addon would compile all its assets upon enabling it, or rather making sure everything is compiled and checking that everything is in order, but the "recompile all" option has levitated this issues somewhat for our artists and collaborators I believe.

That said, the purpose of this issue is mainly orphaned compiled assets. BUT, orphans should absolutely not be automatically deleted when enabling an addon, which I believe is still the case at this moment. (excuse me for the lack of an issue for this specific thing) We have a very sizable asset repository, the main purpose of which is to provide our artists with assets so they can use them on projects. The exposed version of said assets comes in the form of a repository that only has compiled assets. This is to prevent our artists from having to clone up to 100GB of assets and potentially having to worry about breaking changes or random recompiles, as mentioned above.

I propose maybe a manual orphan deletion, similar to the "Recursively recompile all assets" option inside the asset browser.

sbox-dev_QgyUOx21XI

For context, we're talking about around 22k asset source files on our asset backend, if the asset browser dialogue is to be believed.

sbox-dev_Q7r725k5AR

DoctorGurke commented 2 years ago

Sorry, to get back to your initial questions, this should be on a per-addon basis, if my answer wasn't clear through my ramblings. I'm not sure how alyx did it exactly, but it had a dedicated cleanup tool/dialogue as far as I'm aware.

DoctorGurke commented 1 year ago

This recently came up again. Related to #2489, we don't keep compiled assets on git. When a source asset is moved or renamed on the repository, the untracked compiled files will be left behind as duplicates without source files. And since we lack any sort of Rename or Move functionality in the asset browser, there doesn't seem to be a way to do this any more elegantly at the moment. Perhaps there's a simpler way to maintain project cleanliness without relying on a script to delete all _c files locally. Considering the determinism issue with compiled assets and the constant recompiling it causes, it might be worth exploring alternative solutions. But right now, a super simple "delete all compiled assets" function for a project would help immensely.

xezno commented 1 year ago

Is this a common thing, are there lots of people experiencing this? It seems pretty unique to your setup

TheBoxTrot commented 1 year ago

Personally, i have the same issue with git and compiled assets. where the source file is moved or deleted the _c stays its a bit annoying

xezno commented 1 year ago

We should probably just be handling those properly rather than adding a button that deletes every _c file though

NotGaylien commented 3 months ago

Can we please get this re-looked at, its been a massive pain for me,

i feel like every few days im manually looking for compiled assets floating around in my project to delete them, its a bollock ache, i miss having a way to do it like was added to the old asset browser.

It also causes a ton of issues in team projects if someone creates an asset, and moves it to clean up the files.

others are still using local compiled versions of said models in the old location in places, it causes a big mess and confusion.