Jump to content
Search Community

bQvle

Members
  • Posts

    23
  • Joined

  • Last visited

About bQvle

  • Birthday 08/28/1986

Recent Profile Visitors

1,900 profile views

bQvle's Achievements

3

Reputation

  1. But I am actually toggeling useRAF aswell, if i didn't do that time would actually stop (not even run 1 fps) So the 1fps is setTimeout()-driven. Edit: I just did some testing. with TweenMax.ticker.useRAF(false); it runs 1 fps (1000ms) and with TweenMax.ticker.useRAF(true); it runs 0.33fps (3000ms)
  2. Hi again I've now switched the game to using TweenMax.ticker, and its still not perfect. (acceptable but not perfect) when minimized it actually only runs 1fps, I didnt notice that in the codepen, because I only only logged once pr. second Is there a way I can make it run more then one fps? Not that I can't live with it, but it still causes the 3d sound to take huge steps, and it throws my client interpolation a bit off for a short time. but atleast the code is getting excuted
  3. Hi Jack, Brilliant, that did the trick I didn't know that exsisted. Heres an updated version that shows the result, you can pop out the Developer tool and watch in console whats happening when minimizing etc. and that it indeed keeps ticking now! http://codepen.io/anon/pen/PqrjVg This happends on "Tab Blur" TweenMax.lagSmoothing(0); TweenMax.ticker.useRAF(false); And is reversed on "Tab Focus" TweenMax.lagSmoothing(500,32); TweenMax.ticker.useRAF(true); @blake, thumbs up for effort but I'm relieved that I can keep it uncomplicated now
  4. Ahh okay, sorry about that, I'm not that familiar with GSAP yet, I discovered it just a few days ago. but I'm trying to get up to speed fast. This would work as a solution, and I really appreciate all your help and time you've given me! But I'll leave it open a bit for now, I'm pretty "concervative" when it comes to things like this. (I'd rather "fix the core" then taking shortcuts" if you know what i mean). And in the end, keeping the ticker alive is the best/right solution. So i hope one of the devs will throw a comment on that matter.
  5. Then it would have to be something like this? deferred = setInterval(function() { var total = (now() - start) / 1000; var tl = TimelineMax.exportRoot(); //move the animations tl.totalTime(total); //do gamelogic and renderer gameloop(1); }, 1000); But that still wouldn't quiet work, because the "start" variable you set is for a single timeline, and doesn't really exsist in this snippet. Then you would need to know when every single animation was started and to calculate the totalTime for each of them. Lets see if it's possible to keep the Ticker alive. that would be alot less of a headach
  6. Hi blake, Thank you for the info, it was merely for the example, but it's great to know. That's sort of an solution, but my scenario makes it a bit more complex. The game will be running all sorts of animations, visual effects, missiles, planes, gui animations etc, with various attached functions. only some of them will be timelines. With you method I would have to convert everything into timeLineMax and use setInterval to set totalTime of every timeline (which would proberly ignore some onEvents?) it would have to step my gameloop aswell. It will be alot of work. and I dont feel this is a great solution in my case. but if just "TweenMax.ticker.useRAF(false);" actually worked in this codepen, That would be a great solution. http://codepen.io/anon/pen/PqrjVg Edit: I just tried starting it with TweenMax.ticker.useRAF(false);. And indeed it is working (animation is very choppy). But it still pauses on "tab blur". this would tell that its actually GSAP thats stopping the ticker when it's not visible?
  7. It works in Internet Explorer, but i suspect IE is ignoring RAF and forsing 60fps. My game also runs 60fps in IE, even though i have a 120hz monitor and should be running 120fps. Chrome and Firefox is the same result, time stops while tabbed. Lets try summon a Sensei
  8. I don't want animations to pause, thats what I'm trying to avoid. The cruscial point for me, is the integrity of time. I could however use your codepen to put together an example. I have stripped window fucus/blur, since that doesn't affect requestAnimationFrame. And changed it to toggle ticker.useRAF http://codepen.io/anon/pen/PqrjVg (edit: forgot to save, it should be working now) You will see that ActualTime and AnimationTime is instantly desynced when you minimize / change browser tab. Actually I suspect that it partially works, because you see that it changes back from (not using RAF at 10fps) to using RAF. Maybe it doesn't call the events(in this case onRepeat) while tabbed. but that would be a problem aswell. Edit2: the white ball doesn't move while tabbed. so maybe its toggling RAF that isn't working, and only the fps that gets toggled.
  9. Thanks, but when the windows is active, I want to use RequestAnimationFrame (for smoothness). I could then detect if the loop is running, and toggle useRAF, but that would require me to do the oposite detection when they return to enable "RAF" which might not be as easy. and the biggest "no no" is that I would still lose control over the delta-time. when I detect that the ticker is no longer running, i need to push it forward with the time elapsed since it stopped.
  10. Hi Again, I had a thread a couple days ago about using the GSAP Ticker for my game. You actually told me that it wasn't possible to manually step the ticker. but I'll share my concerns, and hear you out. The problem with "RequestAnimationFrame/Your-ticker" is that when you "blur/change browser tab/minimize" it isn't getting called anymore. the result of this is that all animations pauses. This might not be a problem for banners/website animations, or for that sake, singleplayer games. But in my case, it's a problem. I'm creating a browser MMO(serverside) top down wargame, and this is some of the conciquenses i face when the animationloop stops. 1. Animations freezes and no longer represents whats actually going on, serverside. 2. 3d sound positions freezes, because they are relative to the gameobjects current position. (gives you the feeling of a game crashing). 3. Ability cooldowns pauses. (getting desynced with the acutual cooldowns running serverside) 4. since theres always thrown new animations at the client, they stack up. (and if you are tabbed for 10 minutes and return, the amount of pending animations will crash the game or atleast make an inferno) The solution i had with my own gameloop, was that I timestamped every run, if it got more than 1000 ms old, i manually called my gameloop funtion with a delta of 1 (1000 ms). that made sure everything continued in the background, even while minimzing the browser/changing tab. Do you have any idea how I can overcome this? If not, take this as a feature request It would be cool with something like TweenLite.ticker.update(delta) that would manually tick with the supplied delta. og maybe build in an option like "keepAlive" that makes sure the Ticker never stops (even if requestAnimationFrame isn't called).
  11. Blake, I get it! +1 on the great support and examples! really helpful! Carl, Thanks, but I think I'm set for now, blake addressed both of my questions very well.
  12. Ah, thank you for the clerification and example! I misunderstod updateTo, I thought it was for manually stepping a tween/timeline. (Thats what you get for mixing questions) So updateTo will allow me to change the values in a ".to()", but it will only work on tweens/TweenMax and not timelines. (which answers my enitial question, except I'm using a timeline) About the tick's I think you misunderstood me to, i wasn't concerned about updating the values between ticks. But rather make sure that all the "tween ticks" happends before the "render tick" just to avoid visual jitter/tearing because with two "tickers/requestAnimationFrame" i have no idea what is called when. But if i use the TweenLite.ticker, and set priority to -1, hopefully all the tweens will update before the render tick. I assume that all Tweens and Timelines exsist in that ticker with priority 0.
  13. But if using updateTo, the smartest thing would be not starting the tween. and then call updateTo from somewhere in my gameloop before the renderer right? Yep, but you would think that the currently running timelines and tweens also exsist in that callback stack? and by adding my gameloop/animate with lower priority would make sure tweens happend before renderer.
  14. Yep I'm using PIXI, but what you say would require me to iterate through all my tweens/timelines and call the updateTo, correct? Currently my gameloop is just running on a requestAnimationFrame, so I don't see why i shouldn't just use the built in TweenMax/TweenLite ticker. (if someone could confirm that priority "-1" would put the callback at the end of the stack, to assure all the tweens have been processed before I do the renderer)
  15. Thanks Dipscom, Yes i could actually use that Ticker for my game.. hmm. //add listener that requests an event object parameter, binds scope to the current scope (this), and sets priority to 1 so that it is called before any other listeners that had a priority lower than 1... TweenLite.ticker.addEventListener("tick", myFunction, this, true, -1); Would priority -1 make sure that the tweens has already animated before "myFunction" is called?
×
×
  • Create New...