Re: [pygame] network module

2006-10-30 Thread Alejandro J. Cura

On 10/28/06, DR0ID [EMAIL PROTECTED] wrote:

Perhaps there are more network modules out there I dont know off.


You should take a look a fibranet, that was used for some pyweek entries.
http://cheeseshop.python.org/pypi/FibraNet

Hope this helps,
--
alecu


Re: [pygame] network module

2006-10-28 Thread Simon Oberhammer
Hi Droid,Until now I only knew about two possibilities to network a game: usingthe python sockets or twisted. Both are kinda complicated to use (at
least seem to me, although I haven't used one of them).Twisted really looks complicated, but you can treat most of it as magic. Its tough to find a good entrance-point with twisted - their docs definitly are not, although they are elaborate. I learned twisted like that:
After reading this pygame tutorial http://sjbrown.ezide.com/games/writing-games.html I knew, that the part of twisted I want to use is called perspective broker - a PB is a very easy way (2-5 lines of code) to make your python classes remotly callable. The code in the tutorial seems out of date - newer twisted had some name changes, but the principal is the same. The tutorial helps you to see, how you can integrate those twisted calls with pygame.
So, after reading the tutorial, you should take a look at the howtos under caption perspective broker on this page: http://twistedmatrix.com/projects/core/documentation/howto/
I've written two classes - one for the server, one for the client - that take care of the networking in my pygame projects - if you're interested I can upload them. Though your game has to be event-based... basically how it works is this: some events get a special flag, that tells the network controller i must send this event to the client/server.
pyraknet seems to be very easy and straight forward to use, although Ihaven't used it yet.
Haven't heared of that before... it uses (reliable) udp, whereas twisted PB uses tcp.
My question is: does someone know pyraknet and/or has some experiencewith it?hm.. what I like about twisted: I hacked together those very basic network classes, and it works flawlessly... once I might find myself in the position where I need to improve the network-code (security, performance..) and thats possible to do with twisted.
greetingssimon


Re: [pygame] network module

2006-10-28 Thread Julien Herbin

Do you think XML-RPC is really suitable for gaming ?
I mean, it must be pretty slow because it's basically XML over TCP/IP.


Chris Ashurst a écrit :

If you want to get into some really simple networking stuff, you could give
XMLRPC a try (import xmlrpclib).

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of DR0ID
Sent: Saturday, October 28, 2006 05:34
To: pygame-users@seul.org
Subject: [pygame] network module


Hello

Some days ago a friend showed me pyraknet (based on raknet, 
http://pyraknet.slowchop.com/ ) for making networked games and applications.


Until now I only knew about two possibilities to network a game: using 
the python sockets or twisted. Both are kinda complicated to use (at 
least seem to me, although I haven't used one of them).


pyraknet seems to be very easy and straight forward to use, although I 
haven't used it yet.


My question is: does someone know pyraknet and/or has some experience 
with it?


Perhaps there are more network modules out there I dont know off.


~DR0ID




CONFIDENTIAL NOTICE: This email including any attachments, contains 
confidential information belonging to the sender. It may also be 
privileged or otherwise protected by work product immunity or other 
legal rules. This information is intended only for the use of the 
individual or entity named above.  If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, 
distribution or the taking of any action in reliance on the contents 
of this emailed information is strictly prohibited.  If you have 
received this email in error, please immediately notify us by 
reply email of the error and then delete this email immediately.
  




Re: [pygame] network module

2006-10-28 Thread DR0ID

Simon Oberhammer schrieb:

Hi Droid,

Until now I only knew about two possibilities to network a game: using
the python sockets or twisted. Both are kinda complicated to use (at
least seem to me, although I haven't used one of them).


Twisted really looks complicated, but you can treat most of it as 
magic. Its tough to find a good entrance-point with twisted - their 
docs definitly are not, although they are elaborate. I learned twisted 
like that:


After reading this pygame tutorial 
http://sjbrown.ezide.com/games/writing-games.html I knew, that the 
part of twisted I want to use is called perspective broker - a PB is 
a very easy way (2-5 lines of code) to make your python classes 
remotly callable. The code in the tutorial seems out of date - newer 
twisted had some name changes, but the principal is the same. The 
tutorial helps you to see, how you can integrate those twisted calls 
with pygame.


So, after reading the tutorial, you should take a look at the howtos 
under caption perspective broker on this page: 
http://twistedmatrix.com/projects/core/documentation/howto/ 
http://twistedmatrix.com/projects/core/documentation/howto/


I've written two classes - one for the server, one for the client - 
that take care of the networking in my pygame projects - if you're 
interested I can upload them. Though your game has to be 
event-based... basically how it works is this: some events get a 
special flag, that tells the network controller i must send this 
event to the client/server.


pyraknet seems to be very easy and straight forward to use, although I
haven't used it yet. 



Haven't heared of that before... it uses (reliable) udp, whereas 
twisted PB uses tcp.


My question is: does someone know pyraknet and/or has some experience
with it?


hm.. what I like about twisted: I hacked together those very basic 
network classes, and it works flawlessly... once I might find myself 
in the position where I need to improve the network-code (security, 
performance..) and thats possible to do with twisted.


greetings
 simon



Hello Simon

Thanks for the hint. And you are right about the the expandability of 
the code (as you said, secure connections, performance) that is possible 
with twisted. Eventually I will want to write some network-code, but I 
don't have a hurry with that.  I might come back to your offer about the 
source code some day, since I don't have any experience with network code.


~DR0ID


RE: [pygame] network module

2006-10-28 Thread Chris Ashurst
I suppose if each client was set up with an instance of
xmlrpclib.ServerProxy, and they themselves were also set up as xmlrpc
servers, that *might* cut down on the transport time.

Obviously it wouldn't be a great idea to try and make an MMO with it, but it
would definitely be a pretty good choice for slower-paced games like Risk.

Still, I never said it was fast, just said it was simple ;)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Julien Herbin
Sent: Saturday, October 28, 2006 10:02
To: pygame-users@seul.org
Subject: Re: [pygame] network module


Do you think XML-RPC is really suitable for gaming ?
I mean, it must be pretty slow because it's basically XML over TCP/IP.


Chris Ashurst a écrit :
 If you want to get into some really simple networking stuff, you could
give
 XMLRPC a try (import xmlrpclib).

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of DR0ID
 Sent: Saturday, October 28, 2006 05:34
 To: pygame-users@seul.org
 Subject: [pygame] network module


 Hello

 Some days ago a friend showed me pyraknet (based on raknet, 
 http://pyraknet.slowchop.com/ ) for making networked games and
applications.

 Until now I only knew about two possibilities to network a game: using 
 the python sockets or twisted. Both are kinda complicated to use (at 
 least seem to me, although I haven't used one of them).

 pyraknet seems to be very easy and straight forward to use, although I 
 haven't used it yet.

 My question is: does someone know pyraknet and/or has some experience 
 with it?

 Perhaps there are more network modules out there I dont know off.


 ~DR0ID




 CONFIDENTIAL NOTICE: This email including any attachments, contains 
 confidential information belonging to the sender. It may also be 
 privileged or otherwise protected by work product immunity or other 
 legal rules. This information is intended only for the use of the 
 individual or entity named above.  If you are not the intended 
 recipient, you are hereby notified that any disclosure, copying, 
 distribution or the taking of any action in reliance on the contents 
 of this emailed information is strictly prohibited.  If you have 
 received this email in error, please immediately notify us by 
 reply email of the error and then delete this email immediately.
   




CONFIDENTIAL NOTICE: This email including any attachments, contains 
confidential information belonging to the sender. It may also be 
privileged or otherwise protected by work product immunity or other 
legal rules. This information is intended only for the use of the 
individual or entity named above.  If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, 
distribution or the taking of any action in reliance on the contents 
of this emailed information is strictly prohibited.  If you have 
received this email in error, please immediately notify us by 
reply email of the error and then delete this email immediately.