Home im.ve Group im.ve Lab Projects Publications Teaching News, Events, Activities Contact us News

Functional Reactive Virtual Reality

The FRVR Yampa-Extensions

The Yampa FRP system is the current state of the art in Functional Reactive Programming systems. It is written in Haskell using the Arrow extensions to the language. FRP and Yampa in particular enable the creation of hybrid systems, composed of continuous time behaviors and reactive switching between behaviors. The Yampa system is powerful and can be used to create very interesting systems. However, Yampa is also mostly an academic exercise to date, though always tested with applications of relevance. Its usage for programming a "Space Invaders" style game and even a First Person Shooter, show its potential. Unfortunately, many aspects that are required of the FRVR system are simply not met.  These are functionalities identified in the investigation of  Dynamic, Interactive Virtual Environments (DIVEs).  Other issues are that several issue arrise with the simulation method, when the update rate is tied to the VR system. VR systems have significantly slower update rates than standard simulation timings and are often quite erratic.  FRVR, therefore, modifies and extends the functionalities of Yampa.

Although these are not the only functionalities incorporated, the most crucial of these are:


The most important change to Yampa, is a restructuring of the code basis. One reason was simply to organize the functionalities better,. The main reason was that Yampa was specifically designed to disallow user extensibility. Users could write all kinds of behaviors, as long as the basic functionalities provided were enough. The actual implementation details were hidden from the user. One of the goals of FRVR was extensibility, which suffers tremendously through this restriction. Following an example of the AFRPUtitilies already present, FRVR's Yampa version strikes a compromise by allowing the advanced user at the internals, but they have to import an extra module to do it. Using this interface, AFRPInternal, some of the more VR specific extensions are implemented in the FRVR module space instead of the Yampa space. Future users can extend Yampa, without having to recompile the entire source.

Time Resolution Fixes

Many simulations of continuous-based system are dependent on the time resolution of the simulation. If the simulation isn't sampled at a high enough frequency, the simulation becomes unstable. Even something as simple as a pendulum requires a 100Hz refresh rate. Since FRVR currently couples the simulation to the VR system frame rate, 30 Hz is doing well and 15Hz might well happen. To combat this, FRVR introduces a number of different functionalities that work at different levels and solve different aspects of the problem.


The undo functionality is a cornerstone of good interactive software. After all, mistakes are bound to happen. However, in the cases of interactive, dynamic environments, getting undo to work properly is a challenge. The environment is changing over time, and reacting to the input of the user. Such inputs could include not just button clicks, but the user's position over time (continuous time inputs).  If the system reacts over time to continuous time inputs, standard approaches are based on capturing the "events" that have occurred. Doing this with continuous interaction and with continuous reaction is not feasible.

However, Yampa's continuation-based stream implementation facilitates the implementation of an undo that works appropriate even in these hard situations. The only thing the programmer has to decide is when the saves should be triggered. The special undo SFs take care of the rest for the programmer. They just hand over the behaviors that should be "undoable" to the undoSF. Events trigger the save and undo actions.

Time Skewing

An often considered extension to systems that are to support dynamics in VR systems is "time skewing." Since the presented world is completely synthetic, there is no reason that the system has to follow the flow of time in the physical world. For instance, the often asked for "bullet time" for interaction with dynamics, can be done by skewing time, slowing it down. The special time skew SFs allow this to occur. Both a static version of the skewing and a dynamic version have been created. Any behaviors placed under them will be skewed by the factor given. The only restriction is a negative factor cannot be used. So time can not flow backwards in FRVR, but it can stop, i.e. the time skew factor = 0.  This has an interesting property of stopping the flow of time, but depending on the implementation still allowing interaction. After time starts flowing again the dynamic will take off from where the interaction left off, not where the dynamic left off.


The most experimental of the extensions to Yampa in FRVR are the transitions. These are special functionalities that are designed to help in the programming of the transitions between two behaviors. The transitions are inspired by the methods developed for the handing of the transitions between traditional keyframe animations. Transitions support blending over a given period of time of transition or waiting until a cyclic behavior (e.g. a walk cycle) comes to an appropriate transition point.

⇒ back to top                                                                                                                ⇒ back to FRVR webpage