2

I'm currently having trouble finding resources for network game programming(in Python specifically; I don't know any other languages). I have found a lot of things about general networking in Python but I'm not sure that's what I need(as I believe game networking has some other factors involved). I'm trying to create a 2 player LAN game that is played on separate computers. I have seen the Twisted python library suggested by some and scorned by others so I figure I should just leave it alone. I'm very confused about where or how to start the creation of this game and any help would be appreciated. (I have read a similar post to this but it didn't help me very much, I did read the creation of Client/Server model and Client side prediction though so I have a VERY BASIC idea of how it should work).

Thank you for reading!

P.S. I don't know if this helps any but the game is supposed to be a 2D-Arena Fighter and using PyGame library.

3
  • Lol I have written a game exactly like that check it out on github: github.com/mthsrobot30/Ship-Fighters Commented Apr 3, 2015 at 22:56
  • actually game networking concepts are not language specific. so there is tons of materials for c, java or other languages, that are easily translatable to python Commented Apr 3, 2015 at 22:56
  • @ hexeri Oh. To be honest I'm not confident enough in my abilities to translate back and forth :I. Thank you for the suggestion though! :D Commented Apr 4, 2015 at 20:32

2 Answers 2

7

This is a late answer, but it should give people looking for python networking libraries and guides for games a good overview.

pygase This is a library I wrote myself for various indie projects, because no other libraries met all my requirements. It's well documented and quite opinionated. It takes into account most learnings in terms of game networking that have been made in the past decades and the API is rather high-level. It's also actively developed and maintained by me.

podsixnet A really well-designed low-level game networking API that should work for any kind of game. You still have some decisions to make architecture-wise that require a deeper understanding of game networking.

simple-game-server Not really a library, more a ready-made server that organizes "rooms" of players, that can exchange messages directly. It's a simple concept that only really works for small games that are not too twitchy.

If you want some deep and practical knowledge about game networking, look here. Together with the docs for the socket and SocketServer packages this should enable anyone to write great networking code for games in python.

Cheers, Silas

Sign up to request clarification or add additional context in comments.

Comments

1

I have actually done exactly that in Python. I used Pygames and made an arena fighter: https://github.com/mthsrobot30/Ship-Fighters.

There weren't any specific technologies that I used except for the standard sockets library.

The model that I used was that I had a thread running off the side that accepted keypresses from the other player from sockets and updated the screen based on it. Then, the local player would not only update the screen, but send his keypresses through the same socket.

I would recommend reading the sockets tutorial. I found it very hard to coordinate directly, so setting up a basic server that does nothing but relays the information would be a good idea for matching the players up with each other.

1 Comment

Awesome! I actually tried to download and play it looked very interesting to me. I'll definitely check out the sockets tutorial soon.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.