Re: [pygame] GSoC - Graph module?

2009-03-28 Thread Sanjay Nambiar
Of course its worth submission..and I agree to your point that it has got
wide range of applications..

On Fri, Mar 20, 2009 at 4:51 AM, Ira Fich  wrote:

> Hi all,
>
> I'm a fourth-year Compsci major at the University of Toronto, and I've been
> thinking about proposing a project for pygame in this year's GSoC.  I like
> the idea of an AI module, but I think that even more than that, pygame would
> benefit from a powerful, generic, dedicated graph module, containing a
> number of functions especially useful in a game context.
> This would be similar to some of the popular graphing modules like NetworkX
> and igraph, but optimized for games.  In addition to the standard graph
> analysis and manipulation, it would include plenty of AI functions,
> including A* and minimax search and Bayesian networks.  On top of that, it
> would support symbolic graphs (useful for anything with a regular structure)
> and be able to recognize and generate planar graphs (vital for maps).  And
> naturally, it would allow for complete customization of nodes (associating
> nodes with sprites, for instance) and the easy integration of user-defined
> functions.
>
> I envision something equally well suited to modelling a world map, a finite
> state machine, or a neural network.  It's likely that this would interact
> closely with the Improved Sprite and Scene System project, as well as the
> math module, and possibly the networking one as well; I expect I'd be in
> constant communication with the people from those projects, to ensure that
> everything fit together as smoothly as possible.
>
> So, what do you think?  Is this a good idea?  Can it be made better?  Is it
> worth submitting a proposal?
>
> Thanks,
> Ira Fich
>


[pygame] new dev tool... test/util/compare_docs.py | also gen_stubs.py

2009-03-28 Thread René Dudfield
hey,

I wrote this little tool for find out what is documented in a module and
what isn't.

So you can do this:

$ cd test/util/
$ python compare_docs.py pygame.sprite sprite.doc

Then it prints out what is not documented.  It also prints out if there are
docs for something that doesn't exist.

It searches for .doc files in lib/*.doc and then src/*.doc.





--
gen_stubs.py
---
Also of note, in case you missed it...  another tool from a while ago.


This time for generating empty test cases (Nicholas wrote it).

It's nice if you've got a module already, and need to write some tests for
it.





$ cd test/util/

Usage:
$ python gen_stubs.py ROOT

eg.

$ gen_stubs.py sprite.Sprite

def test_add(self):

# Doc string for pygame.sprite.Sprite:

...


Options:
  -h, --helpshow this help message and exit
  -l, --listlist callable names not stubs
  -t, --test_names  list test names not stubs
  -d, --docsget (more detailed) docs using makeref.py




cheers,


Re: [pygame] multi-width aalines and aacircles

2009-03-28 Thread René Dudfield
hi again,

Or for the draw stuff...
We could just include these two files:
src/SDL_gfx/SDL_gfxPrimitives.c
src/SDL_gfx/SDL_gfxPrimitives.h

Then use this in Setup
GFX = src/SDL_gfx/SDL_gfxPrimitives.c
gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)


I added those two files in that directory to svn for now.  So people should
be able to build it out of svn on linux/unix... and download binaries
(hopefully a couple of hours) from here:
http://thorbrian.com/pygame/builds.php

Committed revision 1980.


cheers,


On Sun, Mar 29, 2009 at 2:11 PM, René Dudfield  wrote:

> Hi,
>
> very cool module :)
>
> I uploaded some png's for people to see:
> http://rene.f0o.com/~rene/stuff/aapolygon.png
> http://rene.f0o.com/~rene/stuff/aacircle.png
>
>
>
> However, with ubuntu SDL_gfx I get this error:
>
> >>> import pygame.gfxdraw
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: /usr/lib/python2.5/site-packages/pygame/gfxdraw.so: undefined
> symbol: arcRGBA
>
> I guess arcRGBA isn't in the version I have... which is version 2.0.13 - a
> pretty a old SDL_gfx (current is 2.0.19pre).
>
>
> So... I'll try and start submitting bug reports to distros for them to
> update SDL_gfx.  However that won't help us for 1-2 years -- by the time
> they process the bug report, then finally get around to packaging the newer
> version - then time for people to upgrade their distros...  Also, I think
> we'll probably try and get some newer fixes into SDL_gfx, so for now
> including it with pygame is probably better.
>
> Instead, can we include SDL_gfx parts in with pygame?  including the whole
> directory in src/SDL_gfx/ .
>
> I changed Setup to this, which compiled and worked:
>
> GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c
> gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)
>
>
> Instead of including it in src/... we could put it in branch/SDL_gfx and
> put a svn external to src/SDL_gfx   (SDL_gfx doesn't appear to use public
> version control).  Or we could just include the needed files needed.  I
> think a branch with svn external to src/SDL_gfx would be best... then it's
> nicely separated.  Then when we release a source tar.gz/.zip we include it
> with the pygame sources.
>
>
> cheers,
>
>
>
>
>
>
>
> On Thu, Mar 26, 2009 at 6:33 AM, Lenard Lindstrom  wrote:
>
>> You can see for yourself:
>>
>> http://www3.telus.net/len_l/pygame/gfx_antialiasing.tar.gz
>>
>> Because of a bug aapolygon_gfx.py will not work with the gfx enabled
>> Windows binaries I have provide. The latest Pygame out of SVN is needed. But
>> you can still look at the images I took from a screen shot.
>>
>> Lenard
>>
>>
>> Lenard Lindstrom wrote:
>>
>>> The results actually look good though, if one first draws the outline,
>>> then the filled version. Circles not quit so good, but better than with no
>>> anti-aliasing.
>>>
>>> Lenard
>>>
>>> RB[0] wrote:
>>>
 You could do a filled polygon and then an aa one around it...
 But I think then you'd be getting a lot slower...

 On Wed, Mar 25, 2009 at 1:44 PM, Lenard Lindstrom >>> le...@telus.net>> wrote:

The aa polygon is not filled, and the filled polygon does no aa.

Lenard


René Dudfield wrote:

good idea.

there's an aa-polygon in sdl gfx


On Wed, Mar 25, 2009 at 5:38 PM, Greg Ewing
>>>> wrote:
Lenard Lindstrom wrote:

  Yes, but we still need an aaline algorithm
 with line
width.
Find an aa polygon algorithm and then use
 it to
draw line-shaped polygons.



>>>
>>>
>>>
>>
>> --
>> Lenard Lindstrom
>> 
>>
>>
>


Re: [pygame] multi-width aalines and aacircles

2009-03-28 Thread René Dudfield
Hi,

very cool module :)

I uploaded some png's for people to see:
http://rene.f0o.com/~rene/stuff/aapolygon.png
http://rene.f0o.com/~rene/stuff/aacircle.png



However, with ubuntu SDL_gfx I get this error:

>>> import pygame.gfxdraw
Traceback (most recent call last):
  File "", line 1, in 
ImportError: /usr/lib/python2.5/site-packages/pygame/gfxdraw.so: undefined
symbol: arcRGBA

I guess arcRGBA isn't in the version I have... which is version 2.0.13 - a
pretty a old SDL_gfx (current is 2.0.19pre).


So... I'll try and start submitting bug reports to distros for them to
update SDL_gfx.  However that won't help us for 1-2 years -- by the time
they process the bug report, then finally get around to packaging the newer
version - then time for people to upgrade their distros...  Also, I think
we'll probably try and get some newer fixes into SDL_gfx, so for now
including it with pygame is probably better.

Instead, can we include SDL_gfx parts in with pygame?  including the whole
directory in src/SDL_gfx/ .

I changed Setup to this, which compiled and worked:

GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c
gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG)


Instead of including it in src/... we could put it in branch/SDL_gfx and put
a svn external to src/SDL_gfx   (SDL_gfx doesn't appear to use public
version control).  Or we could just include the needed files needed.  I
think a branch with svn external to src/SDL_gfx would be best... then it's
nicely separated.  Then when we release a source tar.gz/.zip we include it
with the pygame sources.


cheers,






On Thu, Mar 26, 2009 at 6:33 AM, Lenard Lindstrom  wrote:

> You can see for yourself:
>
> http://www3.telus.net/len_l/pygame/gfx_antialiasing.tar.gz
>
> Because of a bug aapolygon_gfx.py will not work with the gfx enabled
> Windows binaries I have provide. The latest Pygame out of SVN is needed. But
> you can still look at the images I took from a screen shot.
>
> Lenard
>
>
> Lenard Lindstrom wrote:
>
>> The results actually look good though, if one first draws the outline,
>> then the filled version. Circles not quit so good, but better than with no
>> anti-aliasing.
>>
>> Lenard
>>
>> RB[0] wrote:
>>
>>> You could do a filled polygon and then an aa one around it...
>>> But I think then you'd be getting a lot slower...
>>>
>>> On Wed, Mar 25, 2009 at 1:44 PM, Lenard Lindstrom >> le...@telus.net>> wrote:
>>>
>>>The aa polygon is not filled, and the filled polygon does no aa.
>>>
>>>Lenard
>>>
>>>
>>>René Dudfield wrote:
>>>
>>>good idea.
>>>
>>>there's an aa-polygon in sdl gfx
>>>
>>>
>>>On Wed, Mar 25, 2009 at 5:38 PM, Greg Ewing
>>>>>> wrote:
>>>Lenard Lindstrom wrote:
>>>
>>>  Yes, but we still need an aaline algorithm
>>> with line
>>>width.
>>>Find an aa polygon algorithm and then use
>>> it to
>>>draw line-shaped polygons.
>>>
>>>
>>>
>>
>>
>>
>
> --
> Lenard Lindstrom
> 
>
>