I’m working on a game where you can asynchronously play and challenge other people to beat your score (think something like SongPop). So you challenge someone and then your playthrough/results are stored on a server. Then the challenged player receives some kind of notification that they’ve been challenged and then plays at their leisure and can see the challenger’s results. This is well-suited to play on Facebook where you can challenge your friends and such, but it would also be nice to be able to challenge random players of a similar skill level (using chess-style Elo ratings perhaps?)
What’s the best way to handle something like this?
All the built-in Unity networking stuff looks designed around synchronous play and doesn’t seem to apply to my situation.
I’d certainly be willing to pay for some kind of PaaS/BaaS solution, but I do worry about how problematic that becomes if the service provider ever goes out of business. Could I easily migrate to another provider or my own backend?
I also wonder how hard it would be to just code something up myself. I already have a LAMP web server and know enough PHP/mySQL where I think I could build something, but I don’t want to spend tons of time on this and maybe I’m underestimating the work involved.
I think you’re thinking along the right lines. The UNet stuff doesn’t support persistence, so async stuff wouldn’t really work unless you wrote your own server tracking anyway. PHP/SQL is what I did for this years ago, not sure if you could get better results on appEngine/Amazon nowadays.
Take a look at Gamesparks, an awesome BaaS for games that has built in support for asynchronous challenges.
I’m using them in SuperTrucks Offroad and its a really nice system to work with.
And I wouldn’t worry about them going out of business just yet, they are serving some very well known AAA titles and partners and are constantly hiring new talent as they grow.
They have a YouTube channel as well and one of their videos goes into depth on how to use the challenge system.
Gamesparks does look pretty impressive. I’m intrigued.
Am I correct in reading that they basically handle the problem of cross-platform IAPs and Leaderboards as well? Or is that their own system separate from Google Play and iOS Game Center?
They do receipt validation for you when you make purchases on the App Store or Google Play, and based on that validation you can do something server-side, such as increment a players virtual currency coins or add an item to their inventory in the NoSQL db etc.
They have their own custom leaderboard system, which has nothing to do with GameCenter. Or you can use GameSparks NoSQL database and Cloud Code to roll your own custom leaderboard if the built in one doesn’t have the flexibility you need.
That’s what they said about GameSpy - when they closed down, they took a lot of AAA games with them, as well as the whole of Nintendo’s DS Wifi Connect service. I think it’s always good to be aware of this possibility, even if you conclude that it’s not worth proactively guarding against.
I wanted to suggest Yahoo Games Network too. I haven’t published anything using it but I have developed against it and it has a broad feature set and fairly well-designed API, with a predictable pricing policy, and they are one of very few services that let you run your own code on their cloud servers (in a sandbox of course).
John from GameSparks here. As Greg has kindly pointed out we are unlikely to be going anywhere for the foreseeable future. We have thousands of developers with hundreds of live games and many millions of players monthly. The company is on a strong financial footing.
So I don’t think we would leave you stuck. If you would like to discuss further, we can take this offline (please mail me at info@gamesparks.com) and we can put some protection for you into an enterprise agreement.