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?
PÄSSION: object-oriented LÖVE
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: PÄSSION: object-oriented LÖVE
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!
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!
When I write def I mean function.
Re: PÄSSION: object-oriented LÖVE
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
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
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: PÄSSION: object-oriented LÖVE
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?
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?
When I write def I mean function.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: PÄSSION: object-oriented LÖVE
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...
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: PÄSSION: object-oriented LÖVE
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!
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!
When I write def I mean function.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: PÄSSION: object-oriented LÖVE
Update on PÄSSION.
New features:
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).
When the object moves, it has to tell the quadTree:
When an object is destroyed, it has to be removed from the quadTree:
QuadTrees also have a query method that return the objects that "are" (their boundingboxes intersect with) a rectangular region:
Beware, that last function isn't tested yet!
For now you can see a rather pretty demo on pew pew boom's thread.
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.
Code: Select all
local quadTree = passion.ai.QuadTree:new(3000,3000)
Code: Select all
quadTree:add(object) -- object:getBoundingBox() must be implemented
Code: Select all
object:setPosition(x2,y2)
quadTree:update(object)
Code: Select all
quadTree:remove(object)
Code: Select all
quadTree:query(x3,y3,w3,h3) -- returns objects on that region, on an efficient way
For now you can see a rather pretty demo on pew pew boom's thread.
When I write def I mean function.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: PÄSSION: object-oriented LÖVE
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.
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.
When I write def I mean function.
Re: PÄSSION: object-oriented LÖVE
OP has a "cannot deliver file" error for me.
Looking at the github stuff now, I'll probably use this for ludumdare.
Looking at the github stuff now, I'll probably use this for ludumdare.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: PÄSSION: object-oriented LÖVE
Thanks for pointing that out. I'll try to upload an updated version during this weekend.Geti wrote:OP has a "cannot deliver file" error for me.
In the meantime, if you just need an example, pew pew BOOM! should do.
When I write def I mean function.
Who is online
Users browsing this forum: No registered users and 5 guests