r/gamedev•
Prodigga

Any recommendations for 'social backend' services for games?

Howdy, we are working on a multiplayer mobile game. Currently using Photon for the multiplayer portion, but we are looking for a service that covers some of the social features of the game. Primarily user authentication, clans/groups, live chat. Bonus would be matchmaking service with support for group matchmaking.

We've looked into Playfab which seems pretty excellent but we are not in a position to take advantage of all the features they offer so we will be 'wasting' a lot of money on things we will not be using. Their new matchmaker is fantastic but has really low polling limits (6x per minute to check the status of a matchmaking request) with no clear way to increase it other than going 'enterprise'.

We've also tried Nakama in the past which checks most of the boxes but we want to find an alternative.

We're happy to pay for a BAAS that fits the bill, or host our own 'social server' if anyone can recommend a cool open source bit of software that we can use.

We're developing our game in Unity, so we'd need the backend to be compatible with it.

Cheers

Posted Apr 15, 2019, 6:45 AM UTC

2115
ScaryBee•

Out of curiosity why not use Nakama? Have been considering it for one of my projects.

4
ProdiggaOP@TimAksu•

I've replied to another use asking the same thing

1
Zinlencer•

For matchmaking you should check out open-match.

3
ProdiggaOP@TimAksu•

Open match looks pretty sweet thanks

1
shizola_owns•

Isn't Nakama free? How come you didn't go with it? I've tried Playfab and Gamesparks, I found both a bit overwhelming to learn. Hoping Unity eventually cover most of the basics themselves eventually.

3
ProdiggaOP@TimAksu•

Nakamas .NET SDK wasn't up to scratch the last time we used it.

Disclaimer: All these issues are specific to the Nakama C# SDK. For all I know all their other SDKs work fine. Also worth noting that we haven't touched Nakama for a few months so improvements could've been made since.

We used it initially for multiplayer and their multiplayer system is just a relay service (much like photon) but wraps any messages you want to send to other players in JSON, so it is a very inefficient for fast realtime multiplayer games.

We send high frequency updates. For example, we hand serialise the players positional date, and ask Nakama to send that to the other players. (40-60 bytes of positional data). Nakama would take our byte array, convert it to a string, stick it into an envelope object, and serialised that envelope class into JSON and send that to the server instead. This was bloating the simple data we wanted to send to all the players out to a few hundred bytes. On top of that, it also generated an immense amount of garbage while doing this.

Their JSON library wasn't use any caching at first so it would use slow and costly reflection code to try and figure out how to serialise the envelope class every time you sent a single message, which was crazy because it was the same envelope class being serialised each time. (this issue has since been fixed, but still).

Lastly we discovered a big issue in their web socket code, where they were checking to see if a connection was alive before sending a message, every time you tried to send a message. This sounds reasonable on the surface of it, but the "is alive" check was actually performing a ping and waiting to hear back, which was blocking the entire network and preventing any other messages from going out until the ping completed. The issue wasn't noticeable locally (because the latency on a local network is near 0), but immediately obvious when you try to use it on an actual server that is 50-100ms+ away from you. It was completely broken, and this issue would've been spotted if the software was ever tested on a "live" server. It leads me to believe it was only ever tested locally.

All of these issues just left a very bad taste in our mouths, so we're looking for a different solution. The Nakama team is nice, but I feel like they spread themselves way too thin. They are a small team and they are trying to maintain client SDKs for cpp, unreal, JavaScript, java, .net, Unity, coco2d-x and swift.

We might have another look at it at some point to see how it's shaping up but for now we want to try something else.

4
shizola_owns•

Amazing reply, thanks. Agree with spreading themselves too thin, Nakama seemed a little too good to be true and didn't seem popular so I kind of dismissed it.

3
risight@andrei_here•

Hi Prodigga, as always thanks for the feedback - hope your project is shaping up well! I think it's been a while since you used Nakama so I just wanted to address a couple of points here.

The server uses a binary protocol primarily, the JSON compatibility layer is really intended for browser/webview JavaScript environments that didn't support the ArrayBuffers needed to pack/unpack the binary messages. The C# client used this higher level JSON protocol layer rather than going directly over the binary protocol, but there's no reason not to switch to binary.

Multiplayer is also not necessarily just relaying packets between clients, but I think that may have been added after you stopped using Nakama. You can now choose between relayed or fully server authoritative with fixed tick rate, and write the server code as either Lua scripts or native Go modules without the need to recompile the server itself.

For full transparency I checked an arbitrary 50 byte payload including op code which encodes to 164 bytes total including envelope. A 60 byte payload encodes to 176 bytes - a 20% increase in payload was a ~7% increase in total message size, so it's not an explosive growth or anything and the relative overhead decreases as real payload size increases. That said I completely agree it's not ideal - especially given the relative cost of encoding/decoding as you said - but it's not quite "a few hundred bytes". Switching to binary mode is much better for allocations, currently only adds a flat overhead of 48 bytes rather than an amount proportional to payload size, and we'll bring that down even further soon.

The socket behaviour you're describing is odd. It was a while ago so I may be misremembering but I think at one point you tested a server in US West and client in Australia and measured a round trip time of ~160-180ms. Based on a quick check on pure latency between AWS ap-southeast-2 (Sydney) and us-west-1 (N. California) regions that's in the right latency range. A full pre-flight ping round trip on each message sent doesn't fit in that time window however, if that were the case the best RTT possible would be 2x that. It was a while ago so I'm guessing this is a long shot but do you still have a packet capture we can investigate? Nobody else has reported this kind of RTT behaviour so far.

Nakama itself, all client libraries, documentation, and example code are all open source. Everyone is welcome to contribute to fast track a fix for any issue they have that the team can't immediately prioritise. This is especially true for client libraries that have their own quirks - we've found lots of Unity WebSocket libraries behave differently between Unity 2017 and Unity 2018 for example.

It's an ambitious project with a wide feature set and the ability to run your own servers anywhere, I just wish some of our NDAs would allow us to talk publicly about the larger games already using Nakama in production where we support or consult on the project. We'll do our best to get more of that info out.

3
ScaryBee•

Thank you for the insight, really valuable!

1
Wheeze201•

Didn't epic release their cross-platform online services to be used for free?

1
Zinlencer•

According to Epic's website

The only two services that are available right now are: Game analytics and Ticketing system. Most features OP is looking are scheduled for Q4.

4
[deleted]•

[deleted]

1
OrangeRabid•

Just plain curiosity. Why do you want to find an alternative to Nakama? (I know nothing about Nakama but I just discovered it and im curious about why do you want an alternative)

1
ProdiggaOP@TimAksu•

Replied to another user asking the same thing, since there was 3 of these questions:)

1
OrangeRabid•

Oh shit sorry I got a cached version of this question and I didn't see the answers hahahahah okay no problem :D

1
Zinlencer•

Just found this project called Beaver, this might be a nice solution for the live chat.

1