Jump to content
  • Advertisement
Sign in to follow this  
luke88

Puzzling Performance Problem

This topic is 4766 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

Image Hosted by ImageShack.us Basically, I load a map into my engine (DX8 in VB, running at 800x600) which just has a brick wall in it, and I get around 40FPS, which is enough for me. But when I add this tree, it drops to 6FPS. Even if I run it at 1152x864, I still get 6FPS. I know it's not because of the trees polycount (which is 10218), because I can load 8 of them into my old, unfinished engine (DX7RM in VB) and get 30FPS: Image Hosted by ImageShack.us I'm using hardware vertex processing, and when I switch it to software vertex processing, the 6FPS changes to 18FPS. Disabling the texture of the tree does not affect the FPS. I doubt my specs are causing it (I can play games such as HL2 or GTA:SA fine). So does anyone have any ideas what's going on?

Share this post


Link to post
Share on other sites
Advertisement
How are you loading the model? is it an .x File loaded with D3DXMESH?

Are you using VertexBuffers? What flags do you set when creating the buffers, and when locking them? Do you lock them each frame? Are you maybe creating them each frame?

Is VSync on?

Are you using the debug runtimes (I'm not sure this is available for visual basic, but if it is, are you?)?

Share this post


Link to post
Share on other sites
Quote:
Original post by sirob
How are you loading the model? is it an .x File loaded with D3DXMESH?

Yup, .x with D3DXMESH.
Quote:
Original post by sirob
Are you using VertexBuffers? What flags do you set when creating the buffers, and when locking them? Do you lock them each frame? Are you maybe creating them each frame?
Is VSync on?
Are you using the debug runtimes (I'm not sure this is available for visual basic, but if it is, are you?)?

Hmm.. I'm emabarrssed to say this, but I can't answer any of those questions, because I have no idea.

Share this post


Link to post
Share on other sites
What code would you like to see?
Here's the rendering code, it's a little weird though.

D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorXRGB(AmbientLight, AmbientLight, AmbientLight), 1#, 0
D3DDevice.Clear 0, ByVal 0, D3DCLEAR_ZBUFFER, 0, 1#, 0

ColCheck
D3DDevice.BeginScene
For a = 0 To ObjCount - 1
If ObjNotDraw(a) = 0 Then
D3DXMatrixTranslation MeshMatrix(a), ObjPos(a).X, ObjPos(a).Y, ObjPos(a).Z
D3DDevice.SetTransform D3DTS_WORLD, MeshMatrix(a)
D3DDevice.SetTexture 0, ObjTexture(a)
ObjMesh(a).DrawSubset 0
If nMaterials(a) > 1 Then
For b = 0 To nMaterials(a) - 1
D3DDevice.SetMaterial MeshMaterials(a, b)
D3DDevice.SetTexture 0, MeshTextures(a, b)
ObjMesh(a).DrawSubset b
Next b
End If
End If
Next a
D3DDevice.SetTransform D3DTS_WORLD, matWorld
D3DDevice.SetTexture 0, FloorTex
D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLELIST, 2, Floor(0), Len(Floor(0))
D3DDevice.SetTexture 0, WallsTex
D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLELIST, 8, Walls(0), Len(Walls(0))
D3DDevice.EndScene
D3DDevice.Present ByVal 0, ByVal 0, 0, ByVal 0



I've tried commenting out things such as the collision checking (ColCheck), textures, etc. to see how they affect perfomance, and they tend to make little or no difference.

Share this post


Link to post
Share on other sites
Have you checked debug output to make sure there are no errors? I use DX8 in VB also and its very helpful. You have to install the newest SDK (dx 9.0) and then change it to debug output in the control panel, and use a debug viewer... but if you're doing something really ridiculous it will tell you!

Share this post


Link to post
Share on other sites
I'm afraid to get the SDK. In order to download it, I have to first go through the Windows Validation thing, and because my computer came with Windows pre-loaded, I think it might fail. I'm afraid if it fails, they would stop Windows from functioning.

Share this post


Link to post
Share on other sites
Windows validation shouldn't fail on a pre-loaded machine unless it was pre-loaded with an illegal or shared copy which probably would have failed when you first activated windows.

Outside of that if the place you bought the computer from is illegally pre-loading stuff then you can go and bitch at them until they give you a real copy. If it was you that was borrowing a friends copy to just check out and evaluate you can always buy a copy. Trust me when you start writing your own games or apps you will want to support other developers by buying all the software you run. It makes it a lot easier to bitch about people copying your stuff :)

Share this post


Link to post
Share on other sites
I'd rather not take the risk.

Any other suggestions to as why my game is running so slow, and perhaps how I could fix it?

Share this post


Link to post
Share on other sites
Quote:
Original post by luke88
I'd rather not take the risk.

There is no risk.

If you have an authentic version of Windows with a COA seal than you own a legitimate copy of Windows and there is absolutely no reason to fail validation.

If you have a stolen copy of Windows and/or do not have a COA seal than the validation would fail and you would be denied the download.

You shouldn't be running an illegal copy of Windows anyways so you should just go through the validation, as that will tell you if you have a stolen copy or not. Although you most likely already know the answer to that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!