Multiplayer Tic-Tac-Toe Game Simulation using Python Sockets
Overview This project is a two-player multiplayer Tic-Tac-Toe game built using Python sockets and Tkinter. A central server coordinates gameplay between two clients, ensuring synchronized moves and fair ordering in the presence of simulated network latency and clock drift. This project was developed as a school project to demonstrate concepts in distributed systems, networking, and synchronization.
Key Features Client–server architecture using TCP sockets Real-time multiplayer gameplay Cristian’s Algorithm for clock synchronization Server-side action ordering using timestamps Simulated network latency and clock drift Neon-styled Tkinter GUI with animations Winner detection, draw handling, and visual effects
Technologies Used Python Socket Programming Threading Tkinter (GUI) JSON messaging Distributed systems concepts (time synchronization, ordering)
How It Works Players connect to a central server. Each client maintains a local clock with simulated drift. Actions are timestamped and sent to the server. The server assigns authoritative timestamps and broadcasts actions in order. All clients update game state consistently.
How to Run Start the server: python server.py Run the client on two separate terminals: python client.py Enter player names and begin the game.
Educational Focus This project focuses on: Distributed coordination Clock synchronization Message ordering Concurrent client handling
Future Improvements Support for more than two players Persistent game state and replay Improved fault tolerance and reconnection handling Separation of game logic from UI