Re: [pygame] PyObjc dependency replaced for pygame on Mac OS X

2009-01-25 Thread René Dudfield
Awesome!

For scrap, I've book marked a Mac OSX implementation written in objc
somewhere.  Once I find it I'll post a link, so we can get the scrap
working nicely on OSX.

cu.

On Sun, Jan 25, 2009 at 6:35 PM, Brian Fisher  wrote:
> Pygame 1.9.x no longer requires pyobjc on mac osX to build or install.
> People can get pre-release prebuilt installers for the new
> pyobjc-not-needing-pygame for 2.4 through 2.6 at the automated build page:
> http://thorbrian.com/pygame/builds.php
>
> If people could test with it (in particular using it with py2app) I'd
> appreciate it
>
> the builds don't have pyportmidi or scrap module support in them yet though.
>
>


Re: [pygame] Pathfinding

2009-01-25 Thread Bill Coderre


On Jan 25, 2009, at 7:16 PM, Yanom Mobis wrote:

1) How is pathfinding done?
2) How do you prevent a moving sprite from being caught in a v- 
shaped rut made of obstacles?  Like this:

   __
A  ->  # |  B
   __|


Where A and B are the points the sprite needs to travel,
# is the sprite,
-> is the direction the sprite is moving, and
_ and | are obstacles?


"Naive" algorithms often head directly toward a goal, and then get  
stuck when, in order to achieve the goal, they have to move away from  
it. Do some reading on "local maximum problem" and "hill-climbing  
algorithm."


The way to get out of this rut (heh heh) is to use a better algorithm.

For example, if you have a known map where the obstacles don't move,  
you can make a pre-computed route that your guy # walks along. That's  
an extremely popular way to do it, and it does really well for dungeon- 
y type video games. "Guard on patrol."


The super deee-luxe,  full-fat algorithm for when the obstacles/goals  
are moving is to use an algorithm that plots a complete route to the  
goal, every time, and move along the path.


There are still ways that this can get confused or beaten, of course.  
Until someone comes out with a low-cost traveling-salesman solver,  
however, whatever algorithm you find will have some snags. 


Re: [pygame] fast sqrt? and profiling

2009-01-25 Thread René Dudfield
ps.  it's not really worth micro-optimizing for your issues.  You'll
get the most speed up from using a good data structure... like a fast
quadtree or such.


   http://www.pygame.org/project/752/
   http://www.pygame.org/wiki/QuadTree


cu.



On Sat, Jan 24, 2009 at 5:18 PM, Jake b  wrote:
> Is there a py module that has a vector in c code? I would have thought that
> would be pretty common.
>
> Or is there not demand because you don't really need it using a physics lib?
>
> --
> Jake
>


Re: [pygame] Python 2.6

2009-01-25 Thread René Dudfield
Best to keep the python that your distribution supplies I think.

cu.

On Fri, Jan 23, 2009 at 10:08 AM, Yanom Mobis  wrote:
>
> thanks.
> and about installing 2.5.4 over 2.5.2?
> --- On Wed, 1/21/09René Dudfield  wrote:
>
> From: René Dudfield 
> Subject: Re: [pygame] Python 2.6
> To: pygame-users@seul.org
> Date: Wednesday, January 21, 2009, 9:15 PM
>
> hi,
>
> yeah, python 2.5 is the best python at the moment -- because it's more
> portable, and there are more libraries for it.
>
> Best not to overwrite your system python, as then it could break
> system tools.  It seems new enough to use :)
>
>
> chairs,
>
>
> On Thu, Jan 22, 2009 at 1:53 PM, Yanom Mobis  wrote:
>> Is there any good reason to switch to python 2.6, even though 2.5 is the
>> supported python on my Linux distro?
>>
>> If I do stick with Python 2.5, is it safe to override python2.5.2 with
>> python2.5.4 ( $ cd Python-2.5.4 && ./configure && make && sudo make install
>> )?
>>
>>
>>
>>
>>
>
>


Re: [pygame] Pathfinding

2009-01-25 Thread Noah Kantrowitz
1) People can, and do, get PhDs in pathfinding algorithms. A*  
(pronounced a-star) is the most commonly used algorithm in games though.


2) Alter the chain length score computation to reduce exploitation.

--Noah

On Jan 25, 2009, at 7:16 PM, Yanom Mobis wrote:


1) How is pathfinding done?
2) How do you prevent a moving sprite from being caught in a v- 
shaped rut made of obstacles?  Like this:

  __
A  ->  # |  B
  __|


Where A and B are the points the sprite needs to travel,
# is the sprite,
-> is the direction the sprite is moving, and
_ and | are obstacles?








[pygame] Pathfinding

2009-01-25 Thread Yanom Mobis
1) How is pathfinding done?
2) How do you prevent a moving sprite from being caught in a v-shaped rut made 
of obstacles?  Like this:
   __
A  ->  # |  B
   __|  


Where A and B are the points the sprite needs to travel,
# is the sprite,
-> is the direction the sprite is moving, and
_ and | are obstacles? 


  



Re: [pygame] pygame.midi using portmidi?

2009-01-25 Thread Brian Fisher
So I got pygame building on mac with portmidi now - although I can't seem to
get the midi.py example to do anything.

 the xcode proj for portmidi seems to have the porttime sources incorporated
into it, rather than built as a separate lib, so the porttime dependency
doesn't exist, which was causing trouble. Also the static libportmidi.a lib
requires linkage to the CoreMidi framework, which was also causing trouble.

So I decided to kill 2 birds with one stoney-hack and made PORTTIME
dependency be a dependency on porttime.

But now when I install the pygame on a machine with a midi keyboard
attached, and run examples/midi.py with either --output or --list, it waits
a long time, then prints "in stat: : No such file or directory" 4 times.

looking at portmidi's sources, that error seems to com from it trying to
read the "/PortMidi/PM_RECOMMENDED_INPUT_DEVICE" setting from some prefs
file "com.apple.java.util.prefs.plist" as part of it's initialization.

It seems really bizarre and rather dumb to me that portmidi would use java
for anything, and I'm starting to wonder if the thing even works on
Leopard...


On Tue, Jan 13, 2009 at 2:49 PM, René Dudfield  wrote:

> I think with portmidi, compiling it ourselves on mac is the way to go.
>  Seemed easy to compile on win/linux... so hopefully it compiles ok on
> mac too.
>
>