5 Replies - 408 Views - Last Post: 29 August 2013 - 11:30 AM Rate Topic: -----

#1 frostraver  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 93
  • Joined: 11-September 12

Socket connections in Multiplayer games

Posted 28 August 2013 - 02:43 PM

Hi everyone,

I have a quick question. I'm interested in learning networking for games (When I find enough information I'll start working on a game that can be played by multiple people at the same time)
but I have a question when it comes to commercial games that are multiplayer.

Do they use an existing library for their networking (like Boost or similar) or do they write their own libraries and server software from scratch. Starting from building up the socket connections and everything?

I know I'll need to learn those too of course. Just wanted to know how it's done.

Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: Socket connections in Multiplayer games

#2 Rhino1111  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 96
  • View blog
  • Posts: 220
  • Joined: 28-August 13

Re: Socket connections in Multiplayer games

Posted 28 August 2013 - 06:25 PM

Hey, I actually started learning about these things myself recently, because I've been wanting to develop a mmorpg. I can't answer your question about what commercial games use, but I can give you some things to look into.


you'll want to work with the socket class directly(they give you access to everything related to sockets, where-as higher level classes like TCPListener and such don't(from what i've read anyway)). Async sockets seems like the way to go, as they utilize the IOCP(I/O Completion Port) threadpool, are non blocking, and provide great scalibity.

You'll need to decide what Protocol to use. TCP is reliable, but has more overhead and is slower than UDP. UDP is "unreliable" and requires you to build a "reliability" layer on top of them(data can come in various pieces, mixed up, etc). Data can also come in various pieces(or appended together) with TCP as far as I know(correct me if i'm wrong), so you really need to develop a system when transmitting data so you know exactly how much data to read for each "request", to ensure you aren't reading more or less than you are expecting(or parts of seperate "requests"!). If you read too little, you'll need to try and re-assemble the full packet, and that can get quite complex.

Various other things:

-String parsing/manipulation is another thing you'll really want to look into and understand.
-Threadpooling
-Performance(trying to avoid creating deadlocks)
-Multithreading concepts(type safety, etc)
-working with databases
-possible security issues and solutions.


And various other things not directly related to networking but are important for mmorpg development:

-File encryption(make sure people cant modify/read any game data that comes w/ the game and resides on the client machine)
-obfuscation(make it hard for people to reverse engineer your source code)
-File integrity(can maybe use SHA1 hash's for comparison purposes to ensure important game data files haven't been modified).


I'm sure theres tons of other things also worth looking into, but that's all I can think of off the top of my head. Keep in mind i'm still fairly new to this too, and I'm not really attempting to give you "advice" with my current limited knowledge, more-so just giving you some things i've been looking into myself and are definately worth studying from good sources(learning resources, well done documentation, etc.).
Was This Post Helpful? 1
  • +
  • -

#3 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Socket connections in Multiplayer games

Posted 28 August 2013 - 07:32 PM

View Postfrostraver, on 28 August 2013 - 06:43 PM, said:

Hi everyone,

I have a quick question. I'm interested in learning networking for games (When I find enough information I'll start working on a game that can be played by multiple people at the same time)
but I have a question when it comes to commercial games that are multiplayer.

Do they use an existing library for their networking (like Boost or similar) or do they write their own libraries and server software from scratch. Starting from building up the socket connections and everything?

I know I'll need to learn those too of course. Just wanted to know how it's done.

Thanks in advance!

The consoles have dedicated libraries as part of their SDK. PCs can use anything.
Was This Post Helpful? 0
  • +
  • -

#4 frostraver  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 93
  • Joined: 11-September 12

Re: Socket connections in Multiplayer games

Posted 29 August 2013 - 01:53 AM

But do they use their OWN libraries or do they mostly use a bought one or open source one?
Was This Post Helpful? 0
  • +
  • -

#5 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Socket connections in Multiplayer games

Posted 29 August 2013 - 09:13 AM

It totally depends. Like I said for the consoles the SDK comes with mostly everything that is needed, with some tools made in-house. For PCs there is little point in reinventing the wheel so licences will be bought for the pro versions of various tools out there.

All you hjave to do is go through the credits to see what was used to make a game, it's that easy.

Regarding open-source? Maybe, maybe not.
Was This Post Helpful? 0
  • +
  • -

#6 frostraver  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 93
  • Joined: 11-September 12

Re: Socket connections in Multiplayer games

Posted 29 August 2013 - 11:30 AM

Thanks for the reply guys :)
Exactly what I wanted to know!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1