Re: [pygame] Networking

2011-03-09 Thread Joseph Lewis
That does look like a great starting point, thanks Gregor. -- Message Sent By: *Joseph Lewis III* Public Key: [0xF8462E1593141C16] On Wed, Mar 9, 2011 at 4:29 PM, Gregor Lingl wrote: > > > Am 07.03.2011 15:03, schrieb Jose

Re: [pygame] Networking

2011-03-09 Thread Gregor Lingl
Am 07.03.2011 15:03, schrieb Joseph Lewis: Twisted is a little large and written in Python, although I would like to prototype in Python, the goal would be to get the code to be an integral part of Pygame and fairly small. Twisted isn't a liitle large but *very* large. A small, useful and nic

Re: [pygame] Networking

2011-03-07 Thread Alex Nordlund
On Mon, Mar 7, 2011 at 2:03 PM, Joseph Lewis wrote: > Twisted is a little large and written in Python, although I would like to > prototype in Python, the goal would be to get the code to be an integral > part of Pygame and fairly small. But whenever networking is involved, it's usually best to u

Re: [pygame] Networking

2011-03-07 Thread Joseph Lewis
Twisted is a little large and written in Python, although I would like to prototype in Python, the goal would be to get the code to be an integral part of Pygame and fairly small. I will look in to that, thanks. -- Message Sent By: *Joseph Lewis* Public Key: [0xF8462E1593141C16]

Re: [pygame] Networking

2011-03-06 Thread Alex Nordlund
On Sun, Mar 6, 2011 at 7:32 AM, Joseph Lewis wrote: > Does pygame have a networking module?  There doesn't seem to be anything > about networking in the documentation or subversion. What's wrong with twisted? Also, you should look up Vertex, could simplify what you're proposing. --- //Alex

Re: [pygame] Networking

2011-03-06 Thread Joseph Lewis
Great suggestions, thanks. I'll definitely add those in to my proposal. On Mar 6, 2011 3:09 PM, "inigo.delg...@gmail.com" wrote: > Well I've a petitions (or suggestions) I'm doing a online real-time game and > have to solve that problem... > > I'll suggest you to do the thinks that are necessary

Re: [pygame] Networking

2011-03-06 Thread inigo.delg...@gmail.com
Well I've a petitions (or suggestions) I'm doing a online real-time game and have to solve that problem... I'll suggest you to do the thinks that are necessary from TCP to use over UDP, that's: A packet indexing method (to mantain the order of the packets in the reciber, it can be done by inserti

Re: [pygame] Networking

2011-03-06 Thread Ian Mallett
On Sun, Mar 6, 2011 at 12:32 AM, Joseph Lewis wrote: > Hi, > > Does pygame have a networking module? There doesn't seem to be anything > about networking in the documentation or subversion. > > If there is no module I was thinking about building one through GSOC 2011, > if pygame is participatin

[pygame] Networking

2011-03-05 Thread Joseph Lewis
Hi, Does pygame have a networking module? There doesn't seem to be anything about networking in the documentation or subversion. If there is no module I was thinking about building one through GSOC 2011, if pygame is participating of course, with some general features, such as: - Chat (possi

Re: [pygame] Networking library

2009-04-14 Thread Chris McCormick
Hi David, I've put a bzr branch of the serialisation stuff here: bzr co http://mccormick.cx/dev/PodSixNet.serialise/ Let me know if you need me to tar it up or whatever instead. I've had a closer look and the issue is slightly different for each serialisation method. All work in my unit tests, b

Re: [pygame] Networking library

2009-04-14 Thread David
Chris: Could you share your test code, that you used to evaluate gherkin and rencode? David On Tue, Apr 14, 2009 at 3:25 AM, Chris McCormick wrote: > After talking to a friend who suggested a few different serialisation methods, > like gherkin, and rencode, I tried implementing a serialisation

Re: [pygame] Networking library

2009-04-14 Thread Chris McCormick
On Sat, Apr 11, 2009 at 10:17:35AM -0700, Patrick Mullen wrote: > On Sat, Apr 11, 2009 at 2:55 AM, Chris McCormick wrote: > > Hi, > > > > On Fri, Apr 10, 2009 at 04:44:30PM -0700, Patrick Mullen wrote: > >> Python2.6 comes with json.  Other than that, it is a small thing to > >> include. > >> > >

Re: [pygame] Networking library

2009-04-11 Thread Nicholas Dudfield
Meh, thunderbird always ruins formatting ... safe_eval.py attached import compiler class Unsafe_Source_Error(Exception): def __init__(self,error,descr = None,node = None): self.error = error self.descr = descr self.node = node self.lineno = getattr(node,"linen

Re: [pygame] Networking library

2009-04-11 Thread Nicholas Dudfield
Patrick Mullen wrote: On Sat, Apr 11, 2009 at 2:55 AM, Chris McCormick wrote: Hi, On Fri, Apr 10, 2009 at 04:44:30PM -0700, Patrick Mullen wrote: Python2.6 comes with json. Other than that, it is a small thing to include. The library seems to be built around json, so removing it as

Re: [pygame] Networking library

2009-04-11 Thread René Dudfield
hi, Just include simplejson with your library, but rename it so if someone has their own version installed it will use that :) try: import json except ImportError: import mysimplejson as json cheers, On Sat, Apr 11, 2009 at 7:55 PM, Chris McCormick wrote: > Hi, > > On Fri, Apr 10, 20

Re: [pygame] Networking library

2009-04-11 Thread Patrick Mullen
On Sat, Apr 11, 2009 at 2:55 AM, Chris McCormick wrote: > Hi, > > On Fri, Apr 10, 2009 at 04:44:30PM -0700, Patrick Mullen wrote: >> Python2.6 comes with json.  Other than that, it is a small thing to include. >> >> The library seems to be built around json, so removing it as a >> dependency doesn

Re: [pygame] Networking library

2009-04-11 Thread Chris McCormick
Hi, On Fri, Apr 10, 2009 at 04:44:30PM -0700, Patrick Mullen wrote: > Python2.6 comes with json. Other than that, it is a small thing to include. > > The library seems to be built around json, so removing it as a > dependency doesn't make much sense. Actually I don't think it would be a huge jo

Re: [pygame] Networking library

2009-04-10 Thread Patrick Mullen
Python2.6 comes with json. Other than that, it is a small thing to include. The library seems to be built around json, so removing it as a dependency doesn't make much sense. I took a look at this library when you announced it and thought it looks good, but I haven't had a chance to really try i

Re: [pygame] Networking library

2009-04-10 Thread Michael Fiano
I agree, preferably the former :) On Fri, Apr 10, 2009 at 6:07 PM, Ian Mallett wrote: > I'm sure it might be a pain, but removing the dependency on simplejson > would be really great. Either, that, or include it in the distr. > -Ian >

Re: [pygame] Networking library

2009-04-10 Thread Ian Mallett
I'm sure it might be a pain, but removing the dependency on simplejson would be really great. Either, that, or include it in the distr. -Ian

[pygame] Networking library

2009-04-10 Thread Chris McCormick
Hi All, I posted this as a project page on the pygame website, but I'm not getting much traction with my library, so I thought I'd post it here to see if anyone is interested. Basically it's a [hopefully] super-easy-to-use networking library that works well with Pygame too. Included is a simple n

Re: [pygame] Re:[pygame] networking example

2008-05-08 Thread Jake b
Thanks for the info. I've been going through the Twisted tutorials. I tried out raknet, but I only found one tutorial. Here's psuedo code I wrote trying to accomplish the Asteroids demo above. Am I heading in the right direction? Should I be using LineReceiver() and just send text messages like

Re: [pygame] Re:[pygame] networking example

2008-04-30 Thread Brian Davis
Here are the actual scripts: ***BEGIN asynchat_serv.py *** #!/usr/bin/python ### This is the game server ### import asynchat import asyncore import socket class GameServer(asyncore.dispatcher): """ The GameServer (mastermind controlling all) """ def __init__(self, port): async

Re: [pygame] Re:[pygame] networking example

2008-04-29 Thread Jake b
Brian: I am getting a 404 not found on both of your links. -- Jake

Re: [pygame] Re:[pygame] networking example

2008-04-28 Thread Brian Davis
I found the twisted docs a bit hard to follow and wound up building something on asynchat. http://docs.python.org/lib/module-asynchat.html Here is a simple example: Server: http://rafb.net/p/kU58yg32.html Client: http://rafb.net/p/sI2FRw42.html Starting with something like that it's just a ma

Re: [pygame] Re:[pygame] networking example

2008-04-27 Thread Patrick Mullen
Found you an exe and an egg: http://www.zope.org/Members/saffe/zope_interface/folder_contents Really annoying when binaries stop being updated. You could also just use sockets of course, they aren't that difficult really. Also, raknet uses udp, but it has built-in workarounds for all of udp's pr

Re: [pygame] Re:[pygame] networking example

2008-04-26 Thread Jake b
Does pyraknet only use UDP? ( Meaning I can't be sure if the message gets received? ) == I looked into twisted and it appears it might work for me, but I can't get it working. Short version: Is there a win32 installer for zope.interface for python 2.5? Or a way to get twisted working without it?

Re: [pygame] networking example

2008-04-26 Thread Thiago Chaves
Whenever I think of networking I get depressed. The only thing I have ever done so far with networking was junk like "Hello world, through a socket!". This is how I wish I could do networking with pyagme #Setting up a connection link = pygame.net.connection(address) #address is either a string wi

Re: [pygame] networking example

2008-04-26 Thread Patrick Mullen
Well yes, LAN makes this easier, because you can pick a latency to work with and it will be fairly consistent. With a consistent latency, you can send a message like: "bullet will be here by the time you get this message" and it should be fairly accurate. Unfortunately there is currently no netwo

[pygame] Re:[pygame] networking example

2008-04-25 Thread 110110010
Actually I like using this: http://pyraknet.slowchop.com/ Its a simple module for people who don't know using the socket library built-in Python. The docks is found here: http://pyraknet.slowchop.com/files/doc/ It's a bit messy and it took me about few hours to understand it.. :)

[pygame] networking example

2008-04-25 Thread Jake b
I'm looking for a tutorial or basic sample code that does networking in the way described: I'm trying to do something like: example: the classic game asteroids modified to have 2 player ships at the same time. I will have a group of asteroids and of bullets. My guess is that I will have (1) a ser

Re: [pygame] Networking?

2007-11-21 Thread Richard Jones
On Thu, 22 Nov 2007, David wrote: > On 11/20/07, Richard Jones <[EMAIL PROTECTED]> wrote: > > > 2) Use the Twisted reactor *as* your main loop, and implement all game > > > logic as call-backs from there. This is the approach that the Twisted > > > people will recommend. > > > > This is also useles

Re: [pygame] Networking?

2007-11-21 Thread David
On 11/21/07, Chris Ashurst <[EMAIL PROTECTED]> wrote: > I hope you mean that the sockets library is not the place to start, simply > because it's not immediately easy (unlike Twisted) to get right into? I > believe every programmer who wants to use a higher-level library should at > least have a st

RE: [pygame] Networking?

2007-11-21 Thread Chris Ashurst
f David Sent: Tuesday, November 20, 2007 09:44 To: pygame-users@seul.org Subject: Re: [pygame] Networking? The python sockets library is probably *not* the place to start. It is very primitive, and most references you will read will recommend using a higher level library such as asyncore or

Re: [pygame] Networking?

2007-11-21 Thread AlgoMantra
hey, please forgive me for any stupid observations.it's just that I've been avoiding testing Twisted because people seem to be of the opinion that it takes over the main loop. And they like having control over that. Can the main reactor be manipulated in such a way that it is not the main loop

Re: [pygame] Networking?

2007-11-21 Thread David
On 11/20/07, Richard Jones <[EMAIL PROTECTED]> wrote: > > > 2) Use the Twisted reactor *as* your main loop, and implement all game > > logic as call-backs from there. This is the approach that the Twisted > > people will recommend. > > This is also useless for highly interactive games. I consider

Re: [pygame] Networking?

2007-11-21 Thread Michael Sparks
On Wednesday 21 November 2007 06:51:38 Jason Ward wrote: > Thanks for the options guys. I'll look into them when I find the time. But I > don't mind low-level stuff if that's what sockets library requires, just as > long as it can work. Sure of course it'll work. The code is pretty much the same a

Re: [pygame] Networking?

2007-11-20 Thread Jason Ward
Thanks for the options guys. I'll look into them when I find the time. But I don't mind low-level stuff if that's what sockets library requires, just as long as it can work. Surely there must be some good C/C++ library that I can call with ctypes? What about just calling the win32 api straight with

Re: [pygame] Networking?

2007-11-20 Thread Michael Sparks
On Monday 19 November 2007 19:08:49 Jason Ward wrote: > I want to make my game playable over the network and if possible the > internet. > For the network it must support more than 2 computers and be realtime > Would the sockets library in python solve all my needs? Simple outline of a networked p

Re: [pygame] Networking?

2007-11-20 Thread Brian Fisher
I don't have twisted experience so I don't have an opinion on it specifically, but I completely agree with all the other stuff Patrick said. In particular, the hard part is not the underlying network layer (unless the net layer adds complexity), the hard part is figuring out how to send small usefu

Re: [pygame] Networking?

2007-11-20 Thread Patrick Mullen
I tried the twisted as separate process thing for a while when i was working with Blender's game engine. At the time it was the only way I knew how to do it, but it was very unwieldy to work with and deploy, just not a good system at all. You are already introducing issues with network communicat

Re: [pygame] Networking?

2007-11-20 Thread Richard Jones
On Wed, 21 Nov 2007, David wrote: > 1) Use Twisted with reactor.iterate I found that this approach has quite a high impact (ie. takes a considerable amount of time to run, even when there's no network events). > 2) Use the Twisted reactor *as* your main loop, and implement all game > logic as

Re: [pygame] Networking?

2007-11-20 Thread Michael Schmidt
hi this application offers in the next version a network layer http://sourceforge.net/forum/forum.php?thread_id=1870200&forum_id=618174 please have a look, if it is ready in the SVN or next release thanks Mike 2007/11/19, Jason Ward <[EMAIL PROTECTED]>: > > I want to make my game playable over th

Re: [pygame] Networking?

2007-11-20 Thread Casey Duncan
On Nov 19, 2007, at 11:08 AM, Jason Ward wrote: I want to make my game playable over the network and if possible the internet. For the network it must support more than 2 computers and be realtime Would the sockets library in python solve all my needs? The appropriate tool totally depends on

Re: [pygame] Networking?

2007-11-20 Thread David
The python sockets library is probably *not* the place to start. It is very primitive, and most references you will read will recommend using a higher level library such as asyncore or (higher yet) asynchat. Unfortunately, these higher level libraries share the same weakness as Twisted, in that

Re: [pygame] Networking?

2007-11-19 Thread Simon Wittber
p://www.google.com/search?q=simple+pygame+networking Try the first link returned. :-) -- :: Simon Wittber :: http://www.linkedin.com/in/simonwittber :: phone: +61.4.0135.0685 :: jabber/msn: [EMAIL PROTECTED]

Re: [pygame] Networking?

2007-11-19 Thread Richard Jones
On Tue, 20 Nov 2007, Noah Kantrowitz wrote: > Pyraknet is worth a look, as is Twisted, > but both have their own problems. Twisted is very mature, but can take some effort to learn how to use. It can also be very tricky to incorporate into a game. Richard

Re: [pygame] Networking?

2007-11-19 Thread Noah Kantrowitz
Not really. There isn't yet a good, lightweight networking library that plays well with pygame. Pyraknet is worth a look, as is Twisted, but both have their own problems. I've got some code I can throw your way, but it still has rough edges. --Noah On Nov 19, 2007, at 2:08 PM, Jason Ward w

[pygame] Networking?

2007-11-19 Thread Jason Ward
I want to make my game playable over the network and if possible the internet. For the network it must support more than 2 computers and be realtime Would the sockets library in python solve all my needs?

Re: [pygame] pygame networking redux

2007-06-06 Thread Jasper
Simon Wittber wrote: So... To summarise, it seems that people think Twisted is better than a re-implementation, and that running the network loop can should be an optional possibility. It seems people are using PB with some success. Is an RPC-like system such as PB preferable to a simple messag

Re: [pygame] pygame networking redux

2007-06-06 Thread Simon Wittber
So... To summarise, it seems that people think Twisted is better than a re-implementation, and that running the network loop can should be an optional possibility. It seems people are using PB with some success. Is an RPC-like system such as PB preferable to a simple message/event passing system

Re: [pygame] pygame networking redux

2007-06-05 Thread René Dudfield
Hi, a queue is all that is needed to be used to make it threadsafe. The thread with networking writes stuff into the queue. Your other code just reads from the queue. So it shouldn't be any different to the code you have now. Unless your networking code calls non-networking code. Note, that

Re: [pygame] pygame networking redux

2007-06-05 Thread Dave LeCompte (really)
René Dudfield <[EMAIL PROTECTED]> said: > Iterating it at eg. 72fps means that the quickest data can go out is > at 1/72 messages per second? You probably don't mean this - 1/72 messages per second is awfully slow. What I've done in situations like this before is to create an outgoing message q

Re: [pygame] pygame networking redux

2007-06-05 Thread Jasper
That's essentially the same thing... When you set your delay low enough, your code will be run once every time through twisted's loop -- which is effectively the same as twisted's loop being run once every time through your loop. "Ownership" of the loop makes little difference, and is easy to

Re: [pygame] pygame networking redux

2007-06-05 Thread Jasper
Perhaps useful. Seems like premature optimization to me though, and unlikely to gain enough to be worth the pain of dealing with threads. -Jasper René Dudfield wrote: I'm not sure this is true or not, but it's something I think is the case (untested)... It seems that running twisted in a se

Re: [pygame] pygame networking redux

2007-06-05 Thread Jotham
My two cents: As it stands now you can easily use twisted if you wish and it doesn't really need to be a part of pygame proper (an inference I am perhaps imagining). It seems in the interests of pygame that you would provide a standard interface for networking and then developers would write imp

Re: [pygame] pygame networking redux

2007-06-05 Thread René Dudfield
I'm not sure this is true or not, but it's something I think is the case (untested)... It seems that running twisted in a separate thread would be better for keeping more consistent latency in networking. If you wanted to run your networking at different frequencies to the rest of your system.

Re: [pygame] pygame networking redux

2007-06-05 Thread Simon Wittber
Richard Jones just mentioned to me off list how he is using twisted. (He is having issues with the mailing list). Using twisted like this is not intrusive, as it lets me keep control of the main loop. Thanks Richard! We've just run into this ourselves, but in our case integrating Twisted

Re: [pygame] pygame networking redux

2007-06-05 Thread René Dudfield
There's also that P2P protocol in twisted I think. It has a Q in the name, but I can't find it or remember it. It is supposed to be able to handle things like NAT traversal too. On 6/6/07, 12 Dogs <[EMAIL PROTECTED]> wrote: > > I was also curious if there are ways to use Twisted with UDP, I

Re: [pygame] pygame networking redux

2007-06-05 Thread 12 Dogs
I was also curious if there are ways to use Twisted with UDP, I actually thought/assumed there are. You can do UDP with twisted, but it's extremely underdeveloped, if you have your heart set on UDP i'd probably suggest pretty much anything else. Nathan

Re: [pygame] pygame networking redux

2007-06-05 Thread altern
hi not sure if directly related to this but I find OSC protocol very interesting to send info over the net, it was developed as a replacement of MIDI, but it is just a network protocol as far as i understand. There are python bindings and I did a layer around the original bindings to simplify

Re: [pygame] pygame networking redux

2007-06-05 Thread Phil Hassey
Another library worth considering is: http://pyraknet.slowchop.com/ - I haven't used it myself, but I've heard many good things about raknet. It's a networking library written primarily for games. Phil Toni Alatalo <[EMAIL PROTECTED]> wrote: Simon Wittber kirjoitti: > I think that is a matter

Re: [pygame] pygame networking redux

2007-06-05 Thread Toni Alatalo
Simon Wittber kirjoitti: I think that is a matter of one's perspective on what is 'nice'. sure seems like that. Also, I don't really think it is such a big project. I've built this sort of low level system before (using TCP instead of UDP) with higher level stuff to pass dictionaries around i

Re: [pygame] pygame networking redux

2007-06-04 Thread Simon Wittber
On 6/5/07, Jasper <[EMAIL PROTECTED]> wrote: This is essentially what I do, yielding 60 frames/second of 3D and animation without any trouble. I don't think the twisted overhead is as big as you fear, and it's definitely several orders of magnitude nicer than dealing with low level networking pr

Re: [pygame] pygame networking redux

2007-06-04 Thread Jasper
Simon Wittber wrote: Ah I can see how you solved the problem: def main(self): self.checkEvents(pygame.event.get()) ... snip lots of code ... #come back here at a rate of approx 30fps reactor.callLater(0.03, self.main) Basically you asked twisted to call your fu

Re: [pygame] pygame networking redux

2007-06-04 Thread Randy Kaelber
On Tue, Jun 05, 2007 at 11:45:25AM +1000, 12 Dogs wrote: > >Don't know if this will be helpful, but a while ago i started writing a >lemmings clone using twisted for networking. the file in question is >availablehere:[1]http://thescarydoor.googlecode.com/svn/trunk/default.pyi >di

Re: [pygame] pygame networking redux

2007-06-04 Thread Simon Wittber
On 6/5/07, 12 Dogs <[EMAIL PROTECTED]> wrote: Don't know if this will be helpful, but a while ago i started writing a lemmings clone using twisted for networking. the file in question is available here: http://thescarydoor.googlecode.com/svn/trunk/default.py i Ah I can see how you solved the p

Re: [pygame] pygame networking redux

2007-06-04 Thread 12 Dogs
Don't know if this will be helpful, but a while ago i started writing a lemmings clone using twisted for networking. the file in question is available here: http://thescarydoor.googlecode.com/svn/trunk/default.py i didn't have much problems with the twisted loop and the event code, i just didn't

Re: [pygame] pygame networking redux

2007-06-04 Thread Simon Wittber
On 6/5/07, Simon Oberhammer <[EMAIL PROTECTED]> wrote: I apologize if I totally misunderstood what you are trying to do but working with sockets is bäähh, I'd rather build on twisted for any networking needs. I'm still undecided on Twisted. I haven't done any serious work with it since 1.3. Loo

Re: [pygame] pygame networking redux

2007-06-04 Thread Simon Oberhammer
"ba:a:hh" ??? I play on SimonW's "bah" in german... the : should be on top of the "a" if you email client supports it :-)

Re: [pygame] pygame networking redux

2007-06-04 Thread James Paige
On Mon, Jun 04, 2007 at 09:01:31PM +0200, Simon Oberhammer wrote: > ..working with sockets is ba:a:hh, I'd rather build on twisted for.. "ba:a:hh" ??? --- James Paige

Re: [pygame] pygame networking redux

2007-06-04 Thread Simon Oberhammer
I've had a look at the latest Twisted (2.5), and it seems that there is no longer any support for integrating the twisted event loop with pygame. Bah. () Once all this low-level stuff is done, we could add lobby systems, score systems etc which are fairly generic and easily used across dif

[pygame] pygame networking redux

2007-06-04 Thread Simon Wittber
I've finally got some time to spend on building something useful for pygame networking. I've had a look at the latest Twisted (2.5), and it seems that there is no longer any support for integrating the twisted event loop with pygame. Bah. Anyhow, I figure there is enough brains on thi

Re: [pygame] Re: pygame networking

2006-06-06 Thread Bryce Allen
Frode and Rene, Thanks for the tips. sys.exit() doesn't terminate all threads on my Linux system - I had to set the daemon flag on my network thread to get my program to terminate properly. The flup example is just what I was looking for. They're using select - I plan on using either select o

Re: [pygame] Re: pygame networking

2006-06-06 Thread Frode Jensen
llen wrote: I have Trac/svn for my pygame networking project, courtesy of webfaction.com. Here is the URL: http://pygamenetworking.python-hosting.com I haven't had much time to work on the project, but I did post some code. At the moment I'm trying to figure out how to properly kill

Re: [pygame] Re: pygame networking

2006-06-05 Thread Rene Dudfield
.saddi.com/flup/ It uses a threadpool. On 6/6/06, Bryce Allen <[EMAIL PROTECTED]> wrote: I have Trac/svn for my pygame networking project, courtesy of webfaction.com. Here is the URL: http://pygamenetworking.python-hosting.com I haven't had much time to work on the project, but I did p

[pygame] Re: pygame networking

2006-06-05 Thread Bryce Allen
I have Trac/svn for my pygame networking project, courtesy of webfaction.com. Here is the URL: http://pygamenetworking.python-hosting.com I haven't had much time to work on the project, but I did post some code. At the moment I'm trying to figure out how to properly kill off a thr