Python Online Multiplayer Game Development Tutorial



This Python online game tutorial will show you how to code a scaleable multiplayer game with python using sockets/networking and pygame. You will learn how to deploy your game so that people anywhere around the world can play against each other.

You will learn and understand the following after this tutorial:
• How a Client/Server System Works
• How to Develop Applications to an External Server
• How to Code a Client
• How to Code a Server
• Sending Encrypted Data Such as Objects Over a Port
• Connecting Multiple Clients to a Server

💻Code: https://techwithtim.net/wp-content/uploads/2019/03/networkTutrorial.zip

⭐️ Contents ⭐️
⌨️ (0:00:51) 1 – Creating a Client Using Sockets
⌨️ (0:16:55) 2 – Creating a Server
⌨️ (0:34:04) 3 – Sending & Receiving Information From Server
⌨️ (0:44:43) 4 – Connecting Multiple Clients
⌨️ (1:03:38) 5 – Sending Objects With Pickle!
⌨️ (1:14:52) 6 – Online Rock Paper Scissors

🔗 How to Install Pygame: https://www.youtube.com/watch?v=AdUZArA-kZw

🔗 Pycharm Download: https://www.jetbrains.com/pycharm/

🎥 Tutorial from Tech with Tim. Check out his YouTube channel: https://www.youtube.com/techwithtim

Learn to code for free and get a developer job: https://www.freecodecamp.org

Read hundreds of articles on programming: https://freecodecamp.org/news

And subscribe for new videos on technology: https://youtube.com/subscription_center?add_user=freecodecamp

source

This Post Has 21 Comments

  1. Tech With Tim

    Hope you guys enjoyed the video! Make sure to check out my channel for more awesome python content :))

  2. kbrunot13

    cool, but how i'm turn my socket in a real server?, exemplo: i need a socket for connect two peoples of != wi-fi, how i'm make this? i just can run in localhost

  3. Srivatsan Suresh

    Could someone tell how to make server be accessible across the internet. That is, I want to access the server running in one network from a completely different network. I tried all methods, such as using public IP, etc etc, but nothing seems to work…

  4. Bgamer Bass

    Just a small hint for everyone watching:
    Don't lose time watching/trying to understand this video or code if you don't have GOOD basic understanding in python.
    First learn the basics and object oriented programming, then come and watch this video

  5. hey! I wanted to make a "The Price is Right" game where the opponent chooses a number and the other one has to guess it
    depending of the number you pick it tells you "Higher" or "Lower"
    could you help me please? thanks in advance! 😀

  6. Tom Brandis

    I have seen a few videos about something called ursina for making 3d stuff – has anyone used it and how hard is it to use

  7. bloxxer02

    i wish you labeled the code before publishing theres a cool thing in coding called documenting your work for educational purposes

  8. SOCK_STREAM means that the socket uses TCP/IP and holds Connections. SOCK_DGRAM is connectionless and uses the User Datagram Protocol (UDP).

  9. The Flusches

    Never mind I found start_new_thread. Could you send a link to the files though? I am making a similar game but encountering lots of errors.

  10. Emmess d

    how can i play it with my friend now on two different computers?

  11. Force

    About 1:23:57

    Hope u read it and say ur opinion about this method
    There is an easier way
    U just make a list:
    Priority = ['R', 'P','S']
    And then u can just say
    If p1 == p2
    Return -1
    Elif Priority[Priority.index(p1)-1]==p2
    Return 0
    Else return 1

  12. FantasticBeast

    1:23:15 I think this works too: implement moves as circular priority
    Move=["R":0,"P":1,"S":2]
    if(Move[p1]==Move[p2]):
    TIE
    elif((Move[p1]+1) mod 3==Move[p2]):
    p2 winner
    else:
    p1 winner

  13. aydin anginer

    never use try: … except: pass, it's just bad, print error or something

  14. 조기영

    when I execute client file at first video I get a error messge 'video system not initialized' at "keys= pygame.key.get_pressed()".
    Is there any problem to execute the program? Why this happen?

Leave a Reply