[Soya-user] Removing objects (with geom and mass) from a world completely

2008-10-14 Thread Mark Williamson
Hi there,

I have an object with .geom = a GeomSphere and .mass = a SphericalMass that I 
would like to be able to completely eliminate when destroyed in the game.

I've tried doing a self.parent.remove(self) call in the hit() function of that 
object but afterwards I continue getting further callbacks to hit(), 
suggesting that the geom (at least) for that object is still existing in the 
game world and registering collisions with things.

How can I completely eliminate this object from the game world?

Cheers,
Mark

PS. apologies if this appears twice, I accidentally sent it first from a mail 
account that isn't subscribed to the list.

___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user


Re: [Soya-user] How to stop the mainloop from a second thread?

2008-09-10 Thread Mark Williamson
Perhaps you could try yielding the CPU in begin_round occasionally to allow 
the other thread to run for a moment?  I'm not sure what the Python way to do 
this (not the yield statement, which does something else!).

Do you *really* need two threads here, or could you perhaps incorporate thread 
2's job into the main loop somehow?

Cheers,
Mark

>
>
> What would be your solution to stop the soya-thread from a second one,
> without losing performance in the rendering?
>
>
> Cheers,
>
> Bastian


___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user


Re: [Soya-user] Rotating, questions about basics.

2008-06-29 Thread Mark Williamson
Where is the box?  Is it just at the origin of its parent world?

> After a brief chat with a few on the IRC, I thought I'd further specify
> what I'm trying to do:
>
> Let this be the top view of a box (which one day may be the base of a
> miniature counter).
> 12
>
> 34
>
> I want to pivot this box around the Y axis but centered using either
> vertex 1 or 2 such that after a 90 degree rotation (chosen because its
> easier in ASCII):
>
>   3--1
>
>   4--2
>
> Note that 2 is at the same position as before the rotation. So, if 2's
> coordinates was originally (0.5, 0, 0), the line defined by the points:
>
> a = soya.Point(self.parent,0.5,0.0,0.0)
> b = soya.Point(self.parent,0.5,1.0,0.0)
>
> should intersect both 2 and the vertex under. However, the line
>
> self.rotate(proportion * 5.0, a, b)
>
>
> doesn't rotate the box but instead make it spiral out of view.

It sounds really like your co-ordinates are somehow confused, as you noted 
elsewhere it seems like the origin of the rotation is far away.  If your cube 
wasn't at 0,0,0 in the parent world, that would cause this kind of problem 
for instance.

More general code, which might also fix this bug, could specify the axis of 
rotation in terms of your cube's co-ordinate system - then it would work 
anywhere.

So you'd do soya.Point(self, ) to 
define the points on the axis of rotation.  Then wherever you move the cube 
in the parent world, you can always use this axis to rotate around that edge 
of the cube.

> Interestingly, for:
>
> a = soya.Point(self.parent,0.0,0.0,0.0)
> b = soya.Point(self.parent,0.0,1.0,0.0)
>
> works as expected (same as rotate_y). while the almost identical

OK, that does seem strange given the other results.

Cheers,
Mark

> a = soya.Point(self.parent, 0.001, 0.0, 0.0)
> b = soya.Point(self.parent, 0.0,   1.0, 0.0)
>
> Propels the box toward in the -Z direction exptremely fast (which
> suggest a very, very far away axis of rotation.) I figured that out by
> multiplying proportion by 0.001 instead of 5.0.
>
> I'm assuming that I'm missing something, but this behaviour is confusing
> to me.
>
> Christian
>
>
>
>
> ___
> Soya-user mailing list
> Soya-user@gna.org
> https://mail.gna.org/listinfo/soya-user



-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user


[Soya-user] OpenLander Game

2008-06-24 Thread Mark Williamson
Hi,

I've been working on a 3D gravity game called OpenLander.  It's currently in 
development and not playable (other than for testing purposes).  Would this 
be suitable for the "Projects Using Soya" page?  Maybe as part of an "In 
Development" section?

http://openlander.sharesource.org/

OpenLander uses the 3D graphics, sound and physics support of Soya.  The high 
level Soya3D API has been invaluable in rapidly developing the game.  It's 
intended to grow into a full campaign-based game with aspects of shooting, 
puzzles and physics-based gameplay.

The OpenLander engine is also a fairly general-purpose way to implement new 3D 
gravity games - there's another game in development by someone else that is 
already based on this engine.  I'll suggest he posts a message here at some 
point too...

Cheers,
Mark
-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user


Re: [Soya-user] rts-like game skeleton?

2008-03-25 Thread Mark Williamson
> I'm new to soya and I'm wondering if it is possible to have an rts-like
> game skeleton?
> This suppose a floating camera view with zoom and objects selected and
> controlled through mouse clicks.

Well, a basic skeleton like that certainly should be quite straightforward to 
code in Soya.

You could reuse code from the existing tutorials: the existing game skeletons 
would do OK to create a basic world with objects in.  You'd need to change 
the camera code so that it's movable independently of the objects.  There's 
code for moving the camera in existing tutorial examples.  One of the 
raypicking tutorials shows how to determine which object in 3D space the user 
is trying to click on with the mouse, that would do as a basis for your 
object selection...

Putting those together could get you an RTS-like game skeleton in not too many 
lines of code.

Cheers,
Mark

-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user


Re: [Soya-user] Event loss with Soya 0.13.2

2008-03-13 Thread Mark Williamson
Hi Souvarine,

Thanks for the reply.  I actually think I've tracked down the problem to a 
misuse of pudding on my part: I'd added pudding support in my code but not 
changed my controller code to read events from soya.MAIN_LOOP.events instead 
of soya.process_event().

The code was originally non-pudding and I added a few labels using pudding 
later on.  For some reason soya.process_events() still returned most (but not 
all!) events occurring.  Switching this to the proper pudding way of doing 
things seems to have solved [whatever the problem was].

I've looked at tofu for future online multiplayer but not used it yet.  I'm 
starting with the basics!

Thanks for your help,

Cheers,
Mark

On Thursday 13 March 2008, Souvarine wrote:
> First try to use soya 0.14rc. Make sure to compile it yourself with the
> lastest version of pyrex.
>
> I have seen a similar event loss problem once, it was when we all tested
> tofu on Internet. Nobody was able to reproduce that problem after that.
> Are you using tofu in your code ?
>
> Souvarine.
>
> Mark Williamson wrote:
> > Hi there,
> >
> > I'm having problems with mouse and keyboard events occasionally not
> > appearing when they should do.  When this happens, I see button down
> > events but not the expected button up event.  This also happens in the
> > opposite case (sometimes button downs are missed and I just get the "up"
> > event).
> >
> > This problem is occurring in a game
> > (http://www.cl.cam.ac.uk/~maw48/openlander/) I've been writing.  It
> > happens occasionally during otherwise normal play.  I'm not entirely sure
> > what causes it, although I do think it becomes more frequent when the
> > scene is more complex to render (e.g. if another spaceship is on the
> > screen, or if I switch to a model with a higher polygon count).
> >
> > I'm pretty sure my code isn't dropping any events that Soya gives it,
> > which suggests that soya.process_event() is somehow losing some events. 
> > Aside from this issue the game appears to be running nice and smoothly. 
> > Unfortunately, when a button release is lost, a control gets jammed on
> > and I often fly off the world :-)
> >
> > Can anybody give me a clue what might be the problem, or what I ought to
> > try next?  Perhaps there's just an event buffer I can enlarge?
> >
> > Cheers,
> > Mark
>
> ___
> Soya-user mailing list
> Soya-user@gna.org
> https://mail.gna.org/listinfo/soya-user



-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user


Re: [Soya-user] Event loss with Soya 0.13.2

2008-03-11 Thread Mark Williamson
Actually, to reply to myself, I suspect that Pudding is somehow disappearing 
the events - which quite possibly means I'm doing something wrong somewhere.

I'll let you know if I find evidence of any real problems, otherwise it's 
probably just me.

Thanks for the great software!

Cheers,
Mark

On Wednesday 12 March 2008, Mark Williamson wrote:
> Hi there,
>
> I'm having problems with mouse and keyboard events occasionally not
> appearing when they should do.  When this happens, I see button down events
> but not the expected button up event.  This also happens in the opposite
> case (sometimes button downs are missed and I just get the "up" event).
>
> This problem is occurring in a game
> (http://www.cl.cam.ac.uk/~maw48/openlander/) I've been writing.  It happens
> occasionally during otherwise normal play.  I'm not entirely sure what
> causes it, although I do think it becomes more frequent when the scene is
> more complex to render (e.g. if another spaceship is on the screen, or if I
> switch to a model with a higher polygon count).
>
> I'm pretty sure my code isn't dropping any events that Soya gives it, which
> suggests that soya.process_event() is somehow losing some events.  Aside
> from this issue the game appears to be running nice and smoothly. 
> Unfortunately, when a button release is lost, a control gets jammed on and
> I often fly off the world :-)
>
> Can anybody give me a clue what might be the problem, or what I ought to
> try next?  Perhaps there's just an event buffer I can enlarge?
>
> Cheers,
> Mark



-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user


[Soya-user] Event loss with Soya 0.13.2

2008-03-11 Thread Mark Williamson
Hi there,

I'm having problems with mouse and keyboard events occasionally not appearing 
when they should do.  When this happens, I see button down events but not the 
expected button up event.  This also happens in the opposite case (sometimes 
button downs are missed and I just get the "up" event).

This problem is occurring in a game 
(http://www.cl.cam.ac.uk/~maw48/openlander/) I've been writing.  It happens 
occasionally during otherwise normal play.  I'm not entirely sure what causes 
it, although I do think it becomes more frequent when the scene is more 
complex to render (e.g. if another spaceship is on the screen, or if I switch 
to a model with a higher polygon count).

I'm pretty sure my code isn't dropping any events that Soya gives it, which 
suggests that soya.process_event() is somehow losing some events.  Aside from 
this issue the game appears to be running nice and smoothly.  Unfortunately, 
when a button release is lost, a control gets jammed on and I often fly off 
the world :-)

Can anybody give me a clue what might be the problem, or what I ought to try 
next?  Perhaps there's just an event buffer I can enlarge?

Cheers,
Mark

-- 
Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/)

___
Soya-user mailing list
Soya-user@gna.org
https://mail.gna.org/listinfo/soya-user