1
\$\begingroup\$

I'm developing an online RPG game for my "Object-Oriented Programming" module laboratory project. The client part must be written in C#, also using Unity 3D as a graphics engine.

The problem is that I don't know how to make the client-server communication rapid. How to achieve that every player sees other players' actions in real time on his device.

I want to get some recommendations on how to implement the client-server communication so that everything happens very quickly, i.e. when some player changes his position in a game, this change is immediately sent to all the other players' devices.

Of course, I also want to save all the players' current states in a database, so that they start where they left off the last time they logged out.

For the server side development, I'd prefer linux environment, but the language in which the server part will be written doesn't really matter to me. I just want it to be very fast.

\$\endgroup\$
  • 1
    \$\begingroup\$ The obligatory backgrounder reference which you should understand before going further: gafferongames.com/networking-for-game-programmers \$\endgroup\$ – Patrick Hughes Oct 4 '15 at 19:10
  • \$\begingroup\$ Does it HAVE to be client/server or would peer-to-peer work? I'm asking because a 4-player RPG could technically count as an orpg. \$\endgroup\$ – OrhanC1 Oct 9 '15 at 10:08
  • \$\begingroup\$ Yes it must be client/server because the players count will be only limited by server capabilities. \$\endgroup\$ – Salivan Oct 9 '15 at 10:11
1
\$\begingroup\$

You need to use instant messaging, sockets, etc.

I recommend using PubNub.com, i've been using is a lot.

You actually don't need a back end with this.

So you subscribe to a channel, for example the channel of some location.

Then, when somebody moves, for example to coords 5;10, you publish a message with this coordinates to the channel, and all subscribed devices receive the message almost instantly! Process it and show the player that moved at coords 5;10.

You also can publish the messages from a back end server.

This is how i would do it. Though i haven't used pubnub for game dev.

Its a good way to make prototypes, but as far as i know about game networking, the best speed is achieved by building your own networking architecture/server etc.

\$\endgroup\$
  • \$\begingroup\$ Good point about sockets and thanks for technology reference. :) \$\endgroup\$ – Salivan Dec 9 '16 at 16:07

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.