Is P2P or client-server architecture better for my game? - iphone

I'm about to develop a simple 2D game something like chess, checkers, or reversi. There are only simple animations of the players pieces. No complicated math nor graphics therefore I'm wondering if it is better to go with P2P over a client/sever approach.
The game will be an iPhone/iPod Touch game (and later on run in a Web browser game using Cappuccino). Two iPhone players can play when near each other via bluetooth/bonjour. Or the game can be played against other remote iPhone players via the internet, iPhone to iPhone; (and later on - iPhone to Browser; or browser to browser).
The game starts off with two players, each having an agreed upon number of pieces to place on the board.
Both players are constantly connected because the game will have a countdown timer that is set to an agreed upon time limit of 10, 20, 30 seconds in which the active player (Player A) must make a move. If the Player A doesn't make a move before the timer counts down to zero the Player A will lose his turn and the opposing player (Player B) will become the active player. The timer count is displayed on each player's screen.
The game ends when the players run out of pieces, with the player having the most pieces on the board declared the winner.
Can I please get your thoughts on which is better for my game? P2P or client/server?

To some extent, it depends on your desired feature set. For example: are you going to have "high scores" or "saved games"? Are you certain your players are going to be near enough to always play via bluetooth? If not -- how will you "connect" them to each other if they're just using the internet? Do you have server infrastructure in place now?
Also, it would be helpful to know if this is just an "experiment/toy" you're doing or something you intend to commercialize/release to the public.
At the end of the day, you can do it either way. The 'which is best' depends on your specifics.

I don't know much about iPhone development but I think it would be better to support both if possible.
For the "local" scenario P2P is the way to go. The players can easily discover each other and start a game without the hassle of setting a server and connecting to it.
On the other hand if you want the game to be playable over the internet, I think a client-server model is more suited. You can also host statistics on the server (high scores?) organize tournaments and more.

In my opinion if it is something where latency could be annoying in-game then go p2p, adding a server into the mix is just going to increase latency.

Because of the low bandwidth required per session, you could probably use a scaled server approach. I'm not familiar with iPhone development, but you can keep the application requirements on the client low with a Web standards approach. The servers can be balanced on the back end, and tied to a unique session with multiple clients connected to a session.

Related

How to create multiplayer in the game?

I'm creating a multiplayer FPS game on Unreal Engine 4.
And don't know one thing - if it is multiplayer so it have to have more than one player. If I want to do this should I rent a server? From which hosting?
I want to release my game on Steam - what should I do to create servers for player? I really don't know and need a steps list.
It won't be a game with a big players count, so I don't need a big and strong server.
To start there is 2 ways of doing multiplayer.
You can either do it with dedicated servers (server will calculates all actions and send them back to each clients connected to it) or you can make a specific client a "host".
Wich ever you chose depends on the type of game you want to create, an open world type of game like a survival wich needs to be up 24/7 with players going on and off from it would require a dedicated server. On the other hand a coop game or a game wich can stop when player wants with 2 or 3 players could run on a client acting as an host.
If you choose to go for dedicated servers you can work inside unreal engine and tick the "run dedicated server" in the launch menu. As for releasing it and setting up multiple dedicated servers that's out of my knowledge

Methods to test Unity WebGL multiplayer game server scalability

I am looking for a method to test the scalability of my WebGL multiplayer game (built in Unity 3D). The game is currently based on the PUN (Photon Unity Network) library and cloud service for multiplayer communication. I would like to know how to efficiently find out if the server hardware and architecture can support, let's say, 20, 50, or even 100 players in one room, with the limited number of computers at my disposal. Ideally I would like to know the frame rate each player will experience. I do have access to some powerful servers. A preliminary idea I have now is to run a bunch of virtual machines on these servers, each of which runs a browser tab with the game. Just want to know the industry practice or what you think would work. Thanks!
Framerate is hardware dependent and if you are sending data to the server EVERY frame you are doing it wrong.
Basic premise on doing it right would be, a player shoots a projectile..
Get its spawnpoint, direction and speed and then pass that to the other players/server to then process without the need to send data each frame.
This is a simplified example but gets the point across.

GPGS Unity Plugin - Network Latency Check & Synchronisation

I'm trying to develop a realtime multiplayer game in Unity using Google Play Games plugin. So far, it all has been pretty straightforward. I'm using a P2P architecture.
One of the issues I have is that the data I'm sending to players is time sensitive. I can use and send an unreliable message, but we know that no two players will have the same set of data or 'game state' at any given point. Is there any way I can synchronise my players? my understanding is that having even a client-server architecture will only help me synchronise players to a certain degree, but not completely. Is that correct?
My knowledge of networking, especially with Google Play, is very limited so if you can explain this to me like I'm five, that'd be great. ^_^

Unity5 - Make a server only for multiplayer game

I followed the Unity tutorial of an online multiplayer game (here), and the architecture is the following :
But I would like to have this architecture :
I would like to really separate the client part and the server part in an online game. I'm new with Unity and especially with online multiplayer game and I really don't know how to do that. I don't want the solution, but maybe idea of how to do that.
Thanks a lot for helping me.
I am surprised you didn't learn the Tut and post this question. obviously you can make separate server.
As unity UNet basic concept stated:
In the unity networking system, games have a Server and multiple
Clients. When there is no dedicated server, one of the clients plays
the role of the server - we call this client the “host”
Three Modes of UNet Multiplayer Game:
A Networking multiplayer game can run in three modes - as a client, as a dedicated server, or as a “Host” which is both a client and a server at the same time. Networking is designed to make the same game code and assets work in all of these cases. Developing for the single player version of the game and the multiplayer version of the game should be the same thing.
NetworkManager has funcions for entering each of these modes:
NetworkManager.StartClient()
NetworkManager.StartServer()
NetworkManager.StartHost()
Check UNetManager for more details
You can open a Unity instance as a dedicate server.
NetworkManager.StartServer();
However for current state of UNET you can only have 1 room per Unity instances.
Which mean if you want to open many game room at the same time it'll cost you a lot of hardware.
Run as headless mode (No GUI) will help you a bit but that's not enough (Currently I've done that on DO).
So my recommendation is don't use UNET if you want massive users on your game.

Where do I start to implement a massively-multiplayer game on the Iphone?

I have a card game on the iphone and I really would like to take it to the next step by allowing players to interact with each other in real-time environment.
My questions:
Do I need a web server ?
Is there a third party specifically for iphone multiplayer games that I can use to host the game?
I would probably need a database - what is the best solution?
Should Apple push notifications be considered ?
First off, I have never done one myself, but I imagine that any massively multi-player game would entail some sort of central server to hold statistics (wins/losses), rankings, game table information, etc.
I imagine some sort of remote service providing server is required. A web server would certainly fit the bill and would most likely be the most logical solution, but certainly not your only choice.
Hosting of this service depends on the service you choose. If you're going the java route there are several places to look. Google's app engine, a straight up java web provider, amazon's cloud, etc. So many choices.
There are several open-source databases that would fit nicely with java. Postgres would come recommended by me. There are certainly others and other commercial options.
The server you use is bound to how fast the interactions with players need to be. The problem with HTTP would be that it's hard to have push notifications and it's also probably too heavy, depending on the type of game.
If it's in real time, but doesn't have a lot of interaction I'd probably use XMPP for the actual gameplay. If it's something where latency is more important, like a FPS or plataformer (actually any action game really) you'll probably need to roll your own protocol (and server obviously).
For the matchmaking a web server is enough.
Yes, you need a server for a traditional MMO, since an MMO is defined as a game where arbitrarily many people connect to each other. If you require people to be in the same vicinity, you can have an "ordinary" multiplayer game over the phones' wifi.
Doubtful. MMO servers require a lot of custom code. There are servers for high scores and such for more traditional games, however.
For your central database, this is entirely a question of preference. It sounds like cost is important to you, though, so I would go with MySQL since it's a free solution (and I think it's very nice to work with).
That depends on what gameplay will entail. If you're talking about a real-time game (like EverQuest or something), push notifications will probably not be helpful. If you're talking about something like Mafia Wars (is that the proper name of the Facebook one?), maybe.
I'd recommend looking at Parallel Kingdom, which is an existing MMO for the iPhone, iPod Touc and Android.