This page details the process of sending information between the frontend (coachvr) and Unity. Communication occurs via web sockets in a (roughly) event-based manner (somewhat like Socket.IO, but due to lacking a correct server implementation on the Unity-side of things we're using bare web sockets instead).
This page details sending information between the frontend (coach-vr) and Unity - you can find the code in another repository: https://gitup.uni-potsdam.de/wiepke/website-control. Communication occurs via web sockets in a (roughly) event-based manner (somewhat like Socket.IO, but due to lacking a correct server implementation on the Unity-side of things we're using bare web sockets instead).
## Basics
## Basics
...
@@ -30,10 +30,17 @@ Below is a list of messages that (at time of writing) can be used to relegate da
...
@@ -30,10 +30,17 @@ Below is a list of messages that (at time of writing) can be used to relegate da
*`classChange`, payload: `string` serialized object of shape `{room: string, front: string, outside: string, chairs: string, students: Number, messiness: Number, weather: WeatherPattern}`, where all of these fields may be optional
*`classChange`, payload: `string` serialized object of shape `{room: string, front: string, outside: string, chairs: string, students: Number, messiness: Number, weather: WeatherPattern}`, where all of these fields may be optional
*`bootstrap`, payload: none. Request for Unity to send initial classroom info
*`bootstrap`, payload: none. Request for Unity to send initial classroom info
*`behave`, payload: `{students: string[], behaviour: string}`. List of students and a behaviour to apply to them
*`behave`, payload: `{students: string[], behaviour: string}`. List of students and behaviour to apply to them
*`askQuestion`, payload: `{students: string[], questions: Number[]}`. List of students and corresponding question ids
*`askQuestion`, payload: `{students: string[], questions: Number[]}`. List of students and corresponding question ids
*`impulseGiven`, payload: `{students: string[], impulse: string}`. List of students to trigger impulse for
*`impulseGiven`, payload: `{students: string[], impulse: string}`. List of students to trigger impulse for
We are working on a solution to give the possibility to connect more than one coach with Unity. This is a rough sketch.
For this, we use a new abstraction: rooms. Unity creates a new room when the participant enters a classroom. Coaches can join these within a one-to-many connection (multi-user).
Management and message flow are done via a central web service with a Socket.io base and uses simple communication protocol. For this, we revised the integration and use it event-based via Scriptable Objects.