Multiplayer session APIs
Submitted by [email protected] on Thu, 06/17/2021 - 16:20
Hi, i see that the Multiplayer session APIs are currently only available on H5P.com.
Will we eventually be able to use these on our own servers as well?
Thu, 06/17/2021 - 19:31
Hi Ian,The Multiplayer
The Multiplayer content types will only be available for H5P.com customers who are on enterprise or standard rate plans. Please check the June 2021 release notes for more details.
Fri, 11/19/2021 - 00:44
These look really nice! Is
These look really nice! Is there a plan to make them available as open-source?
Mon, 11/22/2021 - 17:29
Hi mi3ll,Yes, but it may take
Yes, but it may take a while. The Multiplayer content types were designed to utilize the infrastructure available in H5P.com so developing it for the plugins may take some time to accomplish.
Mon, 11/22/2021 - 20:12
Hey!Oh, sweeeet! I am
Oh, sweeeet! I am volunteering to assist.
Mon, 11/22/2021 - 20:46
Hi BV,This is great news!
This is great news! Could you ask the core team if they will release the API sepcs or some samples soon, even if the plugins and the h5p core aren't updated yet? We've had requests for our NodeJS version of the H5P server to add multiplayer capabilities (and funding prospects) and we'd have to implement everything ourselves anyway. It would be much better if we didn't have to do our own API which would obviously be incompatible.
Wed, 11/24/2021 - 12:06
Great news! Looking forward
Great news! Looking forward to it.
Wed, 11/24/2021 - 09:58
There are no generic
There are no generic multiplayer APIs on H5P.com. The content types built so far are running "game logic" (js) both on the servers and on the clients. We considered allowing content types to include server side scripts or libraries, but that would be problematic especially from a security perspective. We found no sensible way to create generic APIs for what we wanted to do with the content types built so far.
It would be awesome if you would start working on a generic multiplayer API for H5P and share your plans here in the forum as you move forward with it. We could also do a call to sync if that makes sense. It will be important to find a good way for content types to define what operations the players are allowed to do on the game state and when, or we have to define a very simple API that limits what might be created with it.
Wed, 11/24/2021 - 10:35
Thank you for the insights!We
Thank you for the insights!
We've thought along the lines of integrating ShareDB https://github.com/share/sharedb into the system. It seems like a good pick for allowing collaboration through websockets and circumventing all the complexities of syncing states. The server would run on NodeJS (PHP isn't great for using websockets, which are persistent after all) and we already use it anyway. It would also be possible to have the NodeJS multiplayer server as a standalone microserve that is used by PHP implementations, I guess.
My ideas were to indeed have a generic multiplayer API:
That way you could have a generic server and all the individual content type functionality could still lie in the JS frontend libraries. There's no need to install custom code on the server as you only have schema files that are declarative.
I would love a short call about how to go forward on this, especially about possible ways of integrating technologies. You can contact me at [email protected]. We might get funding for this or at least parts of it in early 2022.
Thu, 11/25/2021 - 22:07
Sounds great! I think we can
Sounds great! I think we can do a lot with that. I sent you an email. There are also many scenarios that will be difficult to do with that approach (see below) and I think we just have to limit the scope a bit if we don't want to be running too complex game specific logic on the servers.
Some interesting scenarios for multiplayer are for instance voting, document collaboration, ludo and competitions using existing content types. For the first two the participants pretty much collaborates on a set of data. Voting may have some extra states (pause, presenter allows voters to change their mind after a discussion, timers etc. but nothing too complicated. Ludo introduces more complex rules and what are valid choices depends on the state of the game and the number on the dice and the dice must be thrown by the server(random number from the server). Competition with existing content types introduces the need for the server to check the answers and award points also taking into account any scoring options the content type may have(if we don't want to allow cheating). I think if we are to allow any game we will need such complex server side logic that we might as well use an existing language to descibe it(js for instance) instead of writing our own json based.
Sat, 03/05/2022 - 21:53
Here"s a demo/draft.
Here"s a demo/draft.