The Firebase real-time replicating database system seems to offer the potential of running a server-less MMO. Has anyone tried? Do MMOs typically need server-side logic or can client-side access to real-time data provide the necessary facility? Do things need to be faster than millisecond-range response times?
I doubt this will work fast enough, from what I can see they use http which isn’t fast enough.
lol You would NEVER want to give the Client access to the Database. There would HAVE to be Server Side Logic for anything that could give the player a unfair advantage should they hack their client. If you don’t you would be dealing with a HUGE amount of hacking and people wouldn’t want to play the game…
Thank you.
Hi, Firebase dev here. I’d like to address some of the issues that were brought up above.
-
Firebase runs over websockets in all browsers that support them. The performance characteristics will be about what you’d get with a plain tcp connection.
-
While Firebase is a database accessible via the client, it also provides a robust and granular security model to help devs secure their app and prevent cheating in their games. Firebase supports some basic authentication options (email/password, facebook, twitter, others…), plus supports you doing authentication on your own server via a JSON Web Token, an open standard. You can even use a third-party authentication service, like Singly.com, which connects you to dozens of other auth providers.
Once you have a user in your system, you can use Firebase’s Security Rules to secure what they can read and write. If you’re curious, I advise you to check out the screencast here: https://www.firebase.com/docs/security-quickstart.html. It goes over how you can secure a client-side app with Firebase.
I hope that addresses the concerns that have been brought up. Please don’t hesitate to ask any more questions you might have.
Edit: as an example of a multiplayer, in-browser game powered by Firebase, check out roll20.net, a virtual table-top gaming site.
Welcome to Unity, Greg!
Although I’m working on a single player game, I like to stay abreast of multiplayer / MMO development. I visited your website, worked through your very intuitive tutorial and played around with some of the examples. The speed of the connection seems fine. Perhaps not for realtime FPS, but certainly for traditional MMO needs.
Sounds like security is handled. I’ll take your word for it for the timebeing.
What about rooms? Your How It Works page says “Whenever your data changes, all clients are immediately notified within milliseconds.” For most MMOs, updates should only be sent to users that are in the immediate vicinity of each other. Outdoor Unity scenes would need to be subdivided into rooms otherwise there is too much data being sent. How would you handle that with Firebase?
Any plans to develop a Unity Firebase Integration? Perhaps Photon users should be looking at Firebase as a persistence solution since Photon doesn’t handle that.
Interesting stuff.
Hi Nixter,
When the docs say “all clients are immediately notified within milliseconds”, it really means, all clients who are currently registered to watch the data at that location. The API lets you control what data each client is watching.
So, you might have a data layout like this:
root
|
±- rooms
|
±- room1
|
±- room2
Clients in room1 would be watching /rooms/room1, and clients in room2 would be watching /rooms/room2.
When a user moves from room1 to room2, you can update the locations that the client is watching.
I encourage you to check out the tutorial on our website, which walks you through creating a chatroom. The same principle should be applicable to a multiplayer game with rooms.
As for an official integration, we may do one at some point. In the meantime, I wrote some notes about what an integration might look like as an answer to this question on stackoverflow: http://stackoverflow.com/questions/15352252/using-firebase-to-backend-unity3d-for-the-creation-of-mmos/15353456?noredirect=1#comment21700978_15353456.
For questions regarding Firebase, the best place to go is our google group: Redirecting to Google Groups
I’ve been using Firebase since beta, and it’s actually a great tool for use as a game backend, and I think it could support a traditional mmo fairly well. Because you can select which clients listen to what messages, you could can set up a “client” which is actually a game rules server that checks listens to messages that need to be authenticated (combat results, inventory, etc.) and then have it “repeat” those messages to the customer clients. Other messages like position updates might go straight to other customer clients for responsiveness, as well as be checked by the game rules client for accuracy.
The “hard part” would be putting the first “M” in MMO, which would be appropriate scaling for your game rules client, but for prototyping at least, Firebase would be a great option.
I would like to see an example integration as I’m considering it for an upcoming project.
Wow this is quite interesting.
Using the security api would it be possible to perform input validation? things like a user has hacked their client to deal more damage than allowed, or step further than usual? Would it result in completely dropping the transmission or could it be automatically scaled back to fit expected parameters?
Ohmnastrum the security api doesn’t deal with this because it would be specific to the rules of your game, but an example that I saw that would address this involved hooking up a backend server to watch and validate changes to the data.
Hi @GregFirebase if you’re still there.
I love Firebase but I’ve always found it strange/bizarre you didn’t go hell for leather for Unity.
iOS and Android - who cares? the games market is where it’s at and Unity is the games market.
Say Firebase was a film company. And say you were really into making “foreign films” or maybe “Woody Allen films”. That’s what Firebase seems to be doing at the moment … iOS and Android? what’s the goal, like the important accounting app market? In the film company analogy, Firebase should be going for the main market, ie, sci-fi films and family CG films, just like any major studio.
So, I urge you to forget about this bizarre native iOs/Android crap and concentrate on the (by far) world’s main market, games.
Now what i wanted to ask, if you’re still on this list…
The Firebase Blog the beta was released some four months ago now. That is like 10 years in dog or software years you know?
Is it time that Firebase should tell us “well we’ve given up and won’t be doing Unity” … ? Or is the first release right around the corner?
what’s the deal, Firebase? Please let us know!
New Firebase looks good…
https://scotch.io/bar-talk/a-look-at-the-new-firebase-a-powerful-google-platform
Update on Unity here:
https://groups.google.com/forum/?fromgroups#!searchin/firebase-talk/unity/firebase-talk/h_8Kt8KYDv8/WaTpSTMxCAAJ
“Correct. There seems to be good interest in Unity now, so I’d expect this to get discussed/addressed in the near future.”
I bet over 80% of games on the Play store use Unity, so hopefully they will put some time into this.
Someone else make a plugin for sale on the asset store?
My main question for anybody using Firebase: what are the best practices for write frequency? Say I’m building a driving sim, and I want to track current speed – and have that show up in the DB in real time. Should I write to firebase on every frame? FixedUpdate? Or should I be gentle and write every 60/100/200 frames?
Hi Luke, you certainly would not write “continuously”. Absolutely no need for that, and it wouldn’t work.
I’d say write every “5 seconds”, perhaps.
In many cases, simply write at the end of the race.
Don’t forget: recording ghost racing is tricky. You have to record the real actual time (on input) … and interpolate that when you come back the other way. The frames won’t be “in the same place”!
It’s only a few lines of code, but you have to get it right. It’s one of those issues where the general idea is simple, but the actual engineering is tough.
So is there any one using FireBase for Unity game backend?
I wish too
Dang
Yes, it’s total madness that google have not covered Unity, with Firebase. However, they screwed up - Unity’s own DATA service is coming soon.