Thread: Using built in network functions to make a simple multiplayer game in C

  1. #1
    Registered User
    Join Date
    Apr 2016
    Posts
    1

    Question Using built in network functions to make a simple multiplayer game in C

    Hello,

    I am in a C Programming class at my university and for our final project, my partner and I decided to make a simple multiplayer card game. Because of restrictions on the Lab computers, we don't want to use 3rd party functions.

    I was wondering how to make a simple client and server program that allows the server to do the game logic, and the client to draw the graphics the player needs to see, and the only things needed for the networking are telling the client what to display, and telling the server what choice the player has made.

    If someone could explain sockets or point me to a good resource that uses pure C and not C++, I'd appreciate it a whole lot! My main problem is trying to do this a simple as possible because we cannot use anything but pure c and its built-in libraries.

    Thanks!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    1. C doesn't have a built-in library.

    2. It has a standard library (called libc), which every hosted compiler needs to provide. But that doesn't contain any networking stuff (nor any graphics for that matter).

    3. If you need networking, you need to use the features provided by your operating system through it's API.

    Fortunately for you, the networking API is fairly well standardised at a basic level of functionality.

    Read this for enlightenment.
    Beej's Guide to Network Programming
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Made a Batch Tic-Tac-Toe game, but I don't know how to network it for multiplayer?
    By BatchProgrammer in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-17-2013, 09:09 AM
  2. Simple Network Game Programing...
    By IndioDoido in forum Networking/Device Communication
    Replies: 4
    Last Post: 11-07-2007, 06:56 AM
  3. Simple game over network
    By Tommo in forum Networking/Device Communication
    Replies: 2
    Last Post: 10-12-2007, 03:07 PM
  4. Trying to make a simple yazee game...
    By Dauthi in forum C++ Programming
    Replies: 5
    Last Post: 01-14-2003, 03:26 PM
  5. Whats a very simple but good game i can try to make?
    By bluehead in forum C++ Programming
    Replies: 2
    Last Post: 11-06-2001, 09:24 PM

Tags for this Thread