Forum rules - please read before posting.

In scene ActionLists may generate useless clutter - m_Name: (Clone)(Clone) repeated 930 618 times

Ehum, yes, me again, sorry! This is the last post (for today).

I'm pretty sure this is again something that no-one else has complaining, but it seems that in scene actionLists may generate a ridiculous amount clutter into the scene files.

For example one scene containing mainly 5-10 minutes of dialogue was about 12Mb in size (when asset serialization forced to text). After looking what made it so big, I noticed "(Clone)" being repeated  930 618 times, in that one scene! Every repetition was attached to a m_Name variable (about 3000 of which exist in the file). 

I guess that under the hood that comes from moving and replacing the actions a lot, though "(Clone)(Clone)".. is not visible anywhere. I also tested removing all "(Clone)"-strings with a text editor and running the scene in Unity. Seemed to work without issues! This changed shrunk to scene file size from 12Mb to 4.5Mb. 

All in all I'd estimate that the useless "(Clone)" in all our scenes has been wasting maybe 30 - 50Mb of bandwidth, which under iOS at least seems to become even bigger in the build. So, I'd say it can be significant, especially on mobile! 

I could probably do the texteditor-removal trick for all scenes, but maybe moving the ActionLists from scenes into assets does the trick also? Haven't tried that yet.


I'm not expecting @ChrisIceBox to fix this (serialization/cloning problem), but this is at least a heads up. It's probably also related to the issue of slowly loading scenes (with lots of in scene actionLists):

Comments

  • Thanks for the alert.  I may well be able to do something about it - I'd encountered the Clone repeating before, but never to that extend and didn't percieve it as having an impact on performance.  A backwards-fix may be too hacky (can't say at the moment), but it may be that ActionLists made after the fact can be improved.
  • @ilmari: I also noticed this but didn't realise the effect it had on the space
    moving the scene action into an asset isn't an option for me because I would need to generate new speech ids (being in the middle of voice recordings this would be really bad)
    I'd vote for a backward-fix when it can save so much space for ios apps.
    this would allow me to get under 100mb on ios, which makes it possible for app store customers to buy it without wifi.
    I just removed all (Clone) in a 28mb scene which takes long to load and is affecting the gameplay and it turned into an 11,9 mb file.
    I didn't test it if it breaks the scene though, as I have to do the recordings now.
  • Glad to hear @ChrisIceBox and @dude !

    Actually we also depend on those existing speech ids, so probably cant move so easily for ActionList assets, except for new content. I did (Clone)-search and replace for the remaining scenes, and saved really loads of space.. and improved scene loading time, I'm pretty sure :)

    A fix for future actionLists sounds great! For the old stuff...we'll textwrangler search and replace saved it for us at least without breaking anything AFAIK, so others would benefit by doing it manually. I'd suggest it, at least if they have backups/version control :)
  • @ilmari: thx, text wrangler it is then
    In that one scene I had 2,3 million (Clone) texts  :-)

    I will try it when I have completed the game with all vocal recordings and tests without errors on ios.
  • Being able to fix this for future ActionLists will be possible in the next update.

    As for existing ones, it's better to have an Editor script that goes through all ActionLists in your project and makes the correction in one go - as opposed to auto-checking each Action when viewed in the ActionList Editor or something.

    The issue is with the (internal) names of the Actions themselves, which are ScriptableObjects stored within a MonoBehaviour.  This could be done regardless of your project's Asset Serialization setting, but I'm unsure how to make it available.  Having a dedicated button somewhere may make things confusion, so I'm thinking either as a new page in the wiki, or having it done "behind the scenes" when gathering text in the Speech Manager.
  • I think a script in the wiki which does the heavy lifting is fine
    and a note in the next couple release notes and manual (optimisation)
  • I've decided to make it automatic in the "Gather Text" feature.
  • I tried it with 157a and it reduced the size pretty well.
    although I still found 2.6 million "(Clone)" Texts with TextWrangler for example on a sound action.
    I replaced all within TextWrangler and it looks like it works 

    having the names "" doesn't seem to have any negative effects.

  • edited June 2017
    Nice to see an official fix so soon. But as @dude pointed out, it seems the (Clone)-clutter is not limited to speech actions, but all (at least scene-based) actionLists. (EDIT: or so it seems. Havent looked much further since using textwrangler on all scenes)
  • That's true - but the "Gather text" feature searches and fixes all Actions - not just speech ones.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.