Cross room communication architecture

Options

I'm trying to figure out the best way to pass data between multiple rooms in PUN v2 using cloud hosting.

I'm building training software for vehicle maintenance. I'm trying to add an online class feature where an instructor can start a class that students can join. From within the class the instructor can send all the students off into separate online rooms to perform maintenance on a vehicle that they are graded on. When the evaluation is complete they re-join the instructor in the classroom.

While the evaluation is in progress the instructor needs to be able to send and receive data from all the student's rooms. The instructor should be able to see each student's progress, if they are asking for help, send messages to students, and force them to end their session to rejoin the classroom. The instructor also needs to be able to join specific student's evaluation and continue to get updates from all other rooms.

We have a mongo backend, and I was going to use that to pass the data around, but figured there has to be a way to do it within the photon ecosystem.

I want to know if what I am trying to do is possible, and what is the best approach.

The three implementations I am looking into are:

  1. Using Webhooks. I'm not entirely sure how to implement this. Do I have to move to self hosted and right my own server?
  2. Create a "meta" room that all users join. This room would just keep a class in sync across rooms. As a bonus it could also have a photon voice component allowing verbal communication between instructors and students.
  3. Store the data within each room's custom properties. It was easy to update the current room's properties and see them change in the lobby. However I was struggling to get room data from a target room while in a room, and was unsure how to update the properties on a room that you are not in.

Thank you for any incites,

-David

Best Answer

  • Meep
    Meep ✭✭✭
    Answer ✓
    Options

    This could be simulated in a single networked room perhaps. If you have a classroom of 30 students and 1 teacher; you could use groups, enet channels and/or interest management to give the illusion of a different room, albeit just artificial in implementation.

    As for your original intention of putting the peers into different networked rooms all together. The Cloud is not really built for this. Nor is the self-hosted SDK, at least the load balancing application isn't anyway. Something like this would require a thorough rework of how the server handles operations. Currently game operations travel from the peer's reference and then into the hive room. When enqueued into the room they enter something called a Poolfiber which tends to commands sequentially. Think of it like a funnel for commands for the purpose of creating small zones of controlled thread-safety in sectors of the server. Transferring commands between rooms would violate this protocol and cause... issues.

    I do not advise using Webhooks although it would be possible. You would have to create an event for posting/receiving. It would be a lot of hacky web requests but it could work.

    Room properties are again another hacky workaround which could work but is not advised since custom properties have no authority. There is also egress implications with putting lots of data in lobby properties without concern.

Answers

  • Meep
    Meep ✭✭✭
    Answer ✓
    Options

    This could be simulated in a single networked room perhaps. If you have a classroom of 30 students and 1 teacher; you could use groups, enet channels and/or interest management to give the illusion of a different room, albeit just artificial in implementation.

    As for your original intention of putting the peers into different networked rooms all together. The Cloud is not really built for this. Nor is the self-hosted SDK, at least the load balancing application isn't anyway. Something like this would require a thorough rework of how the server handles operations. Currently game operations travel from the peer's reference and then into the hive room. When enqueued into the room they enter something called a Poolfiber which tends to commands sequentially. Think of it like a funnel for commands for the purpose of creating small zones of controlled thread-safety in sectors of the server. Transferring commands between rooms would violate this protocol and cause... issues.

    I do not advise using Webhooks although it would be possible. You would have to create an event for posting/receiving. It would be a lot of hacky web requests but it could work.

    Room properties are again another hacky workaround which could work but is not advised since custom properties have no authority. There is also egress implications with putting lots of data in lobby properties without concern.

  • DAyliff
    Options

    @Meep thank you for your help.

  • princebeck
    edited June 2022
    Options

    Hey @Meep thank you. That worked for me!