Thread: SDLnet and making a game server?

  1. #1
    Registered User
    Join Date
    May 2016
    Posts
    3

    Question SDLnet and making a game server?

    I have no experience with networking at this point. I figured an easy way to start would be to use a networking API for game development. SDLnet sounds ok to me, since SDL is a great high performance game API anyway.

    My question is related to SDLnet which is a separate installation to the normal SDK.
    I would like to make a small game server for a multiplayer game (not working on it, just planning for now). I would like about a dozen people to be able to connect to the game server, which is something that would be hosted on a players own computer. Is this something I would use SDLnet for?

    Some things that I understand, is that shooter games for example, have or used to have a capability to connect to each other. I am not sure how these architectures were distributed, but now most games connect to a game server and everyone else connects to that also. Does that sound right? Would I have a separate small game server running that I connect to and others would connect to also?

    So the goal -> Make small game server (allows about a dozen players to connect). Make a game client (to connect with). Run on own computer over internet.

    I am looking for someone to confirm that these steps are correct? and then my next questions will be related to how I can get this done.

    btw - I'm new here, so I hope I am asking in the right place, and thank you very much in advance for any help on this.

    I am a non-professional hobbyist C++ programmer, but I have not dabbled with anything serious. I am moving to C++ from Visual Basic and Visual C#, so I am still getting used to all this.

    I am interested in doing my programming on Linux, but if you are a Windows programmer, you can talk to me in Windows talk, but I am not interested in Managed C++,

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well it all sounds good, but expect months of hard work doing it.

    You have two basic approaches.

    1. Game server does all the work, game clients are thin - forwarding user inputs to the server, drawing scene updates from the server.

    2. Game server is thin - forwarding user inputs to all other players, and each players machine does all the work.

    The problem with 2 is making sure nobody cheats.

    I would suggest you start with a really simple game like head-to-head noughts and crosses.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Tweaking master Aslaville's Avatar
    Join Date
    Sep 2012
    Location
    Rogueport
    Posts
    528
    Quote Originally Posted by Salem View Post

    You have two basic approaches.

    1. Game server does all the work, game clients are thin - forwarding user inputs to the server, drawing scene updates from the server.

    2. Game server is thin - forwarding user inputs to all other players, and each players machine does all the work.
    I'd go with #1 - it's what most 'modern' game engines, at least the one's I've looked at do.

  4. #4
    Registered User
    Join Date
    May 2016
    Posts
    3
    Thank's - Yes, #1 sounds the best, I have heard of doing it that way is good.

    Nought's and crosses - is there a good example that is networked out there I can use as an example? I know a lot of programmers start with tic tac toe, then progress to chess after everything in between, but I never got a good grounding in the board game way of programming. I will of course search also.

  5. #5
    Registered User
    Join Date
    May 2016
    Posts
    3
    Salem - Noughts and Crosses, is one of the best ideas I heard. The approach is really straight forward. I got an example after Googleing that opens a connection let's you play and closes after the game is finished. Just glancing through the code I have a good idea on very simple sockets programming. It uses a client-server model.

    This is the link I found: GitHub - indradhanush/Multiplayer-tic-tac-toe: A Multiplayer Tic-Tac-Toe game written in C++ based on the client-server model using the basics of socket programming.

    Awesome thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. AVG antivirus while making server?
    By Alpo in forum Tech Board
    Replies: 7
    Last Post: 02-27-2015, 10:16 PM
  2. making a home server
    By DavidP in forum Tech Board
    Replies: 40
    Last Post: 01-28-2010, 07:14 AM
  3. Making simple client-server program
    By Micko in forum Networking/Device Communication
    Replies: 6
    Last Post: 07-09-2007, 10:04 PM
  4. Making an Email Server
    By Unregistered in forum C Programming
    Replies: 8
    Last Post: 01-20-2002, 01:45 PM

Tags for this Thread