Re: [pygame] blit speedup

2010-03-28 Thread Olof Bjarnason
2010/3/28 Wakefield, Robert :
> I've made a tiling engine where tiles are stored as list of subsurfaces from 
> a texture surface, and the game map is stored as a list of tile indices.  The 
> problem is that I'm ending up with some slowdown even at low resolutions.  I 
> was wondering if anyone's run into this before and could offer suggestions.  
> The code I have in the map draw() function is:
>
>    for i in self.tiledata: # i is an integer, tiledata is a standard list 
> right now, will convert to an array for speed as the next step

Is your tile array larger than one screen?

In case it is, you want to limit this loop to include only the tiles
"touching" the current scroll-position of the player.

>        surf = dat[i]
>        sys.screen.blit(surf, (i, i)) # I would use real coordinates, the i, i 
> is just for speed testing
>
> In particular:
>    (a.) is there a way to speed up surface.blit()?  I've already used 
> surface.convert(), and from some of the tutorials hardware surfaces sound 
> problematic.

H/W surfaces should not really be problematic - pygame is based on
Simple Directmedia Layer (SDL) which has years of robustness on its
shoulders.

convert() creates a new surface, in the same RGB-format as the screen
surface, so H/W blit functionality can be used instead of real-time
conversion (which has to happen anyway, of course, to get the right
colors on the screen...)

>    (b.) Is there a way to call the blit function from inlined C code?  I've 
> seen the SciPy.blitz examples showing a massive speedup on similar loops by 
> doing this.
>
> Thanks in advance!



-- 
http://olofb.wordpress.com


Re: [pygame] write sound to file for fast loading?

2010-02-02 Thread Olof Bjarnason
2010/2/2 机械唯物主义 :
> emmm...
>
> large music file ---> longger loading time..
> the file is not buffered?
>
> can you post a sample code ?

Well I just asumed music was being streamed from disc in pygame.music:

import pygame
pygame.init()
pygame.music.load('some_file.ogg')
pygame.music.play()

I have never used pygame.music with .ogg files larger than 5 mb, so I
cannot say whether my assumption is valid or not.

What file format are you using?

>
> On Tue, Feb 2, 2010 at 3:24 PM, Olof Bjarnason  
> wrote:
>> 2010/2/2 B W :
>>> Howdy, folks.
>>>
>>> I have a problem I've been studying a while and I can't figure out a
>>> solution. Pygame or SDL--not sure which--is pretty slow at loading sounds.
>>> For large sounds, like songs, this means significant pauses in your game; or
>>> very long loading times at startup if you have a few of them to load.
>>
>> Tried pygame music?
>>
>> http://www.pygame.org/docs/ref/music.html
>>
>>>
>>> I tried using a thread to load a song, but as expected that only resulted in
>>> a very laggy game for the duration.
>>>
>>> So I was thinking it might be faster to pre-process a song: load it via the
>>> mixer, write the buffer to a data file, then later load it into an array and
>>> feed the array to the mixer. I can see that part of that idea is implemented
>>> in _sndarray.py, but I didn't really want to require numpy and I couldn't
>>> see how to convert that module's code to my purpose anyhow.
>>>
>>> I'm strikin' out. Is this even feasible, or is it a hair-brained scheme
>>> doomed to failure? Has anyone solved this problem, and would s/he be willing
>>> to share? :)
>>>
>>> Gumm
>>>
>>
>>
>>
>> --
>> http://olofb.wordpress.com
>>
>



-- 
http://olofb.wordpress.com


Re: [pygame] write sound to file for fast loading?

2010-02-01 Thread Olof Bjarnason
2010/2/2 B W :
> Howdy, folks.
>
> I have a problem I've been studying a while and I can't figure out a
> solution. Pygame or SDL--not sure which--is pretty slow at loading sounds.
> For large sounds, like songs, this means significant pauses in your game; or
> very long loading times at startup if you have a few of them to load.

Tried pygame music?

http://www.pygame.org/docs/ref/music.html

>
> I tried using a thread to load a song, but as expected that only resulted in
> a very laggy game for the duration.
>
> So I was thinking it might be faster to pre-process a song: load it via the
> mixer, write the buffer to a data file, then later load it into an array and
> feed the array to the mixer. I can see that part of that idea is implemented
> in _sndarray.py, but I didn't really want to require numpy and I couldn't
> see how to convert that module's code to my purpose anyhow.
>
> I'm strikin' out. Is this even feasible, or is it a hair-brained scheme
> doomed to failure? Has anyone solved this problem, and would s/he be willing
> to share? :)
>
> Gumm
>



-- 
http://olofb.wordpress.com


Re: [pygame] Is PyGame dying?

2010-01-27 Thread Olof Bjarnason
2010/1/27 René Dudfield :
>
>
> On Thu, Jan 28, 2010 at 1:47 AM, Olof Bjarnason 
> wrote:
>>
>> 2010/1/27 Thomas Ibbotson :
>> > 2010/1/27 Olof Bjarnason :
>> >> 2010/1/27 Jon :
>> >>>
>> >>> Personally I think PyGame is a wonderful API for building any sort of
>> >>> complex animation that is secondary to pure 3D.
>> >>>
>> >>> For example, building beautiful animated menus, or sub-games, or
>> >>> simply
>> >>> handling I/O, it fits like a glove.
>> >>
>> >> Sure, me too, but do you agree there is a certain uncertainty
>> >> concerning PyGame's future?
>> > If you look on the www.pygame.org website you'll notice that
>> > pygame2.0.0-alpha3 was released recently.
>>
>> Cool!
>>
>> >>
>> >> Is someone working on Python3, for example?
>> >>
>> > Yes pygame2/pgreloaded has Python 3.1 support.
>>
>> Nice, I admit I had missed this announcement on the web page.
>>
>> The impression that PyGame was dying came into my mind because a new
>> friend of mine asked about writing Python 2d-games, and that he too
>> had the impression PyGame was not actively developed. Also, my
>> sndarray-question was left undiscussed for five days. It still is left
>> undiscussed. That might however be due to the maintainer of sndarray
>> being on vacation or something, I guess.
>>
>> >
>> > Tom
>> >
>>
>>
>>
>> --
>> http://olofb.wordpress.com
>
>
> hi,
>
> yeah, there has been a bit of a slowing down in pygame development recently
> compared to 6 months ago.  Not quite dead... more undead... in zombie mode.
>
> The last pygame release was pretty draining for me personally... with 3
> students and other new developers joining... and the most changes of any
> pygame release so far.  I'm sure it was also draining for other pygame
> contributors too.  The pace was probably too hectic, and after a big push it
> takes time to recover before putting in another big effort (or perhaps going
> back to smaller efforts).
>
> The last couple of months have been difficult for me personally with moving
> countries, a death in my family, and a job change.  So in the past I've
> tended to help out a lot on the mailing list - and haven't been active so
> much recently.  However lots of other people also help out answering on the
> mailing list... I think most questions are being answered by people though.
>
>
> Here is a run down of things that have been happening in pygame development
> terms(that I know of)...
>
>
> Marcus has begun working on pgreloaded again, and made a release recently.
> Hopefully some of these changes can be ported to pygame as well.
>
> Lorenz has been working on his math branch (vectors and such) on and off.
>
> jug & co have been working on their website.
>
> Phil has updated his tinypy python implementation to tinypyC++.  So that it
> can compile a subset of python into C++ code that can run on the iphone.
> This means you can prototype your iphone game with pygame and then use
> tinpyC++ (with type hints) into an iphone game.  You can also target windows
> mobile phones with not too much extra effort.
>
> Pygame is now on other mobile devices, like moblin, nokia s60, pandora, and
> nokia maemo.
>
> A new pygame book has been released for free!
>
> 10-20 games are released on pygame.org every week.
>
> Other pygame related stuff I've been working on since 1.9.1 was released:
>     - SDL 1.2.14 was released (which addressed a couple of hundred bugs)
>     - numpy python3 port (I started on a port, and now there are a couple of
> people who have also begun on getting numpy ready for python 3).
>     - a bunch of website updates
>     - trying to get pygame updated in various distros - mainly through bug
> reports.
>     - getting a pygame category on pypi (this took over 8 months from when I
> first started trying and years from when pypi first started up).
>     - game distribution work (to make it easier for people to release their
> games on different platforms).
>     - investigating techniques to speed up pygame development.
>     - bug fixes/patches.
>
> SDL 1.3 work continues... but maybe this is the year 1.3 will be finished?
> In the mean time it's got a new nick name... 'SDL forever'.
>
> There's lots of other stuff going on around python... libraries and such
> being released.  Probably too much stuff going on for anyone to keep up
> with.  A lot of the interesting things are made aroun

Re: [pygame] mixer/sndarray voes

2010-01-27 Thread Olof Bjarnason
2010/1/27 René Dudfield :
>
>
> On Thu, Jan 28, 2010 at 3:44 AM, Olof Bjarnason 
> wrote:
>>
>> >
>> > For ubuntu you may have to compile from source, since they still haven't
>> > updated their package in time for ubuntu 9.10:
>> >     http://pygame.org/wiki/CompileUbuntu
>>
>>
>> Um a little too much wrong-kind-of-work to be fun.
>>
>
> yeah... hehe.  Well luckily you can pretty much copy/paste these lines to
> install.  So not too hard :)

Yeah, but the work with debugging such a "script" when it fails is
what is much work. Plus how it would severely mess up my system ;)

What linux dists' are you guys using, to get more up-to-date developer
versions of python+pygame etc.?

>
>
> #install dependencies
>
> sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev
> libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion
> libportmidi-dev
>
>
> svn co svn://seul.org/svn/pygame/trunk pygame
>
> cd pygame
> python setup.py build
> sudo python setup.py install
>
>



-- 
http://olofb.wordpress.com


Re: [pygame] mixer/sndarray voes

2010-01-27 Thread Olof Bjarnason
2010/1/27 René Dudfield :
>
>
> On Fri, Jan 22, 2010 at 7:31 PM, Olof Bjarnason 
> wrote:
>>
>> OS: Ubuntu 9.04
>> Python: 2.6.2
>> PyGame: 1.8.1release
>>
>> I'm trying to generate some sounds with pygame.
>>
>> I was hindered some by how to use sndarray - but it all got easier
>> once I set the mixer-init to easy/retro defaults.
>>
>> The first experiment was to just play a "sawtooth" wave:
>>
>> 
>> import pygame
>> import Numeric
>>
>> pygame.mixer.pre_init(11025,8,1,4096) #mono, unsigned, 8-bit sound. C64 ;)
>> pygame.init()
>> print pygame.mixer.get_init() # to make sure I got what I wanted, just
>> watch stdout
>>
>> pygame.sndarray.make_sound(Numeric.array(range(250)*100)).play()
>>
>> while pygame.mixer.get_busy():
>>        pygame.time.wait(200)
>> 
>>
>> 'python sndtest.py' produces slightly different audio each time.
>>
>> I improved readability a little, to find out where I did go wrong, and
>> to my great surprise, this *silenced* my speakers:
>>
>> 
>> import pygame
>> import Numeric
>>
>> pygame.mixer.pre_init(11025,8,1,4096) #mono, unsigned, 8-bit sound. C64 ;)
>> pygame.init()
>> print pygame.mixer.get_init() # to make sure I got what I wanted, just
>> watch stdout
>>
>> seq = range(250)*100
>> na = Numeric.array(seq)
>> snd = pygame.sndarray.make_sound(na)
>> snd.play()
>>
>> while pygame.mixer.get_busy():
>>        pygame.time.wait(200)
>> 
>>
>> 'python sndtest2.py' only produces a low-volume "spark" then nothing
>> each time run.
>>
>> What am I doing wrong here? There is no randomness in 'sndtest.py',
>> and 'sndtest2.py' should at least produce the same output, afaiks.
>>
>> --
>> twitter.com/olofb
>> olofb.wordpress.com
>
>
> hi,
>
>
> here's your example expanded with some of the details commented for you:
>     http://rene.f0o.com/~rene/stuff/sndtest2.1.py

Great!

>
>
> Please use a recent pygame.  sndarray has had bugs fixed since 1.8.1.

I see.

>
> For ubuntu you may have to compile from source, since they still haven't
> updated their package in time for ubuntu 9.10:
>     http://pygame.org/wiki/CompileUbuntu

Um a little too much wrong-kind-of-work to be fun.

>
> However, as of the 14th of jan 2010 it looks like ubuntu has pygame 1.9.1 in
> for the next ubuntu release (10.4)... :)

Great, at last! (however I'm seriously considering dumping Ubuntu for
Archlinux or something. Ubuntu are *too slow updating their package
databases* nowadays..)

>
>
> Also please use numpy instead of numeric... since numpy is the new numeric
> for the past few years.  The most recent sound array examples use numpy.
>

OK.

>
> It may also be worth searching on pygame.org for sndarray examples, and
> looking at the example that comes with pygame.  Also searching with google
> search turns up some results.
>
> http://www.google.com/codesearch?hl=en&lr=&q=file%3A\.py%24+pygame.sndarray&sbtn=Search
>

"file:" googling is neat! Didn't know of that, thanks.

>
>
> cheers,
>



-- 
http://olofb.wordpress.com


Re: [pygame] Is PyGame dying?

2010-01-27 Thread Olof Bjarnason
2010/1/27 Thomas Ibbotson :
> 2010/1/27 Olof Bjarnason :
>> 2010/1/27 Jon :
>>>
>>> Personally I think PyGame is a wonderful API for building any sort of
>>> complex animation that is secondary to pure 3D.
>>>
>>> For example, building beautiful animated menus, or sub-games, or simply
>>> handling I/O, it fits like a glove.
>>
>> Sure, me too, but do you agree there is a certain uncertainty
>> concerning PyGame's future?
> If you look on the www.pygame.org website you'll notice that
> pygame2.0.0-alpha3 was released recently.

Cool!

>>
>> Is someone working on Python3, for example?
>>
> Yes pygame2/pgreloaded has Python 3.1 support.

Nice, I admit I had missed this announcement on the web page.

The impression that PyGame was dying came into my mind because a new
friend of mine asked about writing Python 2d-games, and that he too
had the impression PyGame was not actively developed. Also, my
sndarray-question was left undiscussed for five days. It still is left
undiscussed. That might however be due to the maintainer of sndarray
being on vacation or something, I guess.

>
> Tom
>



-- 
http://olofb.wordpress.com


Re: [pygame] Is PyGame dying?

2010-01-27 Thread Olof Bjarnason
2010/1/27 Jon :
>
> Personally I think PyGame is a wonderful API for building any sort of
> complex animation that is secondary to pure 3D.
>
> For example, building beautiful animated menus, or sub-games, or simply
> handling I/O, it fits like a glove.

Sure, me too, but do you agree there is a certain uncertainty
concerning PyGame's future?

Is someone working on Python3, for example?

Is there anyone posing/blogging or similar on the progress of PyGame
development?

>
>
> Olof Bjarnason wrote:
>>
>> Sorry for the attention-starving subject - but I think this is an
>> important question to ask from time to time..
>>
>> Judging by the low frequency of discussions on this list, I find at
>> least one of the following statements trueish:
>>
>> 1) pygame is dying (no active development)
>> 2) this list is the wrong forum to ask questions
>>
>> If (1) is true - what is instead gaining traction for 2d-games
>> development in Python..? What are people using to develop small games
>> in Python? PyGame by far is the best achievement I've seen, with
>> support for PyOpenGL and all.
>> If (2) is true - where are the discussions going on?
>>
>>
>
>



-- 
http://olofb.wordpress.com


[pygame] Is PyGame dying?

2010-01-27 Thread Olof Bjarnason
Sorry for the attention-starving subject - but I think this is an
important question to ask from time to time..

Judging by the low frequency of discussions on this list, I find at
least one of the following statements trueish:

1) pygame is dying (no active development)
2) this list is the wrong forum to ask questions

If (1) is true - what is instead gaining traction for 2d-games
development in Python..? What are people using to develop small games
in Python? PyGame by far is the best achievement I've seen, with
support for PyOpenGL and all.
If (2) is true - where are the discussions going on?

-- 
http://olofb.wordpress.com


[pygame] mixer/sndarray voes

2010-01-22 Thread Olof Bjarnason
OS: Ubuntu 9.04
Python: 2.6.2
PyGame: 1.8.1release

I'm trying to generate some sounds with pygame.

I was hindered some by how to use sndarray - but it all got easier
once I set the mixer-init to easy/retro defaults.

The first experiment was to just play a "sawtooth" wave:


import pygame
import Numeric

pygame.mixer.pre_init(11025,8,1,4096) #mono, unsigned, 8-bit sound. C64 ;)
pygame.init()
print pygame.mixer.get_init() # to make sure I got what I wanted, just
watch stdout

pygame.sndarray.make_sound(Numeric.array(range(250)*100)).play()

while pygame.mixer.get_busy():
pygame.time.wait(200)


'python sndtest.py' produces slightly different audio each time.

I improved readability a little, to find out where I did go wrong, and
to my great surprise, this *silenced* my speakers:


import pygame
import Numeric

pygame.mixer.pre_init(11025,8,1,4096) #mono, unsigned, 8-bit sound. C64 ;)
pygame.init()
print pygame.mixer.get_init() # to make sure I got what I wanted, just
watch stdout

seq = range(250)*100
na = Numeric.array(seq)
snd = pygame.sndarray.make_sound(na)
snd.play()

while pygame.mixer.get_busy():
pygame.time.wait(200)


'python sndtest2.py' only produces a low-volume "spark" then nothing
each time run.

What am I doing wrong here? There is no randomness in 'sndtest.py',
and 'sndtest2.py' should at least produce the same output, afaiks.

-- 
twitter.com/olofb
olofb.wordpress.com


Re: [pygame] Pygame community platform?

2009-12-18 Thread Olof Bjarnason
2009/12/18 Olof Bjarnason :
> 2009/12/18 Thadeus Burgess :
>> I don't think I could live without the plethora of libraries available to
>> python :)
>>
>> What about playdeb.net / getdeb.net?
>
> Thanks for the links!
>
>>
>> Wouldn't it be easier if we packaged games for the OS package manager ?
>>
>> deb and apt-get can handle any needed dependences automatically.
>
> Yeah sure - but I would not regard them as easy to use. Learning
> debian packaging is like, well, learning another programming language.
>

.. plus that debian packages is limited to debian based systems. A
PygamePlatform program that downloads .py-files+media files is generic
and cross-platform in a quite true sense.

> If it was trivial to package Python+Pygame source games, this idea
> would not have survived from my neural net to this mailing list :)
>
>>
>> Then perhaps all that would be needed would be a GUI wrapper around the
>> package manager command line, that only includes pygame game packages. And
>> some utilities to help developers package their games.
>>
>> -Thadeus
>>
>>
>>
>>
>> On Fri, Dec 18, 2009 at 8:27 AM, Olof Bjarnason 
>> wrote:
>>>
>>> 2009/12/18 jug :
>>> > Hi Olof,
>>> >
>>> > Olof Bjarnason wrote:
>>> >>
>>> >> I have this crazy idea of making a "pygame community platform" to make
>>> >> distributing/finding/testing/installing pygames simpler.
>>> >>
>>> >
>>> > Interesting idea.
>>> >
>>> >> For end users, it would be a program to install, maybe called
>>> >> something like "PygamePlatform". It would provide a graphical user
>>> >> interface,
>>> >> for the ubuntu platform to begin with, since that is what I'm using.
>>> >> It would feature search/install/uninstall/run interaction.
>>> >>
>>> >
>>> > What do you do with dependencies? Include them to your game source?
>>> > Or add some often used 3rd party packages as extra projects?
>>>
>>> Ignore them? :)
>>>
>>> No I just thought Python+Pygame could be assumed. For example, the
>>> program itself could be written in Python+Pygame to make a flashy GUI,
>>> and of course then Python+Pygame would exst on the system for "pool
>>> games" to depend upon.
>>>
>>> Do many Pygame games depend on other third party libraries than
>>> Pygame? I have only used Python+Pygame+builtins so far. Python is so
>>> flexible I have not felt the need for any additional library.
>>>
>>> >
>>> >> Installing would mean downloading .py+bin files and placing them in a
>>> >> PygamePlatform local "games pool". Thus uninstalling is as easy as
>>> >> installing.
>>> >>
>>> >
>>> > Rene is working on something like this, but I think its more for bin
>>> > files
>>> > including python and all dependencies. So for people who do not know
>>> > python etc. but want to play your games. Is that what you want to do or
>>> > just making it easier for people with python to find and install pygame
>>> > games?
>>>
>>> Think of it as the find-install program of ubuntu; a little
>>> descriptive text and one or more screenshots, a link to a home page
>>> etc.
>>> A button to download game, a button to run (if the game exists in
>>> local game pool, that is has been downloaded).
>>>
>>> That would make it really simple to publish games, and let your
>>> friends test out the games.
>>>
>>> As a developer, you would simply manipulate the PygamePlatform wiki
>>> (or similar) to add your game to the database.
>>> The "game page" would include information of where to download the
>>> source+binaries of the game, plus the descriptive text + screenshots.
>>>
>>> So primarily: simplify publishing Python+Pygame-based games. And when
>>> that is simple, testing+feedback+quality comes along.
>>>
>>> For the end-users, they may think of the PygamePlatform program as
>>> Valve's Steam utility for Windows (and more platforms maybe?).
>>>
>>> But for free, casual-style primarily 2d-games. Like pygame games usually
>>> are :)
>>>
>>> >
>>> >> GUI: Much like Ubuntus add programs, combined with the start menu.
>>> >>

Re: [pygame] Pygame community platform?

2009-12-18 Thread Olof Bjarnason
2009/12/18 Thadeus Burgess :
> I don't think I could live without the plethora of libraries available to
> python :)
>
> What about playdeb.net / getdeb.net?

Thanks for the links!

>
> Wouldn't it be easier if we packaged games for the OS package manager ?
>
> deb and apt-get can handle any needed dependences automatically.

Yeah sure - but I would not regard them as easy to use. Learning
debian packaging is like, well, learning another programming language.

If it was trivial to package Python+Pygame source games, this idea
would not have survived from my neural net to this mailing list :)

>
> Then perhaps all that would be needed would be a GUI wrapper around the
> package manager command line, that only includes pygame game packages. And
> some utilities to help developers package their games.
>
> -Thadeus
>
>
>
>
> On Fri, Dec 18, 2009 at 8:27 AM, Olof Bjarnason 
> wrote:
>>
>> 2009/12/18 jug :
>> > Hi Olof,
>> >
>> > Olof Bjarnason wrote:
>> >>
>> >> I have this crazy idea of making a "pygame community platform" to make
>> >> distributing/finding/testing/installing pygames simpler.
>> >>
>> >
>> > Interesting idea.
>> >
>> >> For end users, it would be a program to install, maybe called
>> >> something like "PygamePlatform". It would provide a graphical user
>> >> interface,
>> >> for the ubuntu platform to begin with, since that is what I'm using.
>> >> It would feature search/install/uninstall/run interaction.
>> >>
>> >
>> > What do you do with dependencies? Include them to your game source?
>> > Or add some often used 3rd party packages as extra projects?
>>
>> Ignore them? :)
>>
>> No I just thought Python+Pygame could be assumed. For example, the
>> program itself could be written in Python+Pygame to make a flashy GUI,
>> and of course then Python+Pygame would exst on the system for "pool
>> games" to depend upon.
>>
>> Do many Pygame games depend on other third party libraries than
>> Pygame? I have only used Python+Pygame+builtins so far. Python is so
>> flexible I have not felt the need for any additional library.
>>
>> >
>> >> Installing would mean downloading .py+bin files and placing them in a
>> >> PygamePlatform local "games pool". Thus uninstalling is as easy as
>> >> installing.
>> >>
>> >
>> > Rene is working on something like this, but I think its more for bin
>> > files
>> > including python and all dependencies. So for people who do not know
>> > python etc. but want to play your games. Is that what you want to do or
>> > just making it easier for people with python to find and install pygame
>> > games?
>>
>> Think of it as the find-install program of ubuntu; a little
>> descriptive text and one or more screenshots, a link to a home page
>> etc.
>> A button to download game, a button to run (if the game exists in
>> local game pool, that is has been downloaded).
>>
>> That would make it really simple to publish games, and let your
>> friends test out the games.
>>
>> As a developer, you would simply manipulate the PygamePlatform wiki
>> (or similar) to add your game to the database.
>> The "game page" would include information of where to download the
>> source+binaries of the game, plus the descriptive text + screenshots.
>>
>> So primarily: simplify publishing Python+Pygame-based games. And when
>> that is simple, testing+feedback+quality comes along.
>>
>> For the end-users, they may think of the PygamePlatform program as
>> Valve's Steam utility for Windows (and more platforms maybe?).
>>
>> But for free, casual-style primarily 2d-games. Like pygame games usually
>> are :)
>>
>> >
>> >> GUI: Much like Ubuntus add programs, combined with the start menu.
>> >>
>> >
>> > A GUI wouldn't be a problem I think.
>> >
>> >> The database of pygames would reside on some wiki-like web page, so
>> >> pygame-developers could easily add their creations without any updates
>> >> to the PygamePlatform-installations out there.
>> >>
>> >> Of course this is a great deal of work, but provided it does
>> >> PygamePlatform could be ported to Windows, Mac etc. without any
>> >> changes to the wiki-database or the games themselves.
>> >>
>> >
>> > De

Re: [pygame] Pygame community platform?

2009-12-18 Thread Olof Bjarnason
2009/12/18 jug :
> Hi Olof,
>
> Olof Bjarnason wrote:
>>
>> I have this crazy idea of making a "pygame community platform" to make
>> distributing/finding/testing/installing pygames simpler.
>>
>
> Interesting idea.
>
>> For end users, it would be a program to install, maybe called
>> something like "PygamePlatform". It would provide a graphical user
>> interface,
>> for the ubuntu platform to begin with, since that is what I'm using.
>> It would feature search/install/uninstall/run interaction.
>>
>
> What do you do with dependencies? Include them to your game source?
> Or add some often used 3rd party packages as extra projects?

Ignore them? :)

No I just thought Python+Pygame could be assumed. For example, the
program itself could be written in Python+Pygame to make a flashy GUI,
and of course then Python+Pygame would exst on the system for "pool
games" to depend upon.

Do many Pygame games depend on other third party libraries than
Pygame? I have only used Python+Pygame+builtins so far. Python is so
flexible I have not felt the need for any additional library.

>
>> Installing would mean downloading .py+bin files and placing them in a
>> PygamePlatform local "games pool". Thus uninstalling is as easy as
>> installing.
>>
>
> Rene is working on something like this, but I think its more for bin files
> including python and all dependencies. So for people who do not know
> python etc. but want to play your games. Is that what you want to do or
> just making it easier for people with python to find and install pygame
> games?

Think of it as the find-install program of ubuntu; a little
descriptive text and one or more screenshots, a link to a home page
etc.
A button to download game, a button to run (if the game exists in
local game pool, that is has been downloaded).

That would make it really simple to publish games, and let your
friends test out the games.

As a developer, you would simply manipulate the PygamePlatform wiki
(or similar) to add your game to the database.
The "game page" would include information of where to download the
source+binaries of the game, plus the descriptive text + screenshots.

So primarily: simplify publishing Python+Pygame-based games. And when
that is simple, testing+feedback+quality comes along.

For the end-users, they may think of the PygamePlatform program as
Valve's Steam utility for Windows (and more platforms maybe?).

But for free, casual-style primarily 2d-games. Like pygame games usually are :)

>
>> GUI: Much like Ubuntus add programs, combined with the start menu.
>>
>
> A GUI wouldn't be a problem I think.
>
>> The database of pygames would reside on some wiki-like web page, so
>> pygame-developers could easily add their creations without any updates
>> to the PygamePlatform-installations out there.
>>
>> Of course this is a great deal of work, but provided it does
>> PygamePlatform could be ported to Windows, Mac etc. without any
>> changes to the wiki-database or the games themselves.
>>
>
> Depends on what existing tools and libs you use/ what you want to do
> You could also just write a wrapper for easy_install with a
> project filter/ own db with project names, a nice GUI and some additional
> game informations.
>
>> Feedback? Is there earlier projects that has tried (and failed) doing
>> this kind of thing?
>>
>
> Well, there is a pygame community platform/website with project listing:
>
> http://pygameweb.no-ip.org/
>
> Its still a beta/rc version, but it has an api (actually two: XMLRPC and
> REST,
> see the "more"-tab) that allows you to get some (maybe more soon) data
> about the projects. Currently you could use it for a "check for
> updates/newer
> version" inside your games/programs. It also gives you the download urls for
> bin and source files (if available).
>
> So if people would add their games to pypi and insert a game description and
> pypi-url/-name on the website, only the GUI would be left to do.
>
>
> Regards,
>
>  Julian
>



-- 
twitter.com/olofb
olofb.wordpress.com


[pygame] Pygame community platform?

2009-12-18 Thread Olof Bjarnason
I have this crazy idea of making a "pygame community platform" to make
distributing/finding/testing/installing pygames simpler.

For end users, it would be a program to install, maybe called
something like "PygamePlatform". It would provide a graphical user
interface,
for the ubuntu platform to begin with, since that is what I'm using.
It would feature search/install/uninstall/run interaction.

Installing would mean downloading .py+bin files and placing them in a
PygamePlatform local "games pool". Thus uninstalling is as easy as
installing.

GUI: Much like Ubuntus add programs, combined with the start menu.

The database of pygames would reside on some wiki-like web page, so
pygame-developers could easily add their creations without any updates
to the PygamePlatform-installations out there.

Of course this is a great deal of work, but provided it does
PygamePlatform could be ported to Windows, Mac etc. without any
changes to the wiki-database or the games themselves.

Feedback? Is there earlier projects that has tried (and failed) doing
this kind of thing?

-- 
twitter.com/olofb
olofb.wordpress.com


Re: [pygame] pySpy 1.1

2009-12-02 Thread Olof Bjarnason
2009/12/2 Thomas Ibbotson :
> Hi,
> I've released an alpha version of pySpy on launchpad
> (http://launchpad.net/pyspy). It has a whole new type of gameplay in it. I
> would appreciate any feedback anyone has.

Cool!

One short feedback: in the instructions page, the background gradient
(blueish) and the text (black) does not have much contrast, making it
hard to read.

Maybe use some lighter color for the text (the background looks nice!).

> Thanks,
> Tom



-- 
twitter.com/olofb
olofb.wordpress.com


Re: [pygame] Need names and nationalities for AI playes in new sport-game

2009-11-13 Thread Olof Bjarnason
2009/11/13 John Eriksson 

> *smile*
>
> I hereby promise to not use your names, nationalities or
> e-mailaddresses in any other way than to name the AI-players in Power
> Play (or whatever it might be called whenever it's done).
>

Do you mean that you *are* going to use our email adresses in the game
somehow?

I guess not (you are only after our names/nationalities, not emails), just
wanted to avoid the (potential) confusion in your statement ;)


>
> Best Regards
> /John Eriksson
>
> 2009/11/13  :
> >
> > Hi again.
> >
> > may I add that I assume that you *only* use our names and nationality.
> And *only* for this purpose.
> > Maybe this is just me being paranoid but I wanted to state clearly that I
> wouldn't want you to
> > publish any other stuff (eMail address for example) or for example sell
> the pygame-user statistics
> > to a third party.
> >
> > other than that. you still have my OK :)
> >
> >
> > On Thu, 12 Nov 2009 22:19:28 +0100, Lorenz Quack 
> wrote:
> >> Hi,
> >>
> >> John Eriksson wrote:
> >>>
> >>> I started to search the net to find inspiration for names and
> >>> nationalities to the AI-players. But then I thought it would be much
> >>> nicer to use the names and nationalities of pygame developers instead
> >>> of just using fictive names.
> >>>
> >>> [snip]
> >>>
> >>> If you wan't your name to apear as a AI-player in the game, please
> >>> send me your name (first + last) and your nationality.
> >>
> >>
> >> nice idea.
> >> Lorenz Quack, Germany
> >>
> >> looking forward to find my name in a game =)
> >
>



-- 
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english


Re: [pygame] Need names and nationalities for AI playes in new sport-game

2009-11-12 Thread Olof Bjarnason
Assuming you are from sweden John:

Helt fantastisk marknadsföringsidé! Här har du mitt namn: Olof Bjarnason
(Sverige).

2009/11/12 John Eriksson 

> Hi fellow pygame developers!
>
> I'm developing a sports game. It's a fictive sport played one-on-one,
> on ice against another human player or against a rather advanced AI.
>
>  As part of the game it is possible to create a career in the World
> Series against 40 (or so) AI controlled players.
>
> I started to search the net to find inspiration for names and
> nationalities to the AI-players. But then I thought it would be much
> nicer to use the names and nationalities of pygame developers instead
> of just using fictive names.
>
> All AI-players will have different skill levels wich is randomly set
> in the begining of a new World Series career. In one career your named
> character will be the best in the world, and in another it might be a
> rookie in Division 4.
>
> The game will be released as Freeware for both Linux and Windows. The
> source code will (as allways for my projects) be available once the
> game is done.
>
> If you wan't your name to apear as a AI-player in the game, please
> send me your name (first + last) and your nationality.
>
> Best Regards
> /John Eriksson
> http://arainyday.se
>



-- 
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english


Re: [pygame] Strangest thing..

2009-10-26 Thread Olof Bjarnason
2009/10/26 René Dudfield :
> hi,
>
> use this:
>    http://pygame.org/wiki/RunningInCorrectDirectory?action=view&id=113
>
> cheers,
>

Thanks, I might try this out if the problem re-occurs. Apart from the
above fixes from Christoph and Brian, I got some additional
DLL-problems, which I fixed by adding some extra DLL's into the
dist-dir in py2exe (SDL_ttf and freetype).

-- 
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english


Re: [pygame] License question regarding Windows platform

2009-10-25 Thread Olof Bjarnason
2009/10/25 Lorenz Quack :
> Hi,
>
> IANAL and I'm not very experienced with licensing so for what it's
> worth here is my understanding of the issue.
>
> Olof Bjarnason wrote:
>>
>> Is this OK:
>>
>> 1) make a downloadable .zip/.exe with no source code, neither pygame
>> nor game source
>> 2) include a "license.txt" explaining:
>>  a - the PyGame license and where to download source code
>>  b - where to download my game's source code (MIT-licensed, hosted at
>> Launchpad)
>
> Yes. I think that would be OK.
> First of all the code you wrote is yours and you can do with it whatever
> you like (e.g. distribute it as source or binary)
> PyGame is LGPL and as far as my understanding goes you can also distribute
> it in binary with your game as long as you mention its use and point to a
> place where one can obtain the code which is what you are doing with the
> "license.txt". I think you are only required to share any *changes* you
> made to the pygame source but if you only use it as a library you don't
> need to release your own code (I think that is the main difference between
> GPL and LGPL)
>
> again: take this with a grain of salt.
>
> yours
> //Lorenz
>

Thanks Lorenz, this was the answer I was hoping for ;)

And yes, I will take it with a grain of salt and see if someone else
on this list actually _is_ a lawyer heh.



-- 
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english


[pygame] License question regarding Windows platform

2009-10-25 Thread Olof Bjarnason
Hi!

I'm developing a small game with the help of python+pygame. I intend
to make the game available on, at least, Windows + Ubuntu platforms.

On the Ubuntu platform, I will go for a source-distribution, probably
building a source .deb package (which requires package-pygame), or
using Launchpads Personal Package Archive system (aka PPAs). I see no
license problem in this situation, where I will include the game's
source which is MIT licensed.

My question is about distributing the game to Windows users.

* I use pygame for text rendering (SDL_ttf), keyboard input and music (.ogg)

* I use py2exe to create a standalone Game.exe for the convenience of
Windows users (not having to install Python+PyGame)

* I have no intention to go commercial, it is a spare-time game project.

Is this OK:

1) make a downloadable .zip/.exe with no source code, neither pygame
nor game source
2) include a "license.txt" explaining:
  a - the PyGame license and where to download source code
  b - where to download my game's source code (MIT-licensed, hosted at
Launchpad)


-- 
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english


Re: [pygame] Strangest thing..

2009-10-25 Thread Olof Bjarnason
2009/10/25 Christoph Gohlke :
> I can reproduce this behavior on Windows 7, Python 2.6 64-bit, pygame
> 1.9.2.svn. Try comment out "pygame.init()".
>

Worked.

2009/10/25 Brian Fisher :
> Your script is not creating a window - various things may not work right
> without a window on windows.

Tried that too, and it worked too.

Thanks to both of you! This solved the py2exe dll issue too, so you
just made my day :)

Cya


[pygame] Strangest thing..

2009-10-24 Thread Olof Bjarnason
Hi pygame-users!

I'm new to the list, but not to Python/PyGame.

Tonight I tried playing some music, and noticed that my program only
would play sound if I doulble-clicked the .py file in an explorer
window, not if I ran the script from a command prompt. I'm on Vista,
Python 2.6.1 and Pygame downloaded today, the python 2.6-series.

I stripped down the script to a bare minimun to debug it, and the
behaviour still there in this tiny script which only uses the
"enter.wav" sound, built into windows.

### START tmp.py
import pygame
import os
import sys

pygame.init()
pygame.mixer.init()

print(pygame.mixer.get_init())
print(sys.version)
print(os.getcwd())

pygame.mixer.music.load("enter.wav")
pygame.mixer.music.play()

while True: pass
### END

I'm kind of lost as to what to do now to try to solve the problem, I'd
really like to know what I'm doing wrong, since I think this program
might be related to a show-stopping issue for me (DLL problems after
doing a py2exe build).

If any one would try and see if the error is still there on their
machines, I would be grateful. The "enter.wav" file should be located
beside the tmp.py script, and could be found using ordinary F3 search
on Windows.

Cya,

/Olof