hello,
couple questions about reducing my waiting time
-
i am making regular backups of my project. when i go restore from a previous backup of my project all my assets reimport. causing a long amount of waiting time. and tips to reduce this time?
-
when i go to build and run i find that unity rebuilds everything (all my assets) i can understand this if i have changed my assets however if i am just modifying a script is there a way to reduce my wait time?
Thanks for any assistance.
Neither of those is correct behavior. Restoring a project from a backup will not cause any reimport, as long as you backed up the entire project. Building a project will also not cause any reimport as long as you are not changing the platform. So if you are backing up 100% of the project and you’re not changing the platform, then you have something else going wrong.
–Eric
What is the proper way to back up a project then? just copy the folder? 'cause right now i am making a zip file of the entire project and when i unzip the project it reimports everything.
also for me on android. doing the following will rebuild then entire project including assets
- open scripta.cs
- hit space
- save scripta.cs
- build and run.
at this point i have to wait several minutes for it to recompile scripts, and rebuild the obb game assets file.
maybe if we could get a litle more info on how unity queues up an asset reimport and how the build system works we could work these issues ourselves. i had assumed it was timestamp based however i donno.
say unity’s builder makes a scripta.cs.compiled_cache and the timestamp is after the scripta.cs timestamp will doing a unix “touch” on scripta.cs force a recompile?
Doing that won’t cause everything to reimport; you have something else going on. Basically the only time everything should reimport is if you switch platforms in the build settings (or if you select Assets → Reimport All).
–Eric
eric,
while i appreciate the assist. contrary to what you are saying everytime i unzip a previously archived project all assets reimport.
while i am experiencing this on the same machine if i for example switch boxes…
same unity version, same zip file
unzip
all assets reimport.
any way to get around this?
Ok. i guess since something that is happening to me is not happening to me i will move on with my life and accept that i am insane.
so i guess i am turning the discussion to my second question…
how to reduce build and run time?
right now if i do build and run 2 times in a row with no changes the same (or similar) amount of time is taken. to me if i build and run with no changes it should just run since everything is already built.
is this command improperly marked? should it really be “clean, build and then run”? or is it possible for me to reduce the “build” time on a second consecutive “build and run”?
1 Like
I didn’t say it’s not happening to you, I said that it’s not supposed to happen, so something is wrong. Because that’s not how Unity is intended to work (and not how I’ve ever seen it work, so unfortunately I can’t really give any advice as to what’s wrong).
–Eric
musikit, are you using Unity Asset Server and/or do you have metafiles enabled?
Also, are you running any editor scripts that use AssetPostprocessor?
I’ve noticed similar issues with reimporting zip-backed-up UAS projects when either of the above is a yes.
As for “reimporting” when you build, are you sure it’s actually reimporting, or is it just “checking for assets that need to be reimported” and then taking forever to build?
I just started a new project so right now my build and run times are under 2 minutes total.
on previous project it was closer to 10 minutes.
we do not use any assetpostprocessor. we do not use unity asset server. and no we do not have metafiles enabled.
will enabling metafiles speed up compile times?
as for build and run with my current (<50 meg project) running twice in a row generates the same time with following output
Compiling scripts
building level 0
building scene 0
building assets for scene 0
i can understand it checking if anything has changed, checking timestamps etc. however at least for me appears to do a complete rebuild of everything. on our large projects again times are approx 10 minutes each time. no data changing.
What you’re getting in your current project is exactly what you should be getting. There isn’t really a way to speed up compile times other than possibly converting some of your scripts to DLLs - though I’m not entirely sure that would even help. It looks to me though, like you’re no longer getting the issue of reimporting every time, so at least it’s as fast as it can be now.
I don’t think you can call starting a new project and having less assets to compile/update “no longer getting the issue” however since this obviously is correct functionality for unity… i do appreciate the assist.
not exactly a “bug” more like a suggestion however the suggestion forum was removed.
- allow assets “zip” file to be prebuilt and saved so it doesn’t need to be recreated every build and run.
I don’t understand why there can’t just be a checkbox for reimporting assets. If there are no changed files, a checkbox like this won’t cause any issues. Tired of waiting 30+ minutes for reimporting when it should not be necessary.
@musikit - does your zip/unzip change any of the timestamps on the file? If Unity sees that an asset is newer than the processed version in the Library folder, then the asset is re-imported. I wonder if when you unzip the timestamp changes.
1 Like
Hello Graham,
This must be the issue then. i am use jzip a free tool to create zip files. and i am guessing it either doesn’t store timestamp info, or stores it wrong, or when unzipping the file doesn’t restore the timestamp info.
i have moved on from this really and i just copy/paste the entire unity folder into a “backup” spot.
however there are 2 suggestions i guess hidden in this thread which i feel are almost required at this point.
- ability to create an assets file and have it be used across multiple copies of the game.
- example if you are on android you can not reuse a generated obb file. this should be changed so i can finalize my assets and run a “build obb file” and then just update my APK as needed.
- on large projects (approx 1.5GB and large) clicking build and run without modifying any game assets (scripts and plugin folder only) should not recreate the assets file.
it seems to me if i want this type of functionality i have to make my own build system for unity and then trick unity into thinking there are no resources or game assets so the generated game assets file contains no data.
so for example. you are working on the Battlefield 20 game. you fix a bug in achievement processing (aka script only). i have to either 1. build my own build system or 2. force my users to update the entire game. with game sizes of 50+gig (titanfall) i see that as pretty unrealistic for a minor code only change.
sidenote: i notified unity about it several weeks ago however the bug which stops me from posting from opera 12 is still there. i can not post replies from opera 12.
Segmenting your assets into different platforms and different groups is what asset bundles are for. I think if your game is approaching the size of Titanfall you really need to think about separating data that will be updated regularly from the game code and key asset data.
Hello Graham,
thanks for the reply. hidden deep in the text you are writting is… for example on android platform, if you want to be able to use the same obb file across different apks you are completely on your own and must use the asset bundles to build your own packages.
thanks for the notice…
what about the other suggestion of pressing “build and run” twice in a row and reducing generation time to something more managable?
Probably worth submitting that on the Feedback site.