Xcode Mass Multiplayer (Not What You're Probab

2019-01-29 14:23发布

问题:

Okay so I would like to make a game, I'm trying not to divulge what it is but it requires anyone of a certain level in the game who is currently playing to be able to see each other in a sort of MMO style but not really.

For example:

Suppose I have players Bob, Mary, and Rob. Suppose that Bob is level 4, Mary is level 6 and Rob is also level 4. These would be shown in leaderboards by the way. What I would like is for Bob and Rob and anyone else who is level 4 AND CURRENTLY PLAYING to see each other in a sprite kit seen. I would like Mary to be off with other level 6's.

I have little idea of where to start with this. So my questions are:

  1. Should I even use Xcode or would I be better off using Unity?
  2. Does GameCenter have the capabilities for this or would I need to use Parse or something like that
  3. And also, could you please point me in the right direction as far as the concepts of how this would work?

If you can answer any of this that would be AWESOME!!!!! If not that's cool too! Thanks in advance!

回答1:

  1. Xcode is an IDE and Unity is a Game-Engime.

If you need to create your own game since the beginning, you should use an IDE. But this is really LONG and sometime difficult. With a Game-Engime, a big part of the game is already programmed (physic, 3D animations...) so you can focus your time for program your game.

  1. Game Center is for share a game or a score. Not played online.

For play online, you should create your own server.

  1. Do you know how to program? Are you good in 2D/3D?

For create an MMO game, you must be logic.

  • First, you should create a client.

    • The client is the game

    • He contain the sounds, the graphics, the scripts...

  • Second, you should create a server.

    • The server is connected to all clients.

    • He contains the databases (Accounts, characters, HP, gold...)

So where started?

When a character move (from the client A), he send his new position to the server. The server send this position to all the client. So the client B know where is the character of the client A and can draw a tileset (in your example, you can draw the tileset only if the boolean sameLevel is true).

Take a look at the sockets:

http://www.linuxhowtos.org/C_C++/socket.htm

http://www.nullterminator.net/winsock.html

https://stackoverflow.com/questions/tagged/sockets%20c%2b%2b

https://stackoverflow.com/questions/tagged/sockets+c

Hint - I have already answer at some similar questions. Even if the programming language are sometime different, I give you the link, the logic is always the same so it can maybe help you:

  • Creating a Multiplayer game in python

  • Multiplayer game in Java. Connect client (player) to game that was created by other client

  • How would an MMO deal with calculating and sending packets for thousands of players every tick for a live action game?