Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

EXE crashing

Discussion in 'Editor & General Support' started by boolfone, Dec 22, 2014.

  1. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
    I created an EXE of my bowling game using Unity.

    However, it crashed while running it:

    20141222_175842.jpg

    When I run it in Unity, the game does not seem to crash at this point.

    Any ideas how to figure out what is wrong here and fix it?

    Thanks.
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    Do you get any errors in the console while running the game in the editor?
     
  3. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,973
    Check the output_log. That should give some clues, if not the actual error causing the crash.
     
  4. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
    I checked the output_log, and I don't see anything very interesting towards the end.

    The last part of output_log reads:

    the name is TitleCard

    (Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)


    This sounds like simply a debugging line that I might have put in there.

    I don't see any smoking gun.
     
  5. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
    Yes, there are errors or warnings about missing scripts:

    missing-scripts.png

    However, these are not clearly the cause of the crash. Fixing them could be a time-consuming and non-trivial effort that ultimately does not solve the problem.
     
  6. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,973
    What leads you to be so sure that the missing scripts aren't causing the crash? That would be the very first thing I would fix..
     
  7. Dameon_

    Dameon_

    Joined:
    Apr 11, 2014
    Posts:
    542
    Sometimes fixing things takes time and effort; even if they're not supposed to be game breaking, they can be. Even warnings should be dealt with. If they're expected, they can still be disabled, but you should be aware of why they're occurring and what the implications are. You could have a loop becoming infinite because those scripts are not where they should be. Without seeing your code in its entirety, there's no knowing. Before you build, you should literally have the console free of warnings unless you are absolutely certain the warning won't trip you up. Yes, a warning is not an error, but it still often signifies something that can become an error at runtime, or at least a failure in logic.

    Fix the warnings you have showing up, and THEN ask for help IF the problems in your build continue to show. Preferably after you've done some diagnosis of your own. And come up with some relevant code you at least suspect could be the problem.

    To trace your runtime problem, throw in visual cues to let you know what's running, until you have an idea what script is causing your crash, and hopefully about where.
     
    Ony likes this.
  8. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    I think the only warning I let go by is the one about different line endings(where some are windows and some are UNIX/Mac style). This one I still don't leave, but I don't consider as urgent to fix if for some reason I find it. I usually don't get this anymore because I always overwrite the "default" scripts in Unity's folder so that I have it already with windows line endings and with the curly braces how I want them. The other one that can actually be ignored for a time is the one you are getting about never using a certain variable. Usually it happens to me because I know I'm going to need some variables in a script but I haven't coded that part yet. I would never leave it around though for too long because though it is a very small bit, it is still a waste of memory(unless the bytecode converter is smart enough to remove it).

    Really though, as said above, warnings tend to lean closer to errors than ignorable things. If your scripts try to access things that don't exist, Unity's engine typically catches it and doesn't always crash, but things aren't perfect. Worse, what doesn't crash your machine may crash another machine. And consider how Unity exports to all these different platforms. If you ever want to utilize that, you are going to have to make your code as error-free as possible just because different platforms do different things.
     
  9. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    So you want us to spend time helping you find your issue, but you won't spend time yourself..?

    Errors and warnings exist for a reason. There's only 106 of them (in that scene, at least), I can't see it taking more than an hour to fix them all.

    There are plenty of warnings I'll let slide (typically "assigned but never used") though a) it's a bad habit and b) if you want others to spend their time on it, you should do the same. ;)
     
    Vaupell, Ryiah and Ony like this.
  10. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
    I made an effort to fix those errors, and it was unsuccessful.

    Many errors are missing script errors that were present in the kit I used to develop the game:

    https://www.assetstore.unity3d.com/en/#!/content/19163

    I could not find a way to fix the missing script errors. I tried removing the script component and also deactivating it, but these things broke the game in other ways that I could not figure out.
     
  11. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    Removing a component where the script is missing shouldn't break anything any more than it's already broken. Nothing can use it because the component already isn't there. What kind of error did it give?

    It's a little dodgy that a paid package has that kind of issue. If you make a new Unity project, import the kit you paid for, and build that on its own, what happens then? Do you still get the same warnings and the same issue?



    In any case, your screenshot doesn't have the game running. When you hit the play button, what happens? Errors show as red icons in the console, do you get any of those? Does the Editor freeze? Or... what?

    There's a difference between "compile time" warnings/errors and "run time" errors. What you've shown us there is only the compile time stuff. Since the game builds, we know there aren't any compile time errors. (Warnings are different. They are things that aren't invalid and thus don't stop compilation, but which the compiler things might point to logic errors. It's best practice to either fix or suppress them, not because they are indicative of actual problems but because some of them might be, and they're not very useful for spotting those if the actual bad ones are buried under dozens or hundreds of benign ones.) However, so far we've got no idea whatsoever about run time errors, and they're where your problem will be.
     
    Ony likes this.
  12. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,973
    In 4.5 at least, which I'm using, you can't remove a component if the script is missing. You have to drag the missing script to the slot before Unity lets you remove the component.
     
  13. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    Actually, if you click the little icon at the top right of the component in the Inspector you can remove it from the menu. You just can't right-click its title to remove it for some reason.
     
    Ony likes this.
  14. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,973
    Oh awesome, thanks! Good to know.
     
    angrypenguin likes this.
  15. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
  16. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
    Interestingly, it doesn't crash when I select "Fastest" for Graphics Quality:

    fastest.png

    The other choices all cause the crash on my computer.
     
  17. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,973
    Have you removed the problem areas such as missing scripts, etc? I'm about 99.9999999% sure that's where a large part of the problem lies.
     
  18. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
    As I said before,

    "Many errors are missing script errors that were present in the kit I used to develop the game:

    https://www.assetstore.unity3d.com/en/#!/content/19163"

    I contacted the developer of the kit and asked him to fix the errors, but I have not heard back from him.