Forum Games Mobile turn based async game with Unity

Discussion relating to game development with Unity

Mobile turn based async game with Unity

Postby thrusterapps » September 27th, 2012, 4:03 pm

Just looking into solutions for creating a turn based game on iOS / Android using Unity. It's a card game and the multiplayer would function very similar to Words with Friends. Would Player.io be a good solution to implement a game style like this? I see it is good for real time multiplayer, but not sure if its suited to turn based?
thrusterapps
 
Posts: 1
Joined: September 27th, 2012, 3:47 pm

Re: Mobile turn based async game with Unity

Postby Benjaminsen » September 28th, 2012, 11:11 am

Absolutely! You could argue that our branding of the multiplayer service is wrong as it work great for any server-side processing task. A good example of that is The Last Stand - Dead Zone where the multiplayer servers are used for server-side security of a single player game.

Anyway, for your example it's even better. If done right, you can have a user experience that flows smoothly between realtime multiplayer and a-synch multiplayer. Here is the 30 sec crash course on how!

Prerequisites:
1: Use BigDB to store game state.
2: For each match, generate a unique id.
3: Use said unique id as the room id for the match.

A-Synch when one user is online:
1: User A connects to game
2: Server loads and sends game-state to user A
3: User A decides on move and send to server.
4: Server validates, saves and inform user B via email or fbnotice

Multiplayer.
Exactly as above, except that notifying user B, user B is just assigned the turn.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Mobile turn based async game with Unity

Postby dreamora » September 28th, 2012, 1:53 pm

I would actually say that Player.IO is even more suited for async than for realtime multiplayer because it is fixed onto TCP sockets, which makes it suboptimal for realtime action oriented games as you can not have unreliable / out of order messages
dreamora
 
Posts: 225
Joined: March 2nd, 2012, 9:58 am

Re: Mobile turn based async game with Unity

Postby afrokick » January 27th, 2013, 4:32 pm

Why send every time message, when player move?

You can send big message every 100 ms, which contains game world's state
User avatar
afrokick
 
Posts: 11
Joined: January 24th, 2013, 6:08 pm
Location: Belarus

Re: Mobile turn based async game with Unity

Postby Firebrand » February 24th, 2013, 11:16 pm

Newbie , just trying to wrap my head around this before I start;

For turn based games here's what I need to be sure of -
To persist data, it looks like one can Save, Load and search BIgDB to find any data, and in particular save each Match with UserIDs and match state. I don't see Rooms as being useful for turn-based games as they'd always be switching off between sessions. Do you need to be 'Joined' to a Room to use BigDb or is it totally separate?

Any clarity here would be useful, thankyou
Firebrand
 
Posts: 12
Joined: February 20th, 2013, 11:58 pm

Re: Mobile turn based async game with Unity

Postby Henrik » February 25th, 2013, 2:10 pm

Firebrand wrote:Do you need to be 'Joined' to a Room to use BigDb or is it totally separate?

No, you can use the antire API from either server-side or client-side. The main difference is that server-side code is secure, so it has by default more permissions to read and write data in BigDB or PayVault. For a turn-based game this means that your client would just send "moves" to the server, and the server could then actually run the game, validate the move, and update the game accordingly and send out a response to the client.
Henrik
.IO
 
Posts: 1832
Joined: January 4th, 2010, 1:53 pm

Re: Mobile turn based async game with Unity

Postby Firebrand » March 1st, 2013, 2:12 am

Final question, where are the list of Methods fired when a user performs playerIO/client actions (eg the Mushroom demo says things like 'Gamestarted()" is fired when an instance of your game is created but I can't find reference to 'Gamestarted' anywhere else, so I'm bound to be missing others)

My interest is in what Server side methods I can use to intercept player actions such as Joining as a Client, creating MatchObjects, sending messages etc? Not Room Methods as I'm only using BigDB for current game.

Is there a list somewhere? Cheers
Stu
Firebrand
 
Posts: 12
Joined: February 20th, 2013, 11:58 pm

Re: Mobile turn based async game with Unity

Postby Henrik » March 1st, 2013, 9:27 am

Henrik
.IO
 
Posts: 1832
Joined: January 4th, 2010, 1:53 pm

Re: Mobile turn based async game with Unity

Postby Firebrand » March 1st, 2013, 4:56 pm

'How, for example, do I run Server side code (without Rooms) that tidies up 'dead' games as I can't do that locally in case players just decide to stop playing and don't restart the App?'

EDIT : Ignore this, worked it out. Was just being thick :)
Firebrand
 
Posts: 12
Joined: February 20th, 2013, 11:58 pm


Return to Games



cron