forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Blitting Speed
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Thu Apr 13, 2006 4:03 pm    Post subject: Reply with quote

Giuliano wrote:
that's what I had planned but I get FPS drop after 20 something blits.. that means that if I blit a few backgrounds + player I can only blit a few animated tiles + enemies.. that will really decrease the fun of the game


It is a good idea to use the Timer functions for movements instead hard coupling it to the vsync speed, because then it doesn't matter, if sometimes fps drops a bit, e.g. if there are many enemies on screen (the human eye notice flickers only below about 25 fps).
Back to top
View user's profile Send private message
Giuliano



Joined: 13 Sep 2005
Posts: 78

PostPosted: Thu Apr 13, 2006 10:08 pm    Post subject: Reply with quote

Shine wrote:
Giuliano wrote:
that's what I had planned but I get FPS drop after 20 something blits.. that means that if I blit a few backgrounds + player I can only blit a few animated tiles + enemies.. that will really decrease the fun of the game


It is a good idea to use the Timer functions for movements instead hard coupling it to the vsync speed, because then it doesn't matter, if sometimes fps drops a bit, e.g. if there are many enemies on screen (the human eye notice flickers only below about 25 fps).


Okay I don't quite understand what you mean. I understood 2 different things.

1) Leave drawing in the vBLANK loop but base movement on time (so it's always the same speed even if FPS drops)
or
2) Instead of using vblank, use the timer function to wait in between drawing and movement loops, getting rid of vblank totally from the code.

Can you clarify?
Thanks
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Thu Apr 13, 2006 10:13 pm    Post subject: Reply with quote

Giuliano wrote:
1) Leave drawing in the vBLANK loop but base movement on time (so it's always the same speed even if FPS drops)


Yes, this is it.
Back to top
View user's profile Send private message
Giuliano



Joined: 13 Sep 2005
Posts: 78

PostPosted: Thu Apr 13, 2006 10:38 pm    Post subject: Reply with quote

Shine wrote:
Giuliano wrote:
1) Leave drawing in the vBLANK loop but base movement on time (so it's always the same speed even if FPS drops)


Yes, this is it.


Okay so something like this (pseudo)

Code:

pixelspersecond=10;

while (true) do

      screen:clear()
      --do timer functions here to calculate FPS
      --do key functions here
      if (pad:right()) then player.x=player.x+(pixelspersecond/FPS)
      --do drawing
      --vblank and flip
      screen:waitVblankstart....screen:flip

end


In my test though, after 20 something blits there was a huge drop in FPS rate.. is that supposed to be ? because I could swear I have blitted more in the past without the FPS dropping so much.

Thanks
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Fri Apr 14, 2006 5:49 am    Post subject: Reply with quote

more like

while true do
--timer (for fps and display updates)
-- othercode
end

You dont have to update your display every time the loop goes through.
Updating the display drops your FPS overall to a huge huge low.


-- Cycles Per Second - The time it takes for the program to complete a full system loop.
Try only updating your display when needed. It significantly increases your CPS (Cycles per Second) by a ton.
You can upwards to 500 CPS if done correctly (Cycles Per Second)
Back to top
View user's profile Send private message
Giuliano



Joined: 13 Sep 2005
Posts: 78

PostPosted: Fri Apr 14, 2006 7:04 am    Post subject: Reply with quote

romero126 wrote:
more like

while true do
--timer (for fps and display updates)
-- othercode
end

You dont have to update your display every time the loop goes through.
Updating the display drops your FPS overall to a huge huge low.


-- Cycles Per Second - The time it takes for the program to complete a full system loop.
Try only updating your display when needed. It significantly increases your CPS (Cycles per Second) by a ton.
You can upwards to 500 CPS if done correctly (Cycles Per Second)


I can do something like that. If there is no change in player position, sprite position, etc.. then not draw but there most likely are changes during every cycle. ie: if player is moving, animations on screen, etc...
Back to top
View user's profile Send private message
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Fri Apr 14, 2006 7:15 am    Post subject: Reply with quote

10-12 FPS look almost instantanious.
Your eyes cannot see faster than that.
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Fri Apr 14, 2006 7:50 am    Post subject: Reply with quote

lol
so why are movies at 25fps and more?
human eye sees 25 pictures or more as motion, less is not smooth
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
romero126



Joined: 24 Dec 2005
Posts: 200

PostPosted: Fri Apr 14, 2006 8:36 am    Post subject: Reply with quote

I was exagurating to make a point.. 12 fps looks pretty good.. and is a pretty good output for LUA Player.
30 FPS btw is how fast the human eye can see. Sometimes 35 but its rare.
Back to top
View user's profile Send private message
DiabloTerrorGF



Joined: 15 Jul 2005
Posts: 64

PostPosted: Fri Apr 14, 2006 11:59 am    Post subject: Reply with quote

The FPS issue is talked about a lot. And the regular human eye can distuingish up to 120 FPS, although, you won't "see" a difference. There also pilots who can see above 180 fps, it's crazy.
Back to top
View user's profile Send private message
Giuliano



Joined: 13 Sep 2005
Posts: 78

PostPosted: Fri Apr 14, 2006 2:01 pm    Post subject: Reply with quote

I want to keep at least 40 FPS avg in my game. I think this will be easy if I manage my code well.
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Sat Apr 15, 2006 1:57 am    Post subject: Reply with quote

Movie theaters run at 60 fps if I am not mistaken. It was because of the very large screen for audience who sit closer. Smaller screen or deeper perspective would not make any difference with a lower fps rate. Does it make sense?
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sat Apr 15, 2006 2:41 am    Post subject: Reply with quote

Most movie projectors have a frame rate of 24 pictures per seconds: http://en.wikipedia.org/wiki/Movie_projector

But the shutter can have a higher frame rate, but this means only, that the same image is displayed 2 or 3 times. This reduces flickering. And this is the same for the PSP: you don't need to change the image every 1/60 second, because movements appear smooth with 24 fps and it doesn't flicker, because the display is updated 1/60 second, even if you don't change the image content.
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Sat Apr 15, 2006 2:59 am    Post subject: Reply with quote

More at http://en.wikipedia.org/wiki/Frame_rate

I am still learning in spite of my age. Sigh...
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group