- Home /
Multiplayer (iOS): Unity Networking or Prime31 or Both?
Looking for some best practice advice here.
I want to add multiplayer (2-4 players) to my game. I want to use Game Center to find/match up players, etc.
What I don't quite get is this. If I use something like Prime31's Multiplayer extension to connect players via Game Center, then do I basically lose all the Unity Networking functionality?
In other words, what is the best way to do Multiplayer with Game Center? Do you use Unity Networking clases (following Unity Multiplayer Tutorial), or do you just use something like Prime31's "sendMessageToPeers" functions to send info about transforms, game objects etc that need to be displayed in the other players scene and write custom code to parse that and display it?
really I think just use Unity's networking commands. Use Prime specifically for the GameCenter. Frankly, don't even THIN$$anonymous$$ about the game center until you get your basic $$anonymous$$P gameplay working.
@Fattie, but if you ignore game center then you ignore the networking capabilities of it, and then when you add Game Center you'll have double networking going on, right? Or is the Game Center stuff "only" for finding matches and not for actually synchronizing game state???
edited for clarity ...
Your SECOND sentence after "or" is exactly correct Fraggie: the Game Center stuff is "only" for FINDING matches.
Also, its just a leaderboard as well. (Plus it does authentication and the like)
GameCenter does more than just leader boards. If you are using GameCenter for multiplayer than you will have to do that early on. I don't think GameCenter utilizes any functionality of the Unity Networking. GameCenter will take care of all the communication back and forth though their functions. But since GameCenter doesn't work in editor it might be good while developing to have another solution to test your multiplayer functionality.
game center provdes leaderboards. it also providees $$anonymous$$ATCH$$anonymous$$A$$anonymous$$ING for $$anonymous$$P networking. again, that's $$anonymous$$ATCH$$anonymous$$A$$anonymous$$ING for $$anonymous$$P networking.
but (of course - obviously) the networking does not actually run through gamecenter!!!!!!!!!!!!!
just as fraggie said, it is "only" for finding matches it is not (of course, obviously), for actual $$anonymous$$P networking.
GameCenter will take care of all the communication back and forth though their functions* that statement is incorrect, gamecenter is "only" for finding matches* as fraggie says (it is also a leaderboard!).
sorry if my previous comment was unclear .. I will edit it
Basically if you're doing an $$anonymous$$P game: do all the incredibly difficult work of making the $$anonymous$$P game work, locally in your studio with four of you playing the game on four iPads. That't the hard part and it will take 7 years.
THEN -- once that works -- as a FURTHER problem, you have to deal with "remote play" where you can 'find people to play against" on the internet. That is a whole hassle in itself, and indeed, GameCenter will help you there.
Sorry again if I was unclear
Answer by TokyoDan · Feb 13, 2013 at 11:57 PM
But what about the Game Center turn-based API? That handles networking and has nothing to do with leader boards
Yeah, Game Center API clearly supports data exchange between players that is unrelated to match making or leaderboards. There is a voice chat as well as methods like the ones below. I just wonder if anyone uses those for a Unity type game.
(BOOL)sendData:(NSData )data toPlayers:(NSArray ))playerIDs withData$$anonymous$$ode:(G$$anonymous$$$$anonymous$$atchSendData$$anonymous$$ode)mode error:(NSError *)error
and
(void)match:(G$$anonymous$$$$anonymous$$atch )match didReceiveData:(NSData )data fromPlayer:(NSString *)playerID