Skip to main content
gamedev.net
🔒 Locked

Please try this

Started by lone_ranger 17 replies 2.2k views
Original Post
lone_ranger
lone_ranger
This is my first game attemp with VC++ and directx 8.1 by this time is only a terrain engine for a top-down racing game.Try this if you can and tell me your fps.Thank you url: http://www.geocities.com/nafpsoft/TerrainEngine.zip note: put all the files in the same folder. [edited by - lone_ranger on February 21, 2003 8:06:11 AM] [edited by - lone_ranger on February 21, 2003 10:33:35 AM]
Virtus junxit, mors non separabit
Jok
Jok
I have GeForce2MX200.There was 10-11 fps
Could you send me your future game on chern_v@rambler.ru.I''ll test it too. Thanks
Lord_Don
Lord_Don
Same gfx card here and a 1.1 ghz processor. I was getting 20 fps.
ctoan
ctoan
GeForce 4 TI 4200 and 1.5 ghz, I got 30 fps even.

Chris Pergrossi
< ctoan >
Chris Pergrossi< ctoan >My Realm
lone_ranger
lone_ranger
I can't understand why so low fps!!! even on these PCs! In on my pc P4 2.4, 512mb DDR, Geforce 4 Ti 4600 i get only 41 fps! here is my render function:

void GameEngine::Render()
{
int x,y,i=0;
for (x=0;x<=39;x++)
{
for(y=0;y<=29;y++)
{
p.x = (x <<4)+(x<<2);
p[i].y = (y << 4)+(y<<2);
r[i].top = 0;
r[i].left = (track.arrea[x][y]<<4)+(track.arrea[x][y]<<2);
r[i].bottom = 20;
r[i].right = (track.arrea[x][y]+1<<4)+(track.arrea[x][y]+1<<2);
i++;
}
}
gen_Graph.GetDevice()->Clear(0,0,D3DCLEAR_TARGET,D3DCOLOR_XRGB(0,0,255),0,0);
gen_Graph.GetDevice()->CopyRects(gen_Graph.GetTileSet(),r,1200,gen_Graph.GetBackBuffer(),p);
gen_Graph.GetDevice()->Present(NULL,NULL,NULL,NULL);
}



[edited by - lone_ranger on February 21, 2003 9:01:29 AM]
Virtus junxit, mors non separabit
Subotron
Subotron
Have you tried profiling your app? If not, enable it in MSVC++ to see what''s most time-consuming.

If it''s in the render loop, I think in has something to do with the << you use a lot. I don''t know what it does, I don''t know it, but the rest is not really cpu-intensive if you ask me. So maybe the << is really slow? If so try to find a way around using it. But you should really try profiling...

| Panorama 3D Engine | Contact me |
| MSDN | Google | SourceForge |
CommanderXXL
CommanderXXL
The << is just a bit shift opperator that should not be the problem. This is a very fast operation on any pc. I think it is the CopyRects Function. It copy a large amount of memory from main memory to grahpic card memory EACH frame. That is not a very good method of doing this. Maybe you try to set up a camera which you just "translate" through your world instead of filling it each frame with new data.

----------------------------
By CommanderXXL
Commander@bloomm.de
----------------------------
---------------------------- By CommanderXXLCommander@bloomm.de----------------------------
ofer
ofer
its not it, i guess. << and >> are bytes operators, and should be faster than regular multiplications and devides.
lone_ranger
lone_ranger
Thanks CommanderXXL, i thought and something else.What if each frame finding on which tiles are the cars and rendering only this tiles?
Virtus junxit, mors non separabit
lone_ranger
lone_ranger
Thanks guys!
Virtus junxit, mors non separabit
malpass
malpass
hi, i no wat the prob is, i made pacman and used the same style, someone mentions it up, u only reblit the tiles that have been overwritten with an image. If you do this u sometimes get nasty trails so u also blit the surrounding tiles, thats wat i did on pacman (http://www.xtremegaming.filetap.com)
aker_jus
aker_jus

gen_Graph.GetDevice()->CopyRects(gen_Graph.GetTileSet(),r,1200,gen_Graph.GetBackBuffer(),p);


This is some nasty stuff. It slows down the whole thing. Use TL vertices instead for making your ''2D'' things.
GraphicsWare|RenderTechhttp://www.graphicsware.com3D Graphics & Solutions
Andre Luiz Silva
Andre Luiz Silva
10 fps

PIII 550
GForce 4 MX 440
Windows 2000 - 352 MB RAM



"- To begin with, said the Cat, a dog''s not mad. You grant that?
- I suppose so, said Alice.
- Well, then, - the Cat went on - you see, a dog growls when it''s angry, and wags its tail when it''s pleased. Now I growl when I''m pleased, and wag my tail when I''m angry. Therefore I''m mad."
"- To begin with, said the Cat, a dog's not mad. You grant that? - I suppose so, said Alice. - Well, then, - the Cat went on - you see, a dog growls when it's angry, and wags its tail when it's pleased. Now I growl when I'm pleased, and wag my tail when I'm angry. Therefore I'm mad."
lone_ranger
lone_ranger
I remade my engine and now i am getting 90 fps!The problems was in the swap effect in present parametres it was
D3DSWAPEFFECT_DISCARD i made it DSWAPEFFECT_COPY_VSYNC and now i am remaking my engine with dirty rectangles.Whe n i uses the present function with DISCARD the non-changing tiles where flashing because as Microsoft says in the docs

D3DSWAPEFFECT_DISCARD will be enforced in the debug run time by filling any buffer with noise after it is presented.


Can you try the new version?

link:
www.geocities.com/nafpsoft/TerrainEngine.zip
Virtus junxit, mors non separabit
JoeyBlow2
JoeyBlow2
Do what aker_jus suggests.

CopyRects copies from system memory directly to the frame buffer. AKA, its not using 3d hardware rastering! Please setup XYZ_RHW vertexes and make them 2d polygons. Or use the SpriteClass, I believe thats the same thing but with a nice wrapper. That will use 3d hardware.

With a 2.4ghz 9700 Pro, you should be getting about 1000 FPS, not 62.
lone_ranger
lone_ranger
Thanks JoeyBlow2, i''ll try XYZ_RHW vertex with texturing.
Virtus junxit, mors non separabit
MattS423
MattS423
quote:

200fps on 1ghz GeForce2Go


ok, i think you''ve done enough optimumization...

at 200fps, even an elf wouldn''t see a trail...and thats on a mid-range computer with a mid-to-low-end graphics card.
Programmers of the world, UNTIE!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.