All Projects → immersivecognition → Unity Experiment Framework

immersivecognition / Unity Experiment Framework

Licence: mit
UXF - Framework for creating human behaviour experiments in Unity

Projects that are alternatives of or similar to Unity Experiment Framework

Vrarmik
Unity Inverse Kinematics solution for arms in VR
Stars: ✭ 94 (+16.05%)
Mutual labels:  unity, vr, virtual-reality
Viveinpututility Unity
A toolkit that helps developing/prototyping VR apps.
Stars: ✭ 256 (+216.05%)
Mutual labels:  unity, vr, virtual-reality
Vivegrip
Physics-based grabbing for SteamVR development in Unity.
Stars: ✭ 159 (+96.3%)
Mutual labels:  unity, vr, virtual-reality
Vrtk
*Beta* - An example of how to use the Tilia packages to create great content with VRTK v4.
Stars: ✭ 3,422 (+4124.69%)
Mutual labels:  unity, vr, virtual-reality
Xrtk Core
The Official Mixed Reality Framework for Unity
Stars: ✭ 219 (+170.37%)
Mutual labels:  framework, unity, vr
Dungeontemplatelibrary
🌏: Dungeon free resources (terrain & roguelike generation)
Stars: ✭ 595 (+634.57%)
Mutual labels:  unity, vr, virtual-reality
Bepinex
Unity / XNA game patcher and plugin framework
Stars: ✭ 1,001 (+1135.8%)
Mutual labels:  framework, unity
Unity Core Project
Core Framework for Unity
Stars: ✭ 42 (-48.15%)
Mutual labels:  framework, unity
Openmod
OpenMod .NET Plugin Framework
Stars: ✭ 81 (+0%)
Mutual labels:  framework, unity
Mesh maker vr
Mesh Maker VR
Stars: ✭ 47 (-41.98%)
Mutual labels:  unity, vr
Arxiv Equations
🚀 Provides equations in latex format from arxiv paper.
Stars: ✭ 23 (-71.6%)
Mutual labels:  research, science
Psychopy
For running psychology and neuroscience experiments
Stars: ✭ 1,020 (+1159.26%)
Mutual labels:  science, experiment
Superframe
📦 A super collection of A-Frame components.
Stars: ✭ 1,061 (+1209.88%)
Mutual labels:  vr, virtual-reality
Worlds2
Building Virtual Reality Worlds using Three.js
Stars: ✭ 34 (-58.02%)
Mutual labels:  vr, virtual-reality
Unity Fragment
用于UGUI界面间的跳转 类似Android中的Fragment
Stars: ✭ 14 (-82.72%)
Mutual labels:  unity, vr
Inputsystem
An efficient and versatile input system for Unity.
Stars: ✭ 1,013 (+1150.62%)
Mutual labels:  unity, vr
Core
The core source repository for the Cherab project.
Stars: ✭ 26 (-67.9%)
Mutual labels:  framework, science
Latex Examples
Examples for the usage of LaTeX
Stars: ✭ 1,032 (+1174.07%)
Mutual labels:  research, science
Extosc
extOSC is a tool dedicated to simplify creation of applications in Unity with OSC protocol usage.
Stars: ✭ 69 (-14.81%)
Mutual labels:  framework, unity
Spatial Computing
Samples showing how to use Azure and AI services in Mixed Reality projects
Stars: ✭ 63 (-22.22%)
Mutual labels:  vr, virtual-reality

UXF - Unity Experiment Framework

A set of components which simplify human behaviour experiments developed in the Unity engine. UXF 2.0 supports Desktop, PCVR, Standalone VR, as well as Web based experiments for full remote data collection, with different data output modes. This is the development project, if you want to download the package, do not clone this repository, see "Get Started" below.

Read the open access paper in Behavior Research Methods! The paper is now slightly out of date but gives a good overview of the motivation of this project. Developed by Jack Brookes, Immersive Cognition Group, University of Leeds.

If you have developed a project using UXF please let me know!

Contents

Built with UXF

Click the banner above to see some of our experiments that have been built with UXF.

Get started

  1. Read over this Readme and the paper to understand UXF.

  2. Import the latest UXF.unitypackage release to your existing Unity project. (Drag the file into your project.)

  3. The UXF Setup Wizard will launch (or via the top menu: UXF > UXF Wizard) - Use it to fix any compatibility issues.

  4. Open an example scene. (e.g. UXF -> Examples -> 2_MoveToTarget -> MoveToTargetExample)

  5. Press play, and use the UI to enter any details.

  6. Press start to begin the session.

Visit the Wiki for more details.

Features

Programming style

  • Classes for common experimental concepts such as Session, Block & Trial
  • Helps create maintainable and readable code fitting with Unity's Component System

Data collection

UXF automates the process of collecting data. How the data are stored depends on the platform (PC, Web, etc) as well as your configuration of different "Data Handlers". For PC platforms, you probably just want to store data in files on the PC locally. In that case, the File Saver data handler will output data in several forms:

Behavioural data are collected with 1 row per Trial, and automatically records some values such as the timestamp of the start and end of the trial. Developers can easily record observations of any type and associate them with a trial. Data is output with one row per trial in a results csv file.

Continuous data are data that are measured continuously over time during a trial. The main use case of this is to track the position and rotation of any object in the scene, which is captured at whatever frame rate the application is running at (in the Update() loop) by adding a PositionRotationTracker component to a GameObject. This can be used to track positions of user controlled objects (such as hands or head in a virtual reality application) or an arbitrary object in the scene (e.g. some kind of stimuli). However this system is generic and developers can create their own Tracker classes that perform measurements of any variable during trials.

Data is stored in CSV files with automatic handling of file & directory naming.

UXF also stores other data in the form of .json files (full details on the Wiki). Running a session with UXF will result in an output like this (assuming three trials with a tracked object called object).

Path: /experiment_name/participant_id/session_number/

Filename                   Description
------------------------ | ----------------------------------------------------------
log.csv                  | Copy of all Debug.Log calls during the Session
notes.json               | Notes collected by the Notes UI
participant_details.json | Copy of participant details (e.g. info entered via the UI)
object_movement_T001.csv | Position and rotation of "object" within trial 1
object_movement_T002.csv | Position and rotation of "object" within trial 2
object_movement_T003.csv | Position and rotation of "object" within trial 3
settings.json            | Copy of the settings applied to the Session
trial_results.csv        | Main results file (behavioural data)

Example Output You can see an example of the data structure UXF outputs in the example_output folder of this repository.

Web & Database

For Web platforms, the data cannot be stored on the participant's PC. Instead, data can be uploaded to a database. UXF handles all of the hard work for you and automatically uploads the data files as long as you set up a DynamoDB database using Amazon Web Services.

Events

A UnityEvent is invoked on Trial begin and end, allowing you to easily trigger presentation of stimuli at trial start (for example).

Settings system

The settings is cascading, allowing setting independent variables at a Session, Block, or Trial level. Settings profiles can be stored as .json files and selected via the UI. This allows experimenters to deploy a single build of the experiment with several sub-experiments defined in settings profiles. The data for these sub-experiments is stored independently.

UI

A customisable user interface is optionally available to collect demographic data and present instructions to the user or experimenter. Variables that are collected are customisable and can be used in the experiment (e.g. a parameter for a participant's age could be used to change the difficulty of the experiment).

Example

UXF is built around the idea of separating the specification of your experiment (the "what") and the implementation of your experiment (the "how").

  1. Experiment specification: Building/describing your experiment structure, including the trials, blocks and their associated settings.
  2. Experiment implementation: Presenting stimuli according to independent variables, collecting dependent variables.

1. Experiment specification

public class ExperimentBuilder : MonoBehaviour
{
    // set this to reference your UXF Session in the inspector
    public UXF.Session session;
    
    // assign this method to the Session OnSessionBegin UnityEvent in its inspector
    public void GenerateAndRun() 
    {       
        // Creating a block of 10 trials
        var myBlock = session.CreateBlock(10);

        // Add a new setting to trial 1, here just as an example we will apply a setting of "color" to "red" 
        myBlock.FirstTrial.settings.SetValue("color", "red");

        ...

        // Start the session!
        session.FirstTrial.Begin();
    }

    ...

}

2. Experiment implementation

public class SceneManipulator : MonoBehaviour
{

    // set this to reference your UXF Session in the inspector
    public UXF.Session session;

    ...

    // assign this method to the Session OnTrialBegin UnityEvent in its inspector
    public void ShowStimulus(UXF.Trial trial)
    {
        // pull out the color we applied for this trial
        // output would be "red" on trial 1
        string colorManipulation = trial.settings.GetString("color");

        // example of using the new setting to manipulate our scene using a custom method
        ManipulateSceneColor(colorManipulation);
    }

    // this could trigger on some user behaviour (e.g. button response), collecting their score in a task
    public void RecordResultsAndEnd(int score)
    {
        // store their score
        session.currentTrial.results["score"] = score;
        // end this trial
        session.currentTrial.End();
    }

}

More examples are contained in the package and on the Wiki including a full written tutorial.

Development

This project is developed under Unity 2018.4 LTS but should work on all recent versions of Unity. Tested and working on Unity 2018 & 2019 LTS.

Documentation

Visit the Wiki for full documentation.

In the News

Tutorial: Building an experiment with UXF

A full tutorial for building an experiment with UXF is available here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].