Performance

Started by
18 comments, last by alexiev_nikolay 20 years, 7 months ago
I use C# and DirectDraw. I try my game on fast PC but with bad VideoCard (Riva TNT 8MB). My game is simple but have big sprites. I''m not shure but think that when I create surfaces they go to video memory. And when I use 3 or 4 big surfaces the speed is vary bad. From 72fps with 1 or 2 sprites go to 13 with 3 or 4 sprites. Can I optimeze my code. Is it better if I create surfaces before draw them? I also save an instance to Bitmap because I need to do hit detection. Is this a good idia to create surface from this bitmap evry time I want to draw to primery surface?
Advertisement
Yes you can optimize your code.

1. Don''t use c# or VB.
2. Learn how to spell.
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
I''m shure that this isn''t the only way
that flame was totally unneccessary
Was it?

Okay I suppose it was.


What do you mean by "Big Sprites?" Even on a tnt 2, you should still be getting more than 72 fps with 4 sprites.

I guess it''s hard to optimize code without knowing more. We are not mind readers here.

If you want to check per-pixel detection, then the best way to do it is saving it in sys memory.

Also, don''t use BMPs, use TGAs. BMPs just plain suck! You will gain a lot of performance if you use TGA''s. AND only save 1 instance of each tga, and reference it as needed.

This is all I can help with until I get more info.
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
1. I seriously doubt that the overhead of C# vs. C++ is the bottleneck here. We need more details about what you''re doing.

2. Your skills in English admirable. It''s a difficult language and I respect anyone who takes the time to learn it and express himself or herself in it. Please disregard ignorant Americans who are an embarrassment to the rest of us.

As for you, RhoneRanger: How''s your Russian? And how old are you, anyway?

--
Donavon Keithley
1st - I''m bulgarian not russian
2nd - I have 4 bitmaps, each 800x1200. What I load them to surface then speed is very slow. If I use only 2 bitmaps speed is very good.
If you will look back, you will see that I apologized.

I was not mad at the Russian, but that all the newbs here expect us to be mind readers, or help them with their MMORPG's.

I am sorry that I flamed alexiev_nikolay, but I thought he was also one of these 13 YR newbs who typed without caps or any skill at spelling.


Anyway, I still encourage you to dump C#, because using it with DX is incredibly slow(slower than VB).

EDIT: I also ask once again for some code snippets.


Cheers!

-Rhone

[edited by - RhoneRanger on September 25, 2003 2:54:37 AM]
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
quote:1st - I''m bulgarian not russian

Ah, then I should ask how his Bulgarian is.
quote:2nd - I have 4 bitmaps, each 800x1200. What I load them to surface then speed is very slow. If I use only 2 bitmaps speed is very good.

If these surfaces are 32 bits per pixel then each takes up 3.7 MB. With an 8MB card, only two can fit in video memory at a time. The slowdown you are experiencing would be explained (most likely) by the fact that they''re being transferred across the bus every frame.
quote:Anyway, I still encourage you to dump C#, because using it with DX is incredibly slow(slower than VB).

It''s certainly possible to use the MDX wrapper in such a way that you get inefficient performance. Given the lack of documentation, it''s not hard to do so. GraphicsStream for instance will kill you if you read/write small pieces of data through it.

But if you understand the issues and know what you''re doing, MDX can be very efficient -- much more so than the COM type library interop that you''d be using in VB 6 and earlier. (The perf of VB.Net should be nearly indistinguishable from C#.)

This topic is closed to new replies.

Advertisement