Re: [pygame] C/C++ and Python
On Mon, Apr 20, 2009 at 9:28 AM, René Dudfield ren...@gmail.com wrote: hi, The main reasons not to use opengl, and instead use pygame graphics are: - opengl is not as portable. - it's harder to write opengl code that'll work everywhere because of bugs in various opengl drivers, cards and python bindings. - it's more complex to write opengl code. So if you're just wanting to write a game, I'd avoid opengl. If you want to play around with graphics, then definitely give opengl a go. It'll be educational too. To answer your original question... Some times you need the extra speed, and then writing C can be a good way to go. Or if you need to wrap an existing C library, so you can use it from python. pygame tries to keep the minimal amount of things needed done in C/asm so you don't need to write so much C yourself for games. If there's some code that is useful for lots of games, it might be a good idea to contribute it to pygame, to keep all the C in one place. So you get the benefit of fast C/asm code, callable from python. Using C, asm, and python appropriately you get the best of all worlds. Make the 0%-5% of your code that really needs it be C/asm... if it needs it. Combined with things lke psyco, and numpy - you can avoid doing a lot of things in C. The hope is that eventually python itself will come close to C speed, so you'll need less C... However that hope has been with me for over 10 years, and I see no real progress speeding python itself up. Where as C in the meantime has gotten a lot faster. C compilers available now can do autovectorization, profile guided optimisations, and all sorts of magic, that python is a long way from. There's even compilers that help with auto SMPing, and auto MIMDing your code. I see no reason why this will not continue to be the case. C has a lot more smarter people working on it compared to python, so will always be a lot faster until that changes(which will not happen in our lifetimes). However, there is a lot more knowledge in the python community now about jit, and asm stuff than previously... so it'll be interesting to see where we are at with that in 1-5 years. Having said that, things like pycuda, and pygpu begin to close the gap. Since they offload a lot of the work to the GPU - which work in an array like manner. The native language for GPUs is increasingly looking like C - with vector SIMD, and MIMD extensions. Most C compilers for CPUs also have vector extensions these days too. Have you seen this? http://arstechnica.com/open-source/news/2009/03/google-launches-project-to-boost-python-performance-by-5x.ars Also this makes the python speed point very well. One last thing I would add is that code speed is often not needed anymore. I have never in the last 10 years had to worry about code speed while writing a simple 2d game like pong, tetrus, defender, donky kong or anything else like that. http://www.scipy.org/PerformancePython -- Douglas E Knapp Why do we live?
[pygame] Google Summer of Code proposals announced
Hello, the Python Software Foundation (PSF) and Google have accepted three pygame related proposals this year. Here is the official announcement: http://socghop.appspot.com/org/home/google/gsoc2009/python There were around 30 pygame related proposals submitted to the PSF - more than any other python related project. With so many proposals, not all of them could be accepted. We'd like to thank everyone who spent time writing their proposals - many of them were of very high quality. Congratulations to Tyler Laing, Werner Laurensse, and Vincent Marti. Tyler Laing is going to be working on an enhanced movie module using ffmpeg. Werner Laurensse is going to be working on improving the camera module, especially on OS X. Vicent Marti will be working on improvements to the font module, and writing bindings to freetype. Marcus von Appen, Nirav Patel, and Rene Dudfield will be mentors for these projects. There were also a number of SDL related proposals that were accepted. These are: Enhance International Input Support for Mac OS X International Input (X11) Automated Testing Suite for SDL Playstation3 Port (http://socghop.appspot.com/org/home/google/gsoc2009/sdl) along with a number of python related proposals of interest to pygame people, including adding SIMD optimisations to numpy with the corepy assembler. We would like to thank you all for your time spent on anything and invite you to join the pygame development, if you want to work on your proposals anyways. Feel free to ask us for help guiding you on your first steps with them and be assured that your commitment is and will be highly appreciated. Regards Marcus pgpGLYRmpBAHJ.pgp Description: PGP signature
Re: [pygame] Porting to Python 3.0 - the python3 branch (Was: pygame for portable python)
I have now added sprite, time and transform to the list of updated modules. Now the scaletest.py and stars.py examples run. Tests that pass so far are: base_test, color_test, rect_test, display_test, surface_test, blit_test, image_test and sprite_test. So that leaves mixer, mixer.music and font. I am doing the development on linux so anyone with Windows XP feel free to check out a copy from svn and try building it: svn co svn://seul.org/svn/pygame/branches/python3 The dependencies are the same as for Python 2.6 and found at: http://www3.telus.net/len_l/pygame/ Lenard Lenard Lindstrom wrote: Hi everyone, An update -- The surface, gfxdraw, display, key, mouse, image and imageext modules now compile with Python 3.1 on linux. All surface_test.py unit tests pass except for the get_buffer test since it has been disabled for now. The aacircle.py example runs. So that leaves these modules to do before the deadline: sprite - sprite.py time - time.c transform - transform.c mixer - mixer.c mixer.music - music.c font - font.c Lenard. Lenard Lindstrom wrote: Hi, I am proposing a game plan for getting a basic Pygame for Python 3.0. First the goal could be to get the chimp.py and aliens.py examples working. So the following modules are needed: pygame - __init__.py (done) sprite - sprite.py image - image.c, imageext.c locals - locals.py display - display.c event - event.c mouse - mouse.c key - key.c time - time.c transform - transform.c mixer - mixer.c [*] mixer.music - music.c font - font.c base - base.c (done) surface - surface.c (partially done [*]) surflock - surflock.c (done) rect - rect.c (done) color - color.c (done), colordict.py (done) constants - constants.c (done) rwobject - rwobject.c
[pygame] Thank You
I just wanted to thank everyone that worked on helping me and others with our applications, and I also wanted to thank all the people that worked hard on approving the applications. Your efforts are appreciated. :) On that note, I was wondering who would be my mentor, for my project? -Tyler Laing -- Visit my blog at http://oddco.ca/zeroth/zblog
[pygame] PyGame Website Rewrite
Hello, Even if it was not selected as a project for GSoC, I would like to do the pygame website rewrite. Like the other applicants, I'd do that with Django. Now that there can not only be one student/participant, it would be cool to work together and combine forces. Since I applied for GSoC, I've already made a small concept. Merging multiple implementing-/design ideas may become difficult, but before I go into detail just say me if you are interested. Regards Jug
Re: [pygame] PyGame Website Rewrite
I had applied to same project too. I was thinking same idea it can be good to work with a team. I'd like to join. 2009/4/21 jug j...@fantasymail.de Hello, Even if it was not selected as a project for GSoC, I would like to do the pygame website rewrite. Like the other applicants, I'd do that with Django. Now that there can not only be one student/participant, it would be cool to work together and combine forces. Since I applied for GSoC, I've already made a small concept. Merging multiple implementing-/design ideas may become difficult, but before I go into detail just say me if you are interested. Regards Jug
Re: [pygame] PyGame Website Rewrite
Hoi, Tobad that the rewrite of the pygame website wasn't accepted as a GSUC project. But I think it would be a good idea to rewrite the site anyway, since the current site is a bit outdated. Maybe someone should put up a project page (wiki?). Here are some random ideas: * I really like the django site, since the code is available under GPL we can base our site on that consept. code: http://code.djangoproject.com/browser/djangoproject.com * I think Trac would be usefull replacement for the current wiki and viewcvs, maybe in combination with git? http://nanosleep.org/proj/trac-git-plugin/ * A better separation between documentation, news, projects and development. Grtz On 21-apr-09, at 22:38, jug wrote: Hello, Even if it was not selected as a project for GSoC, I would like to do the pygame website rewrite. Like the other applicants, I'd do that with Django. Now that there can not only be one student/participant, it would be cool to work together and combine forces. Since I applied for GSoC, I've already made a small concept. Merging multiple implementing-/design ideas may become difficult, but before I go into detail just say me if you are interested. Regards Jug
Re: [pygame] PyGame Website Rewrite
Hi, Certainly revisions are in order. As a personal opinion, I like the general layout/theme as is--but things like the documentation are out-of-date and faulty (for example, http://www.pygame.org/docs/ does not link to pygame.color, among other modules). A few projects have been in the spotlight on the main page for months, etc. Ian
Re: [pygame] PyGame Website Rewrite
Is the current documentation dynamic through the current release? 2009/4/22 Ian Mallett geometr...@gmail.com for example, http://www.pygame.org/docs/ does not link to pygame.color, among other modules Ian
Re: [pygame] PyGame Website Rewrite
I don't know, but I think so. You have to click on some of the modules to get the correct toolbar on top, though.
beginning GSOC preparations: was Re: [pygame] Thank You
Hi Tyler, I'm going to be your main mentor, with Marcus, and Nirav being backup/co-mentors. To start preparing for your work, here's a few things you can do... - make sure you can compile pygame. - see the wiki for instructions for your platform(s) - http://pygame.org/wiki/Compilation - as pygame is multi platform, you'll have to work on multiplatforms too. - prepare a separate platform to work on if you can. Like setting up linux if you don't have it already. - not entirely necessary, but it'd make things easier for yourself. - set up your blog, which you'll be writing about your project as you go. - mark related posts with tags pygame, python, gsoc2009 - add your blog to this wiki page: - http://www.pygame.org/wiki/rsslinks - email the pygame mailing list about your blog (once you have at least one related post). - email the soc2009-general with your blog details, and ask them to list your blog on soc.python.org. - if you don't have a blog already, you can set up a free one with blogspot.com or wordpress.com. - prepare a reading list. - start looking at some related materials to read. - like for ffmpeg, read through some of the development mailing list, and development docs etc. - if you haven't used svn before much, read some of the svn book. - svn commit access. - I'll have this arranged. - first, post a patch to some small change to the mailing list, with svn diff your-patch.diff cheers, On Tue, Apr 21, 2009 at 11:46 PM, Tyler Laing trinio...@gmail.com wrote: I just wanted to thank everyone that worked on helping me and others with our applications, and I also wanted to thank all the people that worked hard on approving the applications. Your efforts are appreciated. :) On that note, I was wondering who would be my mentor, for my project? -Tyler Laing -- Visit my blog at http://oddco.ca/zeroth/zblog
Re: [pygame] C/C++ and Python
On Tue, Apr 21, 2009 at 4:20 PM, Knapp magick.c...@gmail.com wrote: Have you seen this? http://arstechnica.com/open-source/news/2009/03/google-launches-project-to-boost-python-performance-by-5x.ars yes, that's a nice goal. I hope it does well! Also this makes the python speed point very well. One last thing I would add is that code speed is often not needed anymore. I have never in the last 10 years had to worry about code speed while writing a simple 2d game like pong, tetrus, defender, donky kong or anything else like that. Yeah, most of the time you don't need it. But when you do, some problems become impossible to solve within a given time, so in those rare cases it's good to have ways available to you. http://www.scipy.org/PerformancePython That link is interesting for the comparison down the bottom. One other comparison that could be added is a C version available in a library... which pygame does include a C version in pygame.transform.laplacian. It's not the same code, because it works on surfaces, not general matricies but pretty close. It's also interesting as laplace is also a commonly used benchmark for GPGPU processing. You can use a version written in python using pygpu or pycuda which looks almost identical to the numpy version... and get a 100x speed boost. The performance related thing is that there is a gsoc project this year to make SSE/mmx speedups to numpy at runtime.
Re: [pygame] PyGame Website Rewrite
The on-site documentation isn't automatically updated. Though it would be nice, it has become a lesser priority since the documentation is now bundled with the Pygame installer. For Python 1.9 just go into site-packages/pygame/docs to find them. Lenard Ian Mallett wrote: I don't know, but I think so. You have to click on some of the modules to get the correct toolbar on top, though.
Re: [pygame] C/C++ and Python
For a pro programmer this python lack of speed is bad but for a newbie, I think it can be really good as it forces him to think about good Python code and good programming technique. I know it is what has forced me to become Pythonic and grow out of my C code techniques that I really learned while doing 6502 assembly and C64 basic back in the 80s. -- Douglas E Knapp Why do we live?