• Post category:StudyBullet-9
  • Reading time:10 mins read


Create an online multiplayer game, AOL style chat room, and more! Learn the socket, threading, json, Pygame modules!

What you will learn

Networking Fundaments such as IP and port addresses, IPV4, TCP, and UDP protocols.

How to set up your own home network with static IP addresses and port forwarding so anyone can connect to your programs over the internet.

How to use the socket module to create a basic two way chat in the terminal.

How to use the threading module to create a basic chat room in the terminal.

How to use tkinter module to make a GUI chat room like the old AOL chat rooms.

How to use the Json module to create an advanced GUI chat room with and admin window.

How to use the Pygame module to make your own online multiplayer game.

Description

Have you ever wanted to build your own online multiplayer game that you and your friends could play?  How about wanting to build your own chat room like the golden AOL chat rooms from the 1990’s that you and your friends could “hang out” it.  Want to learn the underlying principles of how programs like these work – how they can communicate and send data back and forth from one computer to the next over the internet?  If the answer is yes, then please consider taking this course!

I know in my own journey with Python and computer science, once I got past the basics…the fundamentals…the whole “this is a for loop.  Can you print the first 100 even numbers?” type exercises, the doors really opened up.  There was only one problem:  the doors opened up to a HUGE space, with very little guidance.  Python is great because you can do so much with it, especially when you start to bring in new modules and libraries that give added functionality.  While there are ample beginner resources out there willing to hold your hand and guide you through the learning, I felt there were significantly less targeting this intermediate audience…The audience that has learned the basics and are now looking for something more…

In this course, I decided to focus my intermediate projects around networking applications; I wanted to write programs that could talk to each other online, both across my local area network and across the internet as a whole.  With this in mind, I asked myself what are some fun and engaging projects students would enjoy learning with and what external modules and libraries should we know to accomplish these projects.   In this course we will complete the following:


Get Instant Notification of New Courses on our Telegram channel.


  • A two-way terminal based chat introducing the socket module
  • A terminal based chat room introducing the threading module
  • A GUI chat room introducing the Tkinter module
  • How to configure your router to allow communication from an external network
  • An advanced GUI chat room with admin window introducing the json/pickle modules
  • An online multiplayer game introducing the Pygame module

Each project builds on the knowledge gained during the previous projects.  In our culminating project, when we attempt to create our own online multiplayer game, we will be generating IPV4/TCP sockets to connect computers to a server running on a machine with a static IP and port forwarding enabled, creating various threads to run processes concurrently on our machines, we’ll use json to serialize python objects such as our game state and game players, and have a full interactive GUI interface using Pygame.

By the end of this course you will have multiple projects you can share with friends or family, have them run a client script from their house, connect to your server script, and show off all you learned.

English
language

Content

Installation and Setup

Course Preview
Python Installation and Setup
VS Code Installation
Creating Our Working Directory
A Brief Overview of Networking Concepts

Creating TCP and UDP Connections with the Socket Module

Creating a TCP Server Socket
Creating a TCP Client Socket
Sending Data Through a TCP Connection
Creating and Sending Data Through a UDP Server/Client
Exploring the Buffer Size
Basic Two-Way Chat Part 1 – Server/Client Setup
Basic Two-Way Chat Part 2 – Enabling The Chat

Creating a Terminal Chat Room with the Threading Module

The Threading Module Basics Part 1
The Threading Module Basics Part 2
Terminal Chat Room Part 1 – Server/Client Setup
Terminal Chat Room Part 2 – Adding Functionality
Terminal Chat Room Part 3 – Adding Functionality
Terminal Chat Room Part 4 – Adding Functionality and Testing

Creating a Basic GUI Chat Room with the Tkinter Module

The Tkinter Module – Defining A Root Window
The Tkinter Module – Adding Frames
The Tkinter Module – Adding Widgets
The Tkinter – Module – Adding Functionality
Basic GUI Chat Room Part 1 – Building the Client Layout
Basic GUI Chat Room Part 2 – Building the Client Layout
Basic GUI Chat Room Part 3 – Adding Functionality
Basic GUI Chat Room Part 4 – Adding Functionality and Testing

Creating an Advanced GUI Chat Room with the Json Module

The Pickle Module – Sending Objects Through the Data Stream
The Json Module – Sending Objects Through the Data Stream
Advanced GUI Chat Room Part 1 – Updating the Client Layout
Advanced GUI Chat Room Part 2 – Building the Server Layout
Advanced GUI Chat Room Part 3 – Outlining Server Functionality
Advanced GUI Chat Room Part 4 – Outlining Client Functionality
Advanced GUI Chat Room Part 5 – Staring the Server
Advanced GUI Chat Room Part 6- Processing Messages Server Side
Advanced GUI Chat Room Part 7 – Starting the Client
Advanced GUI Chat Room Part 8 – Sending Data from Client to Server
Advanced GUI Chat Room Part 9 – Adding Admin Functionality
Advanced GUI Chat Room Part 10 – Adding Admin Functionality
Advanced GUI Chat Room Part 11 – Final Testing

Connecting to the Outside World

Adjusting Host Firewall for LAN Communication
Setting a Static IP Address for WAN Communication
Enabling Port Forwarding for WAN Communication
Testing out WAN Communication
Configuring A Second Router…Different Settings!

Creating a Multiplayer Game with the Pygame Module

The Pygame Module – Creating a Game Window and Game Loop
The Pygame Module – Setting Up a Game Class
The Pygame Module – Setting Up a Player Class
Using Fixed Length Headers – The Shortcomings of a Fixed Maximum Byte Size
Using Fixed Length Headers – The Solution to our Problems
Online Multiplayer Game Part 1 – Setting Up the Server
Online Multiplayer Game Part 2 – Setting Up the Client
Online Multiplayer Game Part 3 – Sending Pygame Configurations to the Client
Online Multiplayer Game Part 4 – Creating a Player on the Server
Online Multiplayer Game Part 5 – Sending the Player to the Client
Online Multiplayer Game Part 6 – Starting the Game on the Server
Online Multiplayer Game Part 7 – Starting the Game on All Clients
Online Multiplayer Game Part 8 – Player Movement on the Client
Online Multiplayer Game Part 9 – Creating a Game State on the Server
Online Multiplayer Game Part 10 – Processing Game State on All Clients
Online Multiplayer Game Part 11 – Resetting the Game for More Rounds
Online Multiplayer Game Part 12 – Official Network Playtest!