Search Unity

How can this be explained?

Discussion in 'Editor & General Support' started by galloper, Dec 5, 2019.

  1. galloper

    galloper

    Joined:
    Aug 5, 2017
    Posts:
    31
    You know, I've been a long time Unity user and it taught me to make backups on every major change to the project (which is SAD), however, what happened today is really a new level.
    You see, I had my Unity project open in the editor on a 24/7 running PC for a day +/- few hours.
    It was in play mode most of the time, because I was testing the server backend and the Unity project was, obviously, the client.
    At some point I saw some strange warnings in yellow, but the Unity project ran just fine and everything worked okay. And before you say anything, those warnings were something about "session failed" something, quite sure it had something to do with the Unity editor itself, which again brings us to the question of what was going on with it? Cause I certainly did NOT do anything to break my project. And consider that it did work in play mode right before I had to restart the editor, so from my end of things it was doing just fine.
    Then, as I said, I had to finally close the editor and reopen it. Instead of my project that I just closed there was nothing, moreover, all scripts like lost their references, when I open any script in VS, which worked fine before, I see it lost even the basic things - for example "using UnityEngine.UI" does nothing, all UI declarations are now shown as errors and so on. In the editor all objects lost everything on them, I mean ALL scripts on every object are gone and instead of those scripts have this same text: "The associated script can not be loaded. Please fix any compiler errors and assign a valid script". Yeah, right..
    And the console looks like this (see attachment).
    So what is this? Engine partly crashed? The proverbial PC reset did nothing. What are my options here?
    Unity version for this project is 2019.2.10f1 - chose it hoping it'll be stable enough, silly me.. :confused:
    Screenshot_14.png
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    Clear them and see if they repeat?

    You'll never find a release that is completely free of oddball error bugs. :p
     
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    There is an oddball error that's been reported on and off over the years when running a project for a long time. My suspicion is it has something to do with floating point precision on Time.time and Time.deltaTime.

    Unfortunately most people don't run their games this way, so its a hard error to detect and pin down.
     
    Joe-Censored likes this.
  5. galloper

    galloper

    Joined:
    Aug 5, 2017
    Posts:
    31
    I'm not asking for "support", this is more of "see my frustration" type of post.
    What good could those warnings get me if they were out of my control anyway? I tend to focus on my own tasks and hope that others did their work. They just said something like "session data failed" and led nowhere - internal Unity stuff, so I didn't memorize them.
    As for the Library folder - I did, it did nothing.
     
  6. galloper

    galloper

    Joined:
    Aug 5, 2017
    Posts:
    31
    Yes, I saw some similar forum posts from way back.
    Probably you are right, though I wonder why the project becomes so messed up after such errors happen? So messed up that it forgets some of the core elements of the engine, but not all of them, which makes this even weirder.
     
  7. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,145
    Ah, so "useless."
     
  8. galloper

    galloper

    Joined:
    Aug 5, 2017
    Posts:
    31
    "Useless" is trying to troll me with your empty words. Anyway, I solved the problem, so it is useful for people with similar problems (and it does seem there are quite a few of such people).
    The solution to the problem is a strange one, I mean rly - whaaaaat???
    This post helped me: https://answers.unity.com/questions/1680858/blank-console-error-on-empty-project-with-a-single.html
    And by the way I've already installed the last stable version (2019.2.15f1) just to test if it'll help - it did not, until I made the change that is described in the post above.
    All I did is going to the Unity Hub installs folder, unity version\Editor\Data\Tools\RoslynScripts\ opened unity_csc.bat and added ".exe" to the "csc" there. Not even the full path as the guy suggests.
    Then reopened my old project where everything was lost (and I even restored the Library folder that I didn't rly delete - I renamed the original folder to let Unity recreate it and now deleted the recreated one and restored the name to the original) - and bam it works as if nothing happened, even though something surely did.
     
    Last edited: Dec 5, 2019
  9. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,051
    Moving to the proper forum.

    1. Check all your logs. (editor, server, system, etc)
    2. If you are testing, as you said, write down (screenshot, etc) errors behaviors. (Testing and not remembering the error isn't really testing)
    3. Bugs exist. No one thinks they have write bugs, but they do. Check your code. Repeat and try to reproduce.
    4. Revert to a previous version. You are using version control, correct?
     
  10. galloper

    galloper

    Joined:
    Aug 5, 2017
    Posts:
    31
    Well thanks, though I chose General discussion hoping to get some discussion going... you see, I did fix my project already though I want to stress out that it had nothing to do with my own code since it worked fine in all cases, in short the Unity editor just broke down and it was probably due to the long run in play mode.

    Edit: and by the way, if you'd take a moment to glance through that Unity Answers post, you'd see the core of the problem - seems like it was the Unity Hub to blame?! Because I also did update it just a day ago, then the project ran for a while and then this happened.
    No offence, but I wish Unity employees could pay a bit more attention to such things...
     
    Last edited: Dec 5, 2019
  11. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    As far as just the first issue with losing connection after over a day, I had a similar problem with builds of my game keeping connections alive between different servers for days. I tracked it down as already mentioned to floating point precision issues with Time.time. Floats are accurate to between 6 and 8 decimal digits, depending on the specific value. At just under 27 hours Time.time will be 7 digits in front of the decimal point. This was causing havoc with any network timings which use Time.time, such as when to send keep alive messages, checking if I got a timely response to sending a reliable message, and checking for dropped connections after a certain period of time.

    I considered redesigning all the timing in my network API to use DateTime.Now.Ticks instead of Time.time, but I don't know what internal Unity systems also rely on Time.time which may also have issues, so I decided to just have my server cluster automatically shut itself down and restart every 24 hours on its own. So no connection can ever exceed 24 hours now anyway. Problem solved.
     
    Kiwasi likes this.
  12. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Bug reports are the way to get Unity staff attention. Especially if you can reproduce it on demand. Its a bit challenging to reproduce with a bug that only takes place after a day of running. But you should still submit one.

    The forums aren't really the place to grab the attention of unity staff. Its mostly just a hang out spot for a bunch of developers who use Unity.
     
    Joe-Censored likes this.
  13. galloper

    galloper

    Joined:
    Aug 5, 2017
    Posts:
    31
    I see your point, however in this case it was not even about the keeping alive thing - it was my suspicion, but it turned out that somehow, updating Unity Hub messed up some of the Unity engine routines. I linked the original solution to this problem and it worked for me too, like it worked for a bunch of people that wrote about it in the Unity Answers. I made a remark about staff paying attention based on that - it does look like a bug and it did manifest for a bunch of people. Somebody cared enough to move my post to support forum, yet, none really read it. I made this conclusion based on the answers and suggestions that I see here.
    I mean, just think about it for a second: all I said is that there's a problem which produces empty errors (and it was not in the play mode, the screenshot at the top is not in play mode). I thought it could be connected to the fact, that I ran my game before that for a long time. The whole engine broke down. Whole engine. Yet people told me to check my code and check my own errors. Like whaa..?? I said - the scripts ran fine and I have no errors in my code, the freaking engine went down, I'd use my fingers to explain it better, but we're on the internet. I wrote that compiler went crazy over basic things and decided that "using UnityEngine.UI;" is an error and so on. Yet, the good folk here told me I'm wrong. How should I react to such things?
    Luckily, I found that Unity Answers post that described my problem, but had a different angle to the solution. It seems that on that day, while Unity was still running on my PC, the Hub updated itself and the new version of it had a strange bug, which caused all that mess. I posted this information and the information about the fix.
    Yet, even after all that, I received suggestions that my code needs to be checked and "we all make errors", which kinda proves my point that nobody even reads what others post, before posting themselves.
    /sigh
    Anyway, the case is closed now. Fix worked, my old project is fine, zero errors in my own code, thnx Unity Hub for messing it up and adding to my stress. If anyone wants to post it as a bug - be my guest. I suggest adding info from here:
    https://answers.unity.com/questions/1680858/blank-console-error-on-empty-project-with-a-single.html
     
  14. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    But did you submit a bug report?

    Sounds like you have a really clear description of what's going on, and the steps required to both reproduce and fix the problem. That's something Unity would like to hear about.
     
  15. galloper

    galloper

    Joined:
    Aug 5, 2017
    Posts:
    31
    In fact I did, hope they'll look into this.
     
    Kiwasi likes this.