Jump to content

  • Log In with Google      Sign In   
  • Create Account


Frame rate


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
16 replies to this topic

#1 Qoy   Members   -  Reputation: 127

Like
Likes
Like

Posted 07 November 1999 - 08:05 AM

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



Sponsor:

#2 mhkrause   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 October 1999 - 08:10 PM

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

#3 Zenroth   Members   -  Reputation: 127

Like
Likes
Like

Posted 28 October 1999 - 09:14 PM

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.

#4 Zenroth   Members   -  Reputation: 127

Like
Likes
Like

Posted 28 October 1999 - 09:18 PM

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.

#5 Niels   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 October 1999 - 08:02 AM

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


#6 DireWolf   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 November 1999 - 06:56 AM

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.

#7 Macke   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 November 1999 - 07:50 AM

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.

#8 Macke   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 November 1999 - 07:56 AM

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.

#9 Gromit   Members   -  Reputation: 144

Like
Likes
Like

Posted 02 November 1999 - 07:56 AM

Is your game in a Window or full screen?

#10 Zenroth   Members   -  Reputation: 127

Like
Likes
Like

Posted 02 November 1999 - 09:44 AM

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.

#11 Qoy   Members   -  Reputation: 127

Like
Likes
Like

Posted 02 November 1999 - 06:28 PM

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



#12 Macke   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 November 1999 - 11:18 AM

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.

#13 Splat   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 November 1999 - 12:02 PM

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


#14 Niels   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 November 1999 - 01:10 PM

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


#15 Shinkage   Members   -  Reputation: 595

Like
Likes
Like

Posted 07 November 1999 - 07:29 AM

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.

#16 Macke   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 07:38 AM

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.


#17 ZomeonE   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 08:05 AM

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?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS