GDevelop-extensions
GDevelop-extensions copied to clipboard
New extension: Match Making System
Description
A matchmaking system using with p2p and firebase.
Flow:
sequenceDiagram
participant firebase
host->>firebase: register as host in the pool
client->>firebase: finds a host from the pool
client->>host: connects to host
host->>client: checks for enough players
host->>firebase: remove itself from the pool
host->>client: sends client to next scene
host->>host: sends itself to next scene
client->>host: disconnect and restart scene on connection timeout
host->>host: subtracts client count upon client disconnection
How to use the extension
1.) Setup firebase config:
Requirements is a firebase account and a few tweaks:
1.a) Go to firebase project settings then get config then paste it in gdevelop settings (**important: don't forget to add double quotes to the keys **)
1.b) Enable anonymous login so users don't need to login to use the server
1.c) then finally enable realtime database, change its rules and use that as a prefix on the matchmaking action
2.) Call the match making action on your scene
3.) set how many number of players to be matched (minimum of 2)
4.) set where scene the host goes after enough players are matched
5.) set where scene the client goes after enough players are matched
6.) set the firebase prefix for the online lobby
7.) when everything is matched and on the next scene you can treat it as a normal p2p system
8.) there's also additional functions that can help you manage the online system such as shared variables and online sprites
Checklist
- [X] I've followed all of the best practices.
- [X] I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
- [X] I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.
What tier of review do you aim for your extension?
Community (Unreviewed)
Example file
Extension file
Errors were detected in this submission:
❌ 1 Error found in extension 'MatchMaking':
⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'MatchMaking':
{
allowedProperties: [
'makeUuid', 'rgbToHex',
'rgbOrHexToRGBColor', 'rgbToHexNumber',
'hexNumberToRGB', 'hexToRGBColor',
'copyArray', 'staticArray',
'staticArray2', 'staticObject',
'toDegrees', 'toRad',
'random', 'randomFloat',
'randomFloatInRange', 'randomInRange',
'randomWithStep', 'evtTools',
'Variable', 'RuntimeObject',
'Logger'
],
disallowedProperty: '__MatchMaking',
objectName: 'gdjs'
}
❌ 1 Error found in extensions - please fix it before generating the registry.
The provided example file is non functional (even without the changes I have made to variable naming), please provide a functional example file to verify the extension function before we can merge it.