In a series of posts we’ll do “Firebase From Scratch”, an introduction to Firebase and its concepts and ideas. Hopefully, reading this series will give you a firm grasp of what Firebase is and what it can do.
- Part 1: Introduction
- Part 2: Diving In
- Part 3: A Maven Interlude
- Part 4: Games, Services and Tournaments
- Part 5: What’s In a Server Game Anyway?
- Part 6: Activating Games
- Part 7: Actions On The Table
- Part 8: Services
- Part 9: Custom Authentication
Firebase is a “game agnostic multi-player server”, but that might not be entirely easy to parse. So let’s go backwards: If you want to write a multi-player game, what are the big components you need to worry about before it is done? You need a game client obviously, then a game server, a protocol between the two, and probably a database to store data in. Firebase is here to help you with 2 of those 4 components.
And how, exactly?
- Your game client, which can be written in almost any language you want, utilizes a Firebase Client API to send and receive messages from the game server. This way you don’t have to worry about the protocol for each game or player, or addressing in general: Firebase will handle that for you.
- You don’t have to write a game server, you can use Firebase itself as a server, and all you have to do is to write the game. That is to say, you write the code that decides what to do when, for example, player “adam” sends a “bet” action. In other words, the logic and not the server.
Let’s look at the last bit again. A game server is a complicated beast, it should handle multi-threading, networking, be possible to extend easily, be fast as hell, and hopefully also be fairly simple to work with. And you can certainly write it all yourself, but why bother when Firebase will do it for you? If you write a game in Firebase, you can concentrate on what really matters: the game, not the crud surrounding it. Needless to say, you’ll be finished much faster that way!
With me still? Fine, next we’ll look at what you actually need to do, a kind of head-first crash course if you like. Stay tuned!