SEVERE PROBLEM WITH TIMEOUTS! WARNING!

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    Wow, I am making a game, there is no money involved but it is for a contest. 1 week from the contest and almost 4,000 lines of code into it the game developes the problem of random crashes. Were it that the crashes were when a certain line of code executed it would have been easy to find, however after what seemed like YEARS I have isolated the problem by commenting out 1 line at a time. THIS WAS FREAKING DIFFICULT SINCE SOMETIMES IT TOOK THE GAME MORE THAN FIVE MINUTES TO CRASH > I SPEND 4 DAYS DOING THIS SO YOU DON'T HAVE TO! READ THIS!

    The problem it seems is that 1 out of every 200 time a timeout is forgotten before the end of its handler has been reached it can cause the program to crash. 1 out of 200 times! This is a severe problem because it is so hard to find, and the way to fix it is to make sure that you have no code after the timeout("DAMN BUG").forget() line in the timeout's handler. THIS MAY NOT SEEM LIKE A PROBLEM IF YOU TEST IT BUT BELIEVE ME! EVENTUALLY IT WILL CRASH THE PROGRAM!



    Will Hogben webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Problem Report: Severe memory leak in Flash Player 9.0
      Summary Flash player 9.0 is prone to a severe memory leak when playing SWF files produced by Captivate 1 containing full-motion recordings. ...
    2. A DotNet Severe Limitation ?
      I believe I have found a severe limitation of DotNet, with respect to hosting Windows Form Controls in WebPages. It appears this is only possible...
    3. Severe Frustration!!!
      OK, Please excuse the slightly angered tone of this post but I'm in serious trouble and overwhelmed by frustration. I work for a company...
    4. Uploading problem = weird warning (was: access denied problem.....)
      Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the...
    5. severe instability issues in MX
      I was wondering if I couldn't get a little help with getting MX working. I seem to have run into some serious issues (basically I can crash DW MX...
  3. #2

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    I've seen this problem before as well. I stopped using timeouts because of
    this -- it crashed multiple
    apps I wrote until I stopped using them altogether. They can also screw up
    the framerate of a movie
    as well. There are a couple other weird bugs with them I couldn't even
    really quantify but they
    are defnitely broken.
    -scott

    "Will Hogben" <webforumsuser@macromedia.com> wrote in message
    news:bnk6f1$f7d$1@forums.macromedia.com...
    > Wow, I am making a game, there is no money involved but it is for a
    contest. 1 week from the contest and almost 4,000 lines of code into it the
    game developes the problem of random crashes. Were it that the crashes were
    when a certain line of code executed it would have been easy to find,
    however after what seemed like YEARS I have isolated the problem by
    commenting out 1 line at a time. THIS WAS FREAKING DIFFICULT SINCE
    SOMETIMES IT TOOK THE GAME MORE THAN FIVE MINUTES TO CRASH > I SPEND 4 DAYS
    DOING THIS SO YOU DON'T HAVE TO! READ THIS!
    >
    > The problem it seems is that 1 out of every 200 time a timeout is
    forgotten before the end of its handler has been reached it can cause the
    program to crash. 1 out of 200 times! This is a severe problem because it
    is so hard to find, and the way to fix it is to make sure that you have no
    code after the timeout("DAMN BUG").forget() line in the timeout's handler.
    THIS MAY NOT SEEM LIKE A PROBLEM IF YOU TEST IT BUT BELIEVE ME! EVENTUALLY
    IT WILL CRASH THE PROGRAM!
    >
    >

    Scott Southworth Guest

  4. #3

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    so what do you use instead?




    Will Hogben webforumsuser@macromedia.com Guest

  5. #4

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    You can create your own timer objects using the milliseconds. I would
    venture to say that you could probably duplicate most of the functions in
    the timeout objects. Once the parent script is done and debugged it's the
    kind of thing you should put into an external cast and into your xtras
    folder so its accessible at all times.

    --
    Craig Wollman
    Word of Mouth Productions
    phone 212 724 8302
    fax 212 724 8151
    [url]www.wordofmouthpros.com[/url]


    "Will Hogben" <webforumsuser@macromedia.com> wrote in message
    news:bnmj9b$j7f$1@forums.macromedia.com...
    > so what do you use instead?
    >
    >
    >

    Word of Mouth Productions Guest

  6. #5

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    I don't have enough time before my project is due, could you give your timeout script in return for some graphics work? I am good @ 3D modelling and animating, + texturing.


    Will Hogben webforumsuser@macromedia.com Guest

  7. #6

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    I never said I have done it. I haven't used timeout objects as extensively
    as you and haven't run into the bug. I still use them. But when I need a
    timer with limited functionality I do create my own.


    --
    Craig Wollman
    Word of Mouth Productions
    phone 212 724 8302
    fax 212 724 8151
    [url]www.wordofmouthpros.com[/url]


    "Will Hogben" <webforumsuser@macromedia.com> wrote in message
    news:bnn099$aev$1@forums.macromedia.com...
    > I don't have enough time before my project is due, could you give your
    timeout script in return for some graphics work? I am good @ 3D modelling
    and animating, + texturing.
    >
    >

    Word of Mouth Productions Guest

  8. #7

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    "Word of Mouth Productions" <lingoboy@spamershaveforcedmetofakethisname.com>
    wrote in message news:bnnbbc$qt3$1@forums.macromedia.com...
    > I never said I have done it. I haven't used timeout objects as
    extensively
    > as you and haven't run into the bug. I still use them. But when I need a
    > timer with limited functionality I do create my own.
    All you need is something like this in your frame script:

    property pTimeOutList

    on enterFrame me
    now = the milliseconds
    repeat with i = count(pTimeoutList) down to 1
    if( pTimeoutList[i][#timeout] >= now ) then
    do pTimeoutList[i][#callback]
    pTimeoutList.deleteAt( i )
    end if
    end repeat
    end

    on addTimeout me, howLong, callback
    pTimoutList.add( [ #timeout: the milliseconds + howLong, #callback:
    callback ] )
    end

    Note that this technique won't work very well if the frame rate of the movie
    is very low and you are trying to time something not related to the display
    (i.e., background sounds or something).

    Also, to add a timeout, do:

    sendSprite( -5, 1000, "callbackfunction()" )

    This will call callbackfunction() after one second.

    - Robert


    Robert Tweed Guest

  9. #8

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    That's a pretty basic timer. I was sort of assuming you'd want a
    duplication of all of the functionality of a timeout object. But if you
    just need a basic list of timers that make a call when timed out, then
    Robert's is fine.

    I tend to like to be able to have the option of starting and stopping my
    timers without their reseting, and be able to accumulate the running time.
    I also like to be able to trigger different events during the life of a
    timer and in the past have sent a list of times into my custome timers with
    a list of "callbacks" so I don't have to instantiate a bunch of timers.
    This also allows me to encapsulate functionality and organize calls however
    I want. I also like to be able to retrieve the current time of a timer,
    it's status, etc.

    As Robert pointed out, the disadvantage of doing this purely in Lingo is
    that the variability of the current time of a timer that occurs when frame
    rates are at a normal rate (1 to 30) may not be acceptable. The
    milliseconds will be accurate enough but your trigger could be off by as
    much as a second or more if your frame rate is low and there is a lot of
    overhead in your frame (s).

    --
    Craig Wollman
    Word of Mouth Productions
    phone 212 724 8302
    fax 212 724 8151
    [url]www.wordofmouthpros.com[/url]


    "Robert Tweed" <robertNOSPAM@killingmoon.com> wrote in message
    news:bnngp4$3tu$1@forums.macromedia.com...
    > "Word of Mouth Productions"
    <lingoboy@spamershaveforcedmetofakethisname.com>
    > wrote in message news:bnnbbc$qt3$1@forums.macromedia.com...
    > > I never said I have done it. I haven't used timeout objects as
    > extensively
    > > as you and haven't run into the bug. I still use them. But when I need
    a
    > > timer with limited functionality I do create my own.
    >
    > All you need is something like this in your frame script:
    >
    > property pTimeOutList
    >
    > on enterFrame me
    > now = the milliseconds
    > repeat with i = count(pTimeoutList) down to 1
    > if( pTimeoutList[i][#timeout] >= now ) then
    > do pTimeoutList[i][#callback]
    > pTimeoutList.deleteAt( i )
    > end if
    > end repeat
    > end
    >
    > on addTimeout me, howLong, callback
    > pTimoutList.add( [ #timeout: the milliseconds + howLong, #callback:
    > callback ] )
    > end
    >
    > Note that this technique won't work very well if the frame rate of the
    movie
    > is very low and you are trying to time something not related to the
    display
    > (i.e., background sounds or something).
    >
    > Also, to add a timeout, do:
    >
    > sendSprite( -5, 1000, "callbackfunction()" )
    >
    > This will call callbackfunction() after one second.
    >
    > - Robert
    >
    >

    Word of Mouth Productions Guest

  10. #9

    Default Re: SEVERE PROBLEM WITH TIMEOUTS! WARNING!

    Actually I found another way, in ym game there were LOADS of timeouts in parent scripts, now I have just one call a universal update fuction which goes through every parent script in the update_me_please list and calls its update command. Wiht just one the likely of a crash is really really low.


    Will Hogben webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139