IPhone multiplayer game - concept, strategy, design?

I want to develop a multiplayer online game for iphone.

I developed two iphone apps, but they were not games.

So this is my first game.

So basically I don’t know anything about how online multiplayer games work on the iphone.

I just want to know the strategy, precautions for beginners and other design elements that help me in understanding multiplayer games on iphone.

For example: if there is an online game in a casino (not bluetooth), how connections and sessions work between all players. How they manage turns, results.

EDIT I posed these questions separately as suggested by Brad Larson and ChrisF:

How will the game search for other online users and display a list of all users?

How can I ask someone to join the game and then see other users?

How will the connection and session between table players work? (Sockets?)

What network programming is needed as part of the server and client?

Please tell me how it all works. (Only concepts)

Thanks.

+1
source share
2 answers

How will the game search for other online users and display a list of all users?

You need a server that returns a list of online players to your iPhone client - this is some kind of data format, perhaps XML or JSON.

How can I ask someone to join the game and then see other users?

The simplest approach is the one who wants to join the game, sends this command to the server, the server reports that the other person they want to join is. Wait for an answer. If player two says yes, returns to the server, which forwards to the first player.

This is basically a series of commands sent to and from the server. This is how all multiplayer games work - for example, the Quake engine sends very compact commands, only 4 bytes for things like "get me all the players on the server." Given the fallacy of connecting the iPhone, this would be a good model for copying, since Quake networking code was designed for 56k modems.

How will the connection and session between table players work? (Sockets?)

The connection can be either a continuous stream (best of all UDP), or a polling from the client. You will need to consider scaling for both, as it is possible that 100 people can put your server on their knees.

The session will be deleted if one player loses connection. Alternatively, when he is working, each player can simply send a command when he is online, and the other client selects this when he is online - there is no need for a session in this model, and the teams are stored on the server in the data warehouse.

What network programming is needed as part of the server and client?

I will expand this:

  • Deep knowledge of byte and bit manipulation, including bit offset
  • Knowledge of creating and reading UDP packets
  • Network programming in C (Objective-C can simplify this)
  • Server: recording daemons on Linux or Windows services to listen for commands
  • Knowledge of SOAP, XML or JSON, if you are not concerned with bandwidth and connection,
+3
source

One thing you might need is a server for storing the state of the game, since you cannot guarantee that both (all?) Players will be online at the same time. One of the things that he would have kept would be who it was.

Then, when the player turns on his phone or starts the game, he will see a message saying that they are turning.

You can also use this server to store high scores and tables.

+1
source

Source: https://habr.com/ru/post/1314163/


All Articles