• 13
• 18
• 19
• 27
• 10

# Puzzling Performance Problem

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

## Recommended Posts

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: 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 on other sites

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 on other sites
Quote:
 Original post by sirobHow are you loading the model? is it an .x File loaded with D3DXMESH?

Yup, .x with D3DXMESH.
Quote:
 Original post by sirobAre 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 on other sites
1. Can you show us some code? (inside source tags, check GDNet Forums FAQ)
2. Make sure you're not updating the framerate display in the window caption, because that's very slow.

##### 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#, 0D3DDevice.Clear 0, ByVal 0, D3DCLEAR_ZBUFFER, 0, 1#, 0ColCheckD3DDevice.BeginSceneFor 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 IfNext aD3DDevice.SetTransform D3DTS_WORLD, matWorldD3DDevice.SetTexture 0, FloorTexD3DDevice.DrawPrimitiveUP D3DPT_TRIANGLELIST, 2, Floor(0), Len(Floor(0))D3DDevice.SetTexture 0, WallsTexD3DDevice.DrawPrimitiveUP D3DPT_TRIANGLELIST, 8, Walls(0), Len(Walls(0))D3DDevice.EndSceneD3DDevice.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 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 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 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 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 on other sites
Quote:
 Original post by luke88I'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.