Game Speed - Just Curious

Started by
30 comments, last by Drizzt DoUrden 22 years, 3 months ago
I was just curious as to why when I make a small game like Pong, its incredibly slow, yet Baldurs Gate can draw 25 2D character bitmaps and very detailed backgrounds and it still runs pretty fast on my 200mhz cpu? The only logical reason I could think of is assembly, but I mean... how much of a difference could it really make? I've been thinking about this since I started OpenGL, and I never really had the chance to ask anyone (I don't know anyone who knows the answer), so here is the big question for those who know. Also, why is it that 3D applications run faster than 2D ones? Is it because of my video card? Thanks for any responses. Edited by - Drizzt DoUrden on December 17, 2001 9:23:06 PM
------------------------------Put THAT in your smoke and pipe it
Advertisement
it probably doesn''t have [much] to do with assembly... they are just better programmers than you (hey, don''t get mad, they''re better programmers than me too).
i heard that newer video cards are concentrating on 3D a lot, and newer ones either don''t, or soon won''t (i don''t know because i just read this in some other forum) support hardware 2D crap. i guess you can tell that i am no expert in this...

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
But I mean... my code resembles the code of who I learned from, the books I have read. I cannot see how different forms of organization could make my code so much slower than someone elses.
------------------------------Put THAT in your smoke and pipe it
What resolution are you running your pong game in? Most games like Baldur''s Gate run in 640x480 mode; I know Starcraft does. Also, having some real big picture would slow down your game since it absolutely blows away your fill rate.
Those games are highly tuned. If you asked a professional to rewrite your pong game you wouldn''t even recognize it afterwards.

------------
- outRider -
you say you are using opengl, yet you mention how baulders gate does fast 3d graphics. maybe its just me, but you are using the wrong api. also baulder''s gate if i remeber correctly ran in 8bit pallette mode which is MUCH faster then 16bit or higher. also since this is an older game, it most likly used dos for direct VRAM access.

so if you want to get comparible speed. you must:
1. use directdraw7
2. dont EVER read from VRAM
3. keep the resolution to 640x480
4. keep color depth at 8bit

that should be a good start.
the main reason 3d apps run faster, is because the 3d accelartor have more percieved video bandwidth due to archtecture. since when filling in the polys nothing except the triangle information and textures go across the bus. if done properly this transfer of data is only for the vertices required for the screen with some extras while the textures are kept in VRAM. now the card does all VRAM access internal across its own bus and does not have to go over the reletivly narrow apg/pci bus. this is why high res games are possible using 3d accelerators vs using software rendering which requires transfer the entire screen to the video card. you could of course make 2d apps that run faster then the 3d counterparts if you do many direct access effects which require messing with the video data at the pixel level which is limited on 3d hardware (pixel shaders are somethign entirly different and currently will not allow many effects possible in a pure software mode).

krez, video cards stopped increasing support for hardware 2d stuff awhile ago. which is why directdraw never got alphablending and rarly was updated (technically directdraw4 supports alphblending, but thats a special release meant for wince pdas). this is also why microsoft stopped including directdraw in directx8 since there was no need (just query for directx7 and you are set).
My guess is because they have a large team of very experienced, highly paid developers working on it around the clock, with access to little tricks learnt through years developing software.
quote:Original post by a person
maybe its just me, but you are using the wrong api.


Not to start another (X vs Y) flamewar, but yes, it''s just you.

Seriously, Drizzt - there''s a lot of things you can do wrong in OpenGL. Some really silly things such as only setting rendering states as little as possible, grouping similar primitives, changing texture bitdepths, and setting low-quality high-speed rendering options can help more than you think.

Sometimes, also, you''ll find that certain primitives are just too slow. Are you using textured quads to draw bitmaps, or are you using the pixel transfer functions? If the answer is the latter, try moving to the former!


People might not remember what you said, or what you did, but they will always remember how you made them feel.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
quote:Original post by a person
you say you are using opengl, yet you mention how baulders gate does fast 3d graphics. maybe its just me, but you are using the wrong api. also baulder''s gate if i remeber correctly ran in 8bit pallette mode which is MUCH faster then 16bit or higher. also since this is an older game, it most likly used dos for direct VRAM access.


Baldur''s Gate isn''t that old. It used DirectX.

"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
Yeah... there are so many minor mistakes or oversights a programmer can make, so that code looking very similar can actually execute a lot more slowly. If Pong is running slowly, I am sure you have done something ''wrong'' somewhere

This topic is closed to new replies.

Advertisement