1
\$\begingroup\$

I would like to make a 2 players app game, where 2 players can compete with each other in real time.

If I want the player to be able to compete with the public (anyone who registered with my game able to compete with one another), do I need a server?

If I want the player to be only able to compete with his facebook friends, do I need a server?

Do I need a server at all in the first place, for 2 players game?

\$\endgroup\$
  • \$\begingroup\$ Do you intend to sell in-game items that would give an advantage to a player? \$\endgroup\$ – Alexandre Vaillancourt Jul 6 '16 at 18:51
  • \$\begingroup\$ @AlexandreVaillancourt Did I misread OP's question? I don't understand the context of your question. \$\endgroup\$ – MichaelHouse Jul 6 '16 at 19:46
  • 1
    \$\begingroup\$ @Byte56 No, you did not misread the question. I was about to suggest that a server or something like it would be required in any case if s/he wanted to reduce cheating :) \$\endgroup\$ – Alexandre Vaillancourt Jul 6 '16 at 19:48
3
\$\begingroup\$

Yes, you'll need a server if you want to connect players together over the internet (Facebook friends or otherwise). Without a "meeting place" (your server) your players wouldn't have the information they need to connect with each other. In all likelihood, they won't be directly connecting with each other at all, it'll be far simpler to route the traffic through the server.

It's possible to not use a server if you're connecting players on the same wifi network.

\$\endgroup\$
0
\$\begingroup\$

Basically to connect one client to another at least one of them needs to know the IP address of the other one, the only way to do this is having both client connect to a server (which they know the ip address) and then the server can interchange the ip address between the two clients so they can connect directly.

If you don't want to develop your own server, unity provides some multiplayer services , including a matchmaking that I think it does exactly that, connects the two clients directly, making one of them act as the server.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.