Jump to content


online multiplayer tutorial?


8 replies to this topic

#1 fdmfdm

    Member

  • Members
  • PipPip
  • 25 posts

Posted 15 January 2013 - 08:24 PM

does anyone know a good tutorial for making a online multiplayer game?
there is this strategygame im playing, and i want to make a simulator of one part of the game, to train working together with others,
the issue is that i can make the game easy enough, but dont know how to make a online multiplayer game :(
i have looked around, and i saw some tutorials, but they are usually very focussed on 1 type of game, and not on making the online part, they usually just give you that.....

#2 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1588 posts

Posted 16 January 2013 - 01:49 AM

It gets pretty complicated because you have to set up a server or possibly a bank of servers. There are companies that provide the service like Player.IO:
http://playerio.com/...games-tutorial/
Currently using Blender and Unity.

#3 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 16 January 2013 - 04:18 AM

my advice is you should probably work more tcp-ip lan like based, rather than online straight away. just get tcp-ip working for 2 computers at once (even on the net) then move from there.

Just dont go tackle the 100 simultanious players right at the start. :)
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#4 jbadams

    Member

  • Members
  • PipPip
  • 27 posts
  • LocationVictoria, Australia

Posted 16 January 2013 - 08:10 AM

You're asking about a very broad topic, and the ideal solution is often very different depending on the type of game you're trying to make. It's unlikely that you'll find much in the way of tutorials.

#5 fdmfdm

    Member

  • Members
  • PipPip
  • 25 posts

Posted 16 January 2013 - 08:53 AM

hmm rouncer, will that work for 4 or 8 computers?
the game im simulating would be fine with 4 - 6 or 8 players, 2 however would not be enough

#6 TheNut

    Senior Member

  • Moderators
  • 1701 posts
  • LocationCyberspace

Posted 16 January 2013 - 11:44 AM

As rouncer said, focus first on learning the ins and outs of socket programming, then work on incorporating that into your game. Beej's Guide to Network Programming is a good starting point. It will cover most of what you need to know. I also recommend reading Microsoft's MSDN code pages on the various socket functions just so you understand the inputs and outputs better, including certain limitations and to handle all types of errors that can occur.

Once you get the gist of socket programming, you need to learn about asynchronous programming. If you're not up to par with this, you should learn about threads and various thread patterns (task scheduling, thread pooling, event/delegate pattern).

After completing the above, you should start thinking about creating your own protocol, on top of TCP/IP or UDP. By now you should know what those two are and how you should use them. Your games however will need a format of their own, something your code can parse and extract data from. HTTP is an example of a protocol built on top of TCP/IP. Once you define your protocol, you will need to create all the possible packets that can be sent and received for your game, and then build a packet handler to manage that. This is where you will need to think about a good design to put all the pieces together.

Finally, you will have to think about latency and synchronization, network prediction, and protocol compression. I haven't seen these topics covered well, but they are fairly intuitive. At least if you get as far as doing all of the above, you should be able to problem solve these as you go. As you get more experience, these solutions will come more naturally to you.
http://www.nutty.ca - Being a nut has its advantages.

#7 fdmfdm

    Member

  • Members
  • PipPip
  • 25 posts

Posted 16 January 2013 - 12:09 PM

okay thanks :)
then i have some work to do XD
i figured this game i was planning would be easy compared to a normal game, as the computer only have to send information 1 time in 30 seconds to tell the moves that are made, as it is a turn based strategy game in which the turns are done at the same time, so the players have 30 seconds to guess what the others will do and put their own moves ready, and then the server asks for the moves and calculates what happens.

#8 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1588 posts

Posted 16 January 2013 - 06:28 PM

You could also check out SFML if you are working in c or c++. They have a networking library. I think it's divided, so you don't have to use the other libraries.
Currently using Blender and Unity.

#9 v1technologies

    New Member

  • Members
  • Pip
  • 2 posts

Posted 25 January 2013 - 05:10 AM

thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users