socket.py learning curve

I’ve decided that I’m going to spend a bit of time playing around with python sockets. Could those of you already working with socket.py suggest a couple of good reference materials that you’ve found useful.

Yes I know I should do a search but what better place to start my search than here :smiley:

Thanks in advance.

Take a look at my tutorials GameBlender multiplayer and GameBlender multiplayer 2. They shows how to use sockets in various modes to communicate two blender games together.
I also created a small demo of uploading models from Blender to my own game engine (called Spheric Engine) using sockets. It has advantage of instant update of game models from Blender, without exporting data and restarting game. Unfortunatelly, download page for this demo is only in Slovak.

Awsome that more people want to learn Socket :smiley: :stuck_out_tongue: !

no there is not really a deep learning curve for the socket module. its pretty easy. but its all the other stuff invloved making a game multiplayer (if thats what you are intending) thats a pain…
go to python.org there are good tutorials on sockets there, thats how i learned.

Thanks for the advice all. ashsid your tutes look useful - thanks.

Getting sockets to work and getting your python script to communicate with a server is the first step.

The 2nd step would be to decide what to communicate. In my opinion, using the physics engine in a multiplayer setting would be a problem because you would need to keep things in sync, you’ll notice some “jumping around” in some multiplayer demo’s…

I would use udp rather than tcp for a game that syncronization is not super important. tcp has error checking so messages are garenteed to arrive in order, this is good for something like a chess game… udp is used for action games like 1st person shooters. Because blender runs a scripts in intervals, the fact that you send too many udp packets out will not be a problem but sending too many lines of text in tcp will make a buffer get really big on the server or client… err I heard of an idea that uses 2 connections, one udp for action of a game, and one tcp connection for chat.

That’s most of my thoughts, i’ll probably be doing some multiplayer work too. goodluck~

Yeah that’s interesting, is there any other real advantage to multiple connections (in blender or elsewhere) , like download programs that run faster with multiple connections …

One of the most complete sockets tutorials I’ve found:
http://www.ecst.csuchico.edu/~beej/guide/net/bgnet2.pdf

Python specific sockets tutorial:
http://www.amk.ca/python/howto/sockets/

%| Ok, this is totally off-topic. But holy cow!!! Wiseman303 is back after such a long absence. Hmm, would this mean we’ll see you in #gameblender now?

Jason Lin

Yep wiseman, I already tryed to learn myself socket using the How to, from python.org. It’s really amazing, but I still didn’t succeeded in a client that sends binary data, and a server that handles it. :-?

goldentaiji: Yep, I’m back! my internet was disconnected for a few weeks, just got back online day before yesterday.

JD-multi: For binary data the documentation for the struct module might help. Python doesn’t really prepare you for using binary data though, I didn’t learn much about it until I started learning C++.