Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by mcl-dev · Oct 28, 2020 at 10:54 AM · sizebuildingimporter

Why does my custom file format files get bigger in build?

Hello guys,

We're working on an animation viewer kind of app. Because we have to display 1000s of animations and load them at runtime, we have developed our own proprietary ultra compressed file format making each animation weight around 40KB. I wrote a custom importer for the files to use Unity's animation engine natively and everything works fine.
However after building the app and looking at the Editor.log I see that my animations now weigh upwards of 2MB.
As an example in editor.log :
1.2 mb 0.1% Assets/Resources/Anims/RO1_X0036.Mot6.mcla
This file weighs 66KB on my hard drive.

What creates this difference? Is it the importer that for some inexplicable reason rewrites all animation files?
How can I keep this very small file size?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · Oct 28, 2020 at 02:07 PM

I wrote a custom importer for the files to use Unity's animation engine natively and everything works fine.

Well, how does this importer work? Do you "import" that files at runtime? If not of course the files will be larger since you stored the result most likely as AnimationClip. Unity doesn't include any of the source files in a build unless it is a file in the streaming assets folder. All imported files (imported inside the editor) are stored in the resulting asset format. The Unity editor has countless of importers for various datatypes, the Unity engine has not. At runtime you can not import or load model or animation files. Even when it comes to images Unity only supports loading jpg and png.


So to me it's not really clear what happens here. Your file extension seems to be "mcla" which Unity does not import by default. So when you wrote an editor script / custom asset importer for that type, of course your importer will actually create an AnimationClip which is what is actually stored in the asset database and is what is actually shipped with your game.


If you want to ship your custom file with your game you have to load your animations in a runtime script and ship your file either as textasset inside your assetdatabase, or put it into the streaming assets folder and load it manually.


If you need further help you have to be more specific about your "importer".

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mcl-dev · Oct 28, 2020 at 03:55 PM

Thanks for the reply, that makes sense.
The importer script creates AnimationClips yeah so that's what the engine must be saving.

I'll have a look at streaming assets or find another solution thank you.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

136 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

App Builds are very large 2 Answers

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

How do I avoid reimporting assetBundles when upgrading unity? 0 Answers

Building with Extensions 0 Answers

IOS build with a smaller size 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges