Multiplayer session APIs
Submitted by [email protected] on Thu, 06/17/2021 - 16:20
Forums:
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?
Great work!
Ian
BV52
Thu, 06/17/2021 - 19:31
Permalink
Hi Ian,The Multiplayer
Hi Ian,
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.
-BV
mi3ll
Fri, 11/19/2021 - 00:44
Permalink
These look really nice! Is
These look really nice! Is there a plan to make them available as open-source?
BV52
Mon, 11/22/2021 - 17:29
Permalink
Hi mi3ll,Yes, but it may take
Hi mi3ll,
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.
-BV
otacke
Mon, 11/22/2021 - 20:12
Permalink
Hey!Oh, sweeeet! I am
Hey!
Oh, sweeeet! I am volunteering to assist.
Cheers,
Oliver
serettig
Mon, 11/22/2021 - 20:46
Permalink
Hi BV,This is great news!
Hi BV,
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.
Best
Sebastian
totoro
Wed, 11/24/2021 - 12:06
Permalink
Great news! Looking forward
Great news! Looking forward to it.
falcon
Wed, 11/24/2021 - 09:58
Permalink
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.
serettig
Wed, 11/24/2021 - 10:35
Permalink
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.
Best
Sebastian
falcon
Thu, 11/25/2021 - 22:07
Permalink
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.
otacke
Sat, 03/05/2022 - 21:53
Permalink
Here"s a demo/draft.
Here"s a demo/draft.