What's new? | Help | Directory | Sign in
Google
kairos
A framerate independant system build upon Pixlib
  
  
  
  
    
Search
for
Updated Mar 18, 2007 by cedric.nehemie
Labels: Featured
Home  
Homepage of Kairos Google Code Wiki

Overview

Kairos is an ancient Greek word meaning the "right or opportune moment". The ancient Greeks had two words for time, chronos and kairos. While the former refers to chronological or sequential time, the latter signifies "a time in between", a moment of undetermined period of time in which "something" special happens. What the special something is depends on who is using the word. While chronos is quantitative, kairos has a qualitative nature.

From the Wikipedia definition

We used to consider frame as an invariant unit, each frame is the same than the previous one, but in fact the Flash Player can't guarantee that all frames have the same duration, and that an swf may always run at the same speed. Kairos is inspire by real-time simulator design where computer side effects such freeze and lag have to be reduced to prevent the user experience and where engines are build on real world unit and real world equations.

Understanding time in Kairos

Kairos time management is quite different than how Flash usually work. The main difference is that all objects works on a second-based unit, result that the accuracy of some animation or callbacks, such as in MovieClipRT, IntervalRT or TimeoutRT classes, is lower than what the Flash Player offer. This approach fit well to game or simulators where perceived speed of the animations and synchronisation between events and animations is a big part of the gameplay.

Kairos Components

Kairos is based on Pixlib, so you will find all objects you commonly use such Beacon, Tweens and Command Managers. All thoses objects are declined in RT (real-time) versions. The main difference is that the RTBeacon pass a RTEvent with the onEnterFrame call, then objects use the data stored in the event to compute their animation.

But Kairos also provides new objects witch are designed to cover more aspects of animations and time in Flash.

MovieClipRT, AdvancedMovieClipRT and FrameControllerRT

MovieClipRT and the AdvancedMovieClipRT use the strategy pattern to perform all types of animation (loop and reverse). A play strategy simply says when an animation stop and witch frame is the next frame according to the elapsed time since the last routine call and the current object framerate.

IntervalRT and TimeoutRT

With a Beacon system, all objects have to run according to the orchestra conductor. If it stop, all objects stops. But when using interval and timeout at the same time than a Beacon its a real brain teaser to stop them correctly.

IntervalRT and TimeoutRT simply encapsulate those routine in beacon plugged objects. Now intervals or timeouts stops automatically when Beacon stops.

Demos

You can find a demonstration of Kairos functionnality here.

This demo show how you could obtain framerate independant animations using objects contained in Kairos.

Documentation

You can find the complete documentation of Kairos classes here :

Kairos Class Documentation

ChangeLog

Consult the revision history


Sign in to add a comment