Archived

This topic is now archived and is closed to further replies.

Frame rate

This topic is 6645 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Have you tried running it through the profiler to see what is occupying the majority of your execution time?

Share this post


Link to post
Share on other sites
If you sent me the code i could have a look at it,im familiar with that library as well.Thou i don't use it. Otherwise what resolution is your game and what depth im guessing 8bit with that lib.

Share this post


Link to post
Share on other sites
Ohh i forgot my email is lordvar@in-tch.com if you want to send me it to take a look. Also whats up with the new status? Im not use to seeing me as a guru.

Share this post


Link to post
Share on other sites
I think the Guru thing comes from 50+ posts

(Which is dead silly, since 50 stupid questions (or answers for that matter) doesn't really make anyone much of a Guru, )

/Niels

Share this post


Link to post
Share on other sites
A thing to check is to make sure you compiled the program in RELEASE mode. The other thing to check is if you are using the Debug Runtime DirectX files - that will slow you down as well.

Share this post


Link to post
Share on other sites
The Dummies book is good, but it forgets some stuff. Have you looked where your surfaces a placed. If you have an old computer (P120) I recommend that you take the primary buffer in the Vram and the secondary and offscreen surfaces in system memory. If you have it in any other way will it become slow.

Share this post


Link to post
Share on other sites
By the way don't use FLIP if you only got a primary and a backbuffer. It is SLOW use bltfast instead.
And see if you can update pieces of the screen instead of the entire screen.

Share this post


Link to post
Share on other sites
Macke I belive you are incorrect about flipping. Flipping is almost always faster then bliting. Reason being because flip just exchanges pointers to the surface ,and doesn't have to copy all the information from the one surface to the other. Only reason it might be slower is because it normaly waits for the vsync before flipping. However you can tell it not to do this. Also as a final point even if flip isnt supported in the hardware it acts as a bltfast then.

Share this post


Link to post
Share on other sites
The game is full screen. I don't have it in release mode, but I don't think having no optomizations is an excuse for code this slow... I have to work on the speed in the code. I keep telling myself to put the surfaces in VRAM, but I also keep forgetting to. I do have the primary surface in VRAM though... I am using the standard (not debug) DirectX runtime libs.
Is there anything special I should try that would make it considerable faster?

------------------
http://qoy.tripod.com

Share this post


Link to post
Share on other sites
Yes, Flip can be faster. But I have never have experinced it. My computer seems to be in the same ballpark as Qoy. I have heard that the screen may flicker if you take away the Vsync from flip. But you are probably right. Everyone on the net says different things.

Share this post


Link to post
Share on other sites
Flip should always be what you use UNLESS you have specific knowledge that the computer / video card don't support flipping OR hardware accelerated blitting. The cool thing is this: If you use Flip() and you're on a nice machine and the back buffer is in video memory, the Flip operation takes NO time (because the internal pointers are just flipped). If the computer doesn't support true flipping but you still have the back buffer in VRAM, the Flip() will execute a Blt() utilizing the hardware accelerated blitting.

Basically, Flip() is your choice unless you know you have a less-than-high end computer with no hardware acceleration.

- Splat

Share this post


Link to post
Share on other sites
Splat: I'll back that up!

If you attempt to time flip(), remember that it will wait for e.g. blits to complete + for vertical blanking. So, timing flip() will almost certainly time more than just the flip operation.

/Niels

Share this post


Link to post
Share on other sites
If your back surface is in system memory I could see a Flip command taking more time than a BltFast command. Reason being that I think it uses the more generic and less optimized Blt command to do its drawing in such a case. Same could go for a video memory surface on a card that does not support hardware accelerated blting.

Share this post


Link to post
Share on other sites
My computer has only got 1mb Vram. I put my backbuffert in the systemmemory. Im not sure what happens when I use flip but blt is twice as fast as flip.

Share this post


Link to post
Share on other sites
I'm just wondering something that really doesn't belong here. You said you use a game engine from the book Windows Game Programming for Dummies. I was thinking of buying the new book from Andre Lamothé, which I've been told is just a longer version of Windows Game Programming for Dummies. Does the WGPFD have anything that Andre's new book hasn't?

Share this post


Link to post
Share on other sites
Hello. I have made a simple Space Invaders clone, and am now working on a PacMan clone. I have it so that the levels are tile based, and every object (wall, characters, food, etc.) takes up one tile. The level loads from a text file, and that works fine, but I am having trouble with the code to draw the level. What it does is cycle through the array of tiles 1 by 1 (there are about 20*20 tiles) and based on their type, it draws the correct image to the screen, in the correct coordinates. This works fine, but brings the frame rate down to a whopping 8 fps. Granted, I am using a slow 120 mHz Pentium, but it still shouldn't be that slow... I was wondering if anybody could give me any tips on how to speed up the framerate. I am using the game engine that came with Windows Game Programming for Dummies.
Any help is appreciated,
Jonathan Little

------------------
http://qoy.tripod.com

Share this post


Link to post
Share on other sites