Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Chabba-Wabba

GFX Engine + Menu Engine -> Game Integration

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

Hi, I''m a beginner game programmer, but quite advanced in programming, (not soo hot at DX, Win32, _YET_). My biggest problem is to know where/when things get rendered. (1) Is rendering done straight to the video card backbuffers, or to in-memory buffers? (2) Do games like Starcraft and Red Alert update the entire screen every time they draw a frame? or are they updating parts of the screen ? (3) How _BAD_ is the performance hit if I were using dynamic structures instead of an array for entities in a game? (An array has CPU cache advantage, while dynamic entities arnt soo lucky). (4) How much better (read that as Quicker) is OO games compared previous generations of speed? (When I was a demo coder, 3-4 years ago... things on the OO front were slow... is it worth keeping an intensive game non-OO ?) Now, alot of these things I was asking were kinda game dependant. With a bit of profiling, things could be optimised. I''m thinking about starting off in the correct direction knowing some key problems before I get to them later. I hope that someone could answer my questions based on their experience. Thanks Chabba-Wabba (My new comic nickname, neat eh?)

Share this post


Link to post
Share on other sites
Advertisement
Object-oriented programs are almost exactly as fast as normal C programs, and could concievably be faster if less code had to be stored in memory. The only thing that makes them a slight bit slower is that each function called is passed the this pointer -- but the slowdown is still negligible.

"The wise make proverbs, and fools repeat them." -- ISAAC D'ISRAELI

lntakitopi@aol.com
http://geocities.com/guanajam/

Share this post


Link to post
Share on other sites
1) This depends on what you''re trying to accommlish. In DX, a back-buffer ("surface" in DX) attached directly to the primary surface and "flipping", is faster that blitting from a memory surface to a primary surface. I think this is what you were asking, in that respect at least.

2) I have an inside contact as Westwood Studios, so i could find that out for you!

3) The difference between dynamic and static structures really depends on what kind of engine you have. If you know for a definite fact that there will be no more than 100 enemies on a level at one time, than a static array is the choice, although it takes up memory that you might not be using. On the other hand, if you don''t know how many enemies (or objects) are going to be on a level (i.e. others are creating levels, etc.), then a dynamic array is really the choice, since you dont have to waste memory with a 1000 object array, not knowing how many objects there are (also the possibily there could be more than 1000 objects). -> To bluntly answer the questions, static arrays are faster than dynamic arrays (waster more memory, though), but the speed difference is only noticable with large numbers of objects.

3) OO things have become faster these days. Again, it all depends how good you are. OO is easier logically to work with since its easily understandable. However, if you can make an intensive game non OO, go with it, because its faster. If its helps, ill forword this post to my westwood contact. He can give you a load of information.

Share this post


Link to post
Share on other sites
1) if the card supports a hardware backbuffer, the rendering is done to the card''s backbuffer, otherwise to memory
2) tile based games can either only update the "dirty" tiles or the entire screen, it really depends on the game and how it''s implemented
3) the performance hit for, lets say, linked lists as opposed to arrays depends on a lot of things, the size of the structure, the size of the nodes (keeping them aligned to the 16 byte boundary including the next and previous pointers helps), how often the structure is accessed, the type of indexing (random or sequential), etc.. both have their uses. i store the vertices in an array, the polygons in a tree structure, the materials/textures in a hash table, the objects in a linked list.. everything has its use.
4) OO has nothing to do with speed. a properly written C program will be as fast as a properly written C++ program that does the same thing. it helps a lot with the program management and design though, and i don''t believe there has been a successful game that wasn''t written in C++ in probably at least three or four years.

-goltrpoat


--
Float like a butterfly, bite like a crocodile.

Share this post


Link to post
Share on other sites
Wow,

Thanks for the informative responses. I really appreciate the answers to the niggly questions which i''ve always wanted to ask.

Thanks
-Tim

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!