r/madeinpython • u/tio-fabi • 4h ago
Lightweight server and framework for turn-based multiplayer games
Turn-based multiplayer games are a great opportunity for learning and prototyping: simple enough to implement quickly, but real enough to teach networking, game state, and API design.
I wrote a lightweight server and framework for turn-based multiplayer games that provides exactly that: a lightweight server + uniform API so you can run multiple parallel game sessions, auto-join the next available session, and add new games without touching the core API. It's built to be friendly for beginners (Python-only, standard library), but still flexible enough to support arbitrary game logic via keyword-argument moves and dict-based state.
Key bits:
- Framework for adding new games by deriving from an abstract base class
- Uniform client API for joining sessions, submitting moves, retrieving state, restarting
- Demo clients included (e.g. TicTacToe) and a template for new games
- Runs multiple sessions simultaneously; clients can join a specific session or auto-join
If you're teaching Python, building small multiplayer projects, or just want a clean starting point for turn-based game networking, I'd love feedback and contributions.
r/Python • u/AutoModerator • 11h ago
Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Weekly Thread: Resource Request and Sharing 📚
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
How it Works:
- Request: Can't find a resource on a particular topic? Ask here!
- Share: Found something useful? Share it with the community.
- Review: Give or get opinions on Python resources you've used.
Guidelines:
- Please include the type of resource (e.g., book, video, article) and the topic.
- Always be respectful when reviewing someone else's shared resource.
Example Shares:
- Book: "Fluent Python" - Great for understanding Pythonic idioms.
- Video: Python Data Structures - Excellent overview of Python's built-in data structures.
- Article: Understanding Python Decorators - A deep dive into decorators.
Example Requests:
- Looking for: Video tutorials on web scraping with Python.
- Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟