{"id":19798151,"url":"https://github.com/eweninja/godot-firebase-multiplayer-example","last_synced_at":"2026-05-16T05:11:18.115Z","repository":{"id":177685520,"uuid":"660754232","full_name":"eweninja/godot-firebase-multiplayer-example","owner":"eweninja","description":"Example project for multiplayer game with GodotFirebase, Realtime Database and Godot 4.","archived":false,"fork":false,"pushed_at":"2023-07-06T19:26:49.000Z","size":172,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T05:24:24.980Z","etag":null,"topics":["firebase","godot4","godotengine","multiplayer","realtime"],"latest_commit_sha":null,"homepage":"","language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eweninja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-30T18:59:27.000Z","updated_at":"2024-04-19T01:13:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"4bfc3311-aff7-4e25-a3a9-025f8dafa216","html_url":"https://github.com/eweninja/godot-firebase-multiplayer-example","commit_stats":null,"previous_names":["eweninja/godot-firebase-multiplayer-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eweninja%2Fgodot-firebase-multiplayer-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eweninja%2Fgodot-firebase-multiplayer-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eweninja%2Fgodot-firebase-multiplayer-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eweninja%2Fgodot-firebase-multiplayer-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eweninja","download_url":"https://codeload.github.com/eweninja/godot-firebase-multiplayer-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241139505,"owners_count":19916465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","godot4","godotengine","multiplayer","realtime"],"created_at":"2024-11-12T07:28:17.602Z","updated_at":"2026-05-16T05:11:13.096Z","avatar_url":"https://github.com/eweninja.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# godot-firebase-multiplayer-example\n\n**Work in progress**.\n\nExample project in Godot 4.1 using [GodotFirebase](https://github.com/GodotNuts/GodotFirebase).\nFirebase Realtime Database shared multiplayer with authority for own player.\n\n## Reason\n\n- I'm creating this project for reference, as a basic example of creating multiplayer in Godot 4 using Firebase (mostly Firebase Realtime Database).\n- Learning. 😊\n\n\n\n## About project\n\n- Anonymous login.\n- Setting nickname.\n- Creating lobby room.\n- Joining lobby room.\n- Matchmaking:\n\t- Search for open rooms:\n\t\t- If open room exists, join it.\n\t\t- Else create new open room and wait for other players.\n- In lobby room:\n\t- Starting game.\n\t- Leaving room.\n\t- Text chat (optionally).\n- Gameplay:\n\t- Spawning players:\n\t\t- Self.\n\t\t- Remote.\n\t- Sending player position.\n\t- Receiving remote players position.\n\t- Broadcasting player actions.\n\t- Host migration.\n- Game end:\n\t- Showing results.\n\t- Going back to lobby.\n\n## Database workflow\n\n**How are players added to db?**\nPlayers are added after loggining in. Every player is updating themself every 90 s.\n\n**How are players removed from db?**\nPlayer `updated_time` property is compared with actual time. If diff is more than 120 s - player is removed.\n\n**How are rooms added to db?**\nRooms are added then logged in player perform `Create Room` action. ~~Room has property `marked_to_remove = false`.~~ Rooms are updated by player host every 90 s.\n\n**How are rooms removed from db?**\n~~Rooms are first marked as `marked_to_remove = true` and then removed. They are makred then players number is 0 (`roomId.players == {}`).~~\nSame as player.\n\n**How are sessions added to db?**\n-\n\n**How are sessions removed from db?**\n\nTo include everything in one project, every game instance are making cleanups for `players`, `rooms` and `sessions`.\n\n\n## Todo\n\n- [x] Add login (anonymous).\n- [x] Add simple player scene.\n- [x] Add player nicknames.\n- [ ] Lobby rooms.\n- [ ] Matchmaking.\n- [ ] Simple \"gameplay\".\n- [ ] Game end.\n- [ ] Change naming to more reasonable, like room vs lobbby.\n- [ ] Refactor code.\n\n\n## Database structure\n\n```json\n{\n  \"rooms\": {\n\t\"$roomId\": {\n\t  \"room_name\": \"room-name\",\n\t  \"created_time\": 0,\n\t  \"updated_time\": 0,\n\t  \"is_running\": false,\n\t  \"players\": {\n\t\t\"$playerId\": {\n\t\t  \"is_host\": true,\n\t\t  \"nickname\": \"\",\n\t\t  \"current_points\": 0,\n\t\t  \"is_ready\": false,\n\t\t  \"updated_time\": 0\n\t\t}\n\t  }\n\t}\n  }\n}\n```\n\n- Players | Keeps track of online players.\n- Rooms | Keeps track of lobby rooms.\n- Sessions | Keeps track of ongoing games.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feweninja%2Fgodot-firebase-multiplayer-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feweninja%2Fgodot-firebase-multiplayer-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feweninja%2Fgodot-firebase-multiplayer-example/lists"}