Page 7 of 10

Re: PÄSSION: object-oriented LÖVE

Posted: Thu Mar 25, 2010 1:52 am
by Gnx
I just wanted to say I find this project most intriguing. It's kind of my style of coding, coming from web stuff :)
One thing though, the platformer physics demo is extremely cpu intensive on my machine (an old +3000 AMD warhorse), the other demos/love games don't seem to do this. So I was wondering if there's some particular aspect about that demo that hogs cpu?

Re: PÄSSION: object-oriented LÖVE

Posted: Thu Mar 25, 2010 8:27 am
by kikito
Hi there!

Thanks for testing! Glad to hear that you are intriged :). Web development is also my primary stuff (ruby on rails, mostly). I inspired myself on the DOM box model for implementing the gui elements.

The only thing a bit different on the platformer is that collision detection is used. How are you detecting the "CPU intensiveness"? Is it just that the fan starts spinning, or did you make other measurements?

This said, PÄSSION isn't very efficient right now; It "works", but it isn't particularly optimized. Once I've got a feature complete release, I'll start making speed tweaks.

Anyway, I'll make a mental note to review the platformer.

Regards!

Re: PÄSSION: object-oriented LÖVE

Posted: Thu Mar 25, 2010 12:59 pm
by Gnx
I've got process explorer running on my machine, and I tested again and as soon as the "player" touches the ground the cpu-usage shoots up to 99%.
Also I can visually observe a slowdown in framerate when this has gone along for some time. Doesn't crash, but the cpu usage stays 85%-99% as long as the player touches anything in the world.

hope this helps somehow :)

Re: PÄSSION: object-oriented LÖVE

Posted: Thu Mar 25, 2010 11:07 pm
by kikito
It certainly looks related with the collision detection.

Probably I'm doing something wrong. It could be LÖVE, but I've learned not to underestimate these guys.

But I just can't put my finger on where the mistake is.

Anyone has any ideas, guys?

Re: PÄSSION: object-oriented LÖVE

Posted: Fri Mar 26, 2010 7:04 am
by bartbes
Well a quick glance over the code says you add every collision to a table, since a collision happens/persists every frame those are a lot of insertions, that might slow it down...

Re: PÄSSION: object-oriented LÖVE

Posted: Tue Mar 30, 2010 10:48 pm
by kikito
I believe that the problem is that I'm using the "continuous collision callback"... trouble is that I need to use that callback, otherwise the "touching point" with the ground isn't updated.

On other order of things, PÄSSION now is able to easily create multiple sources, and automagically chooses a "free" one when it needs to play the same source more than once (through passion.audio.play).

I've also released the first demo of pew pew BOOM!. Grab it while it's hot!

Re: PÄSSION: object-oriented LÖVE

Posted: Sun Apr 18, 2010 11:33 pm
by kikito
Update on PÄSSION.

New features:
  • Added a physics module. I had to do this so I could include a passion.physics.update(dt) function. This, along with other parameters, allows to decouple the physics update from the general game update. It's not a complete decoupling for now, I will have to re-visit this in the future. The original code for updating was borrowed from a post from pekka.
  • Renamed passion.ActorWithBody to passion.physics.Actor (still a subclass of passion.Actor)
  • I'm experimenting with using Lua's packages (module function). I'm not very satisfied with how they work. I might revert this change in the future.
  • Added a new ai module. For now it only includes a QuadTree.
QuadTrees are created with a with and height:

Code: Select all

local quadTree = passion.ai.QuadTree:new(3000,3000)
You then insert objects on them. Objects inserted on QuadTrees must have one method called getBoundingBox (returning x,y,with and height of the object).

Code: Select all

quadTree:add(object) -- object:getBoundingBox() must be implemented
When the object moves, it has to tell the quadTree:

Code: Select all

object:setPosition(x2,y2)
quadTree:update(object)
When an object is destroyed, it has to be removed from the quadTree:

Code: Select all

quadTree:remove(object)
QuadTrees also have a query method that return the objects that "are" (their boundingboxes intersect with) a rectangular region:

Code: Select all

quadTree:query(x3,y3,w3,h3) -- returns objects on that region, on an efficient way
Beware, that last function isn't tested yet!

For now you can see a rather pretty demo on pew pew boom's thread.

Re: PÄSSION: object-oriented LÖVE

Posted: Wed Apr 21, 2010 11:05 pm
by kikito
I've moved the PÄSSION repositories (as well as the MiddleClass ones) to github.

NEW PÄSSION DEVELOPMENT PAGE on github.

It now includes a README explaining how the modules work. Give it a look!

The QuadTree:query method has now been debugged and it works great.

I've made a module for colors. before: passion.white. Now: passion.colors.white. Sorry for the inconvenience.

By the way, I should add the ai module to the list of modules... done!

Going to bed now.

Re: PÄSSION: object-oriented LÖVE

Posted: Fri Apr 23, 2010 1:05 pm
by Geti
OP has a "cannot deliver file" error for me.
Looking at the github stuff now, I'll probably use this for ludumdare.

Re: PÄSSION: object-oriented LÖVE

Posted: Fri Apr 23, 2010 4:56 pm
by kikito
Geti wrote:OP has a "cannot deliver file" error for me.
Thanks for pointing that out. I'll try to upload an updated version during this weekend.

In the meantime, if you just need an example, pew pew BOOM! should do.