Jump to content


How rock-solid is TweenMax's timing?

Recommended Posts

I'm working on a multiplayer flash game which requires pretty much dead-on synchronization across the clients. Since TweenMax is based on seconds, not frames, I figure I'll use it in order to ensure that the tweens for every client complete at the right time, no matter what framerate they are running the game at. But, my question is this: if I have, say, 10 tweens going on at once, how solid is their timing? Like, if I tell one to complete in 1.5 seconds, another in 0.5 seconds and so on, how accurate is that? Is there some percent error that is known?

Link to comment
Share on other sites

TweenLite and TweenMax are two of the only synchronized engines that I know of (there's one other), so if you start 10,000 tweens on one frame, they'll all stay synchronized and finish on the same frame (most other engines use timing that can slip as the CPU load increases, making the tweens end at different times even if they're created inside the same loop/frame). However, updates happen based on the frame rate of the swf so there's never a guarantee that things will take EXACTLY the time you set because let's say the tween is supposed to end at 1.5 seconds and at 1.4 seconds you have some other code that takes an immense amount of CPU power so the next ENTER_FRAME event doesn't get dispatched until the 1.8 second mark - the tween would end at that point. It is absolutely impossible for any engine to guarantee code will run at a certain time regardless of any load on the CPU. But rest assured that TweenLite/Max tweens will remain synced with each other and their timing is as solid as any engine out there.

Link to comment
Share on other sites

hi, just some of my experience in multiplayer flash games. (I'm doing it for my uni project, so i'm not any pro/expert by all means)

I've tested with 25 characters tweening round the screen firing at each other and tweenmax works perfectly and syncs perfectly (apart from the wobbly text i mentioned in other post :cry: )

However it doesn't really matter if tweenmax/lite is accurate or not, latency is the biggest problem.


I use electroserver and tested with latency simulation and 25 concurrent users, unless you are on LAN or <50ms ping otherwise it almost guarentee you need to do some latency smoothing and hiding, even then its not perfect. There are many different techniques as well.

TCP connection is slow...Basically its impossible to have dead on synchronisation across clients, since server does most of the work to predict their locations, and clients just do some animation to trick people.


Really missing tweenlite when I'm coding the server side in java, its so convenient!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.