Jump to content
Search Community

dnunes

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

dnunes's Achievements

0

Reputation

  1. . . Hey, Jack, since the code was already online (the guys sent the campaign online without telling me beforehand, he he =/) I worked around it disabling the autoRemoveChildren from TweenLite.as and doing the sorting/removing myself, reusing tweens everywhere I could. I ended making my code better, actually, but I don't have the old version with me right now. I'll give it a shot as soon as I can, anyway (probably tonight) and get back to you. . . Thank you for the effort and I am glad the report have maybe helped to improve the library.
  2. . . The problem is that even I don't know exactly when this happen. To check the bug I am opening a lot of instances of the applications in a "automatic pilot mode" and waiting. Sometimes it happens after some 4 or 5 minutes, sometimes it happens only half hour later =/ I checked the linked list logic and it seems to be ok. The thing is that there are so many tweens going on being created/removed that somehow it is not behaving as expected. The sample would be the whole application code and you would have to patiently wait for the problem to happen. This is probably the worst situation I've ever had to debug. . . I am right now trying to "reuse" an instance of TweenMax to make sure that for every player I am going to have only one instance of the class (I removed the "autoRemoveChildren" so that it will only be disabled rather than removed from the timeline at the end of the tween) for the lifetime of his presence on the game world (to avoid that many creations/destroys), but I am having a terribly hard time figuring out exaclty what to do. It goes like this: package { class player { private var tween:TweenMax; private var tweenedObject:Object = new Object(); public function player():void { this.tween = new TweenMax(this.tweenedObject, 1000, { 'ease': Linear.easeNone, 'onUpdate': this.moving, 'onComplete': this.stopped }); } //callback. the server calls it when another player moves. public function playerHasMoved(newPosition:Object):void { this.tween.setDestination('x', newPosition.x, true); this.tween.setDestination('y', newPosition.y, true); this.tween.totalProgress = 0; this.tween.invalidate(); this.tween.restart(); this.tween.play(); } private function moving():void { //position checks and all the kinky stuff this.avatar.x = this.tweenedObject.x; this.avatar.y = this.tweenedObject.y; } } } . . The idea is to tween the "x" and "y" properties of the "tweenedObject" (this.tweenedObject). it is doing this way because there is a lot of game login involved in "moving", so in the "onupdate" (that calls the "moving" method) I update the player position based on the properties of this dumb object. . . The idea is to avoid the "remove" and "addChild" calls into the SimpleTimeline, but it is just not working (the "x" and "y" properties are returning "NaN"). Not sure if I am doing something terribly wrong. -------------- UPDATE: . . Now the idea of using only one tween is working. I just had to call the "invalidate" BEFORE the setDestination. I will keep trying to debug the other [monster] error.
  3. . . Ok, just found the reason. . . Debugging a little more into the code, it seems that the root of the problem is the tweens linked list. It seems that at some point, when removing a tween, it points the "next" of a tween to another instance that is "before" the "current", so it will loop through that range indefinitely (like, the "next" on the _6_ is pointing to the _2_, so it will go: "2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6" over and over again). . . The biggest of the problems: I have no clue whatsoever of what may be causing it, and it happens very randomly during the gameplay. Sometimes I'm just walking, sometimes I'm chatting, sometimes I'm in the middle of a multiplayer game... For now I'm probably switching to another tween library until I find a way to efficiently debug the code. . . Any tips? Keep in mind that it happens very randomly and right now the only debugging technique I can use is to write a *HUGE* log and then analyze the contents after the crash. I tried breakpoints, but since it happens with no pattern, I can only detect the moment after it happened and I'm not able to go back on time and check the values and what happened before.
  4. . . They are all updated. I replaced the whole "greensock" folder I had. SimpleTimeline.as have "Date: 1/15/2010" (you should really change to ISO dates, btw). . . Any chances of the tweens are not being removed, just stopped/paused and that's causing the problem? I'm tracing a lot of things to check it out right now, but any help would be great.
  5. . . Just checked and I was really using an older version. Anyway, the problem is still ocurring (even more frequently, as I added a little more tweens to the game). . . I'm using a lot of "TweenMax.killTweensOf()". Does this function remove the tween from the "main list" (iterated in the 77th line of core/SimpleTimeline.as) or it just "stops" it, setting it to disabled? Because if I'm only "stopping" an unnamed tween I will never be able to really "kill" (remove from the existing tweens master list) and they will just add to the point of hanging to Flash Player, right? Maybe this is the problem? How can I really remove the tween so it will act as never existed? I can change the code to save a reference and then use it, if needed, but I need to really clean the tweens out so that they won't keep adding to the pile.
  6. . . I think it's the lastest one: TweenMax 11.131 (12/18/2009). I downloaded again and the available for download seems to be the same. I replaced nonetheless and will recheck. . . Anyway, can you give any insights on that piece of code inside the "while"? What does that do? Debugging a little it seems to loop over every tween that exists every frame, right? Could that be that somehow dead tweens are still being ran (or tried to)? Sometimes I get way over 150 iterations on the loop, untill the point that my Flash Player cannot cope with the speed and hang completely. . . Got that part, but what about changing the property value? Imagine that I have an object and some property will be tweened from "1" to "50". If I do ".play", then ".reverse", then ".pause", then ".currentProgress = 0", will it be on "1" or "50"? . . Amplexos.
  7. . . I did a small isometric game and it uses TweenMax to all its easings (players moving, x/y-transitions, fades and even as timer/updater). . . I am mostly using direct calls to TweenMax.to calls when I just need to move something that don't need a lot of control and sometimes I'm creating the "new TweenMax" to use .play and .reverse (and onReverseComplete, most of the time). Everything works as expect (although I didn't quite get the logic when using the reverse()--does the totalProgress and currentTime change as well? They go backwards? a "currentTime = 0" when reversing will go to the original end or the beginning?). My biggest problem right now is that after some time using the game (players getting in and out, a lot of transitions and movements ocurring--but mostly only some 30 or 40 at at time) just hangs in an infinite loop inside "SimpleTimeline.as". I tried to debug it, but the biggest problem is that I couldn't spot a way to reproduce it non-randomly, so I'm clueless here. I'm tracing a lot of information but they are not helping a lot. . . Do you have any ideas of how can I debug the following error: Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds. at com.greensock.core::SimpleTimeline/renderTime()[D] at com.greensock::TweenLite$/updateAll()[D] . . The line 70 is a "while (tween)" (this loop goes "next = tween.nextNode;" and then "tween = next" at the end, so it's basically a "while (tween=tween.nextNode)". I couldn't really find a way to debug, since I don't understand the properties very deeply. Any help would be very appreciated. . . C'ya.
×
×
  • Create New...