2

As Google has recently made major changes to Firebase, they've released a service called Firebase Cloud Messaging, or FCM. I was wondering, could this work as a backend for a real time game between two players, as a replacement to a protocol like TCP or UDP? For example, a multiplayer game controlled by a game server with other player's position updates multiple times a second. I see that it can transfer 4kb of data per packet, and since it's hosted by Google I would think connection time would definitely be quick; however, Google doesn't advertise it as a game backend, but instead a messaging system suitable for applications like IM.

Basically, what I'm asking is, compared to protocols like TCP and UDP, how does FCM compare in terms of:

  • Reliability
  • Speed
  • Amount of traffic it can handle
  • Is data sequential like TCP, or "random" order like UDP?

And in the long run could it stand up to support constant communication between a game in server?

cameronlund4
  • 537
  • 1
  • 5
  • 27
  • yes, it is unfortunate that they do not publish such an important performance characteristics as "number of messages per second". At least, I have not found it. I guess the information about that metric will help you to figure out if it is a suitable replacement to bare-TCP. – Andrew May 23 '16 at 22:29

1 Answers1

3

This is a variable question. If you're creating a high-reaction based game (FPS, high-fedility action games), then using Firebase is probably not good solution.

That doesn't mean you can't use Firebase. You can offload syncing of points, stats, experience, HP/MP to Firebase to sync between players.

Google Cloud Messaging is not blazing fast and it also throttles during high usage to a device. Since you don't have control over this throttling mechanism I wouldn't use it anymore than to send notifications. The architecture is much more suited to Chat, Push Notifications, Inbox/New Message.

Long story short:

  • Use Firebase for points, logging events,
  • Use FCM for notifications
Community
  • 1
  • 1
Max Alexander
  • 5,471
  • 6
  • 38
  • 52