**3. PERGAMON: A Framework for Gamification, Real-Time Sensoring and Virtual Coaching**

The TIKI TAKO system for young T1D patients is an instantiation of the general PERGAMON framework. The PERGAMON framework allows the creation of behaviour change support systems [56] that combine serious gaming (a main game and mini games), virtual coaching and real-time monitoring of activities in daily life via sensors.

The architecture of the PERGAMON framework is a Service Architecture. The system is not a set of isolated applications communicating based on the integration of the different parts of the application. The framework is organized in a collection of services that can published on a communication infrastructure. These services can be used by multiple applications. The main services in the PERGAMON framework are; (1) Saving and sharing data from the sensor network (Glucometer data; Pedometer data; Insulin Pen data), (2) Saving and sharing user state (e.g., achieved goals, badges), (3) Analysis of the data coming from sensors (i.e., Pedometer, Glucometer, Insulin Pen) and (4) Virtual Coach services. The infrastructure enables the various "consumers" of data services to query and access the available information on heterogeneous information systems through the exchange of messages. In particular, for the sensor network a form of hardware abstraction is needed, which involves having a custom plugin for each device that will be supported. The architecture of the PERGAMON framework supports the implementation of real-time behavioral change techniques (see Section 2) such as real-time feedback and monitoring of behavior of users.

A typical system created with the PERGAMON framework consists of a web application (website), an Android application for gathering data from sensors, an Android webapp to view the PERGAMON website via an Android device and an Android Unity application for the games. The framework consists of five key components (Figure 1):


**Figure 1.** The PERGAMON architecture.

In the following subsections, we will discuss the different components in detail.
