Jump to content
  • Advertisement

Archived

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

Pavel Krupets

C or C++ (OOP)

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

Hello. I know this is an incorrect question. But I read some articles about using C++ in games. In all of them I read about slow speed of games which use C++. HELP!!!

Share this post


Link to post
Share on other sites
Advertisement
Ehh, what do you want help with?

And no, C++ isn''t slow. Lots of games are written in C++ (Unreal Tournament comes to mind) and they''re not slow

Share this post


Link to post
Share on other sites
Nowday,the hardwares of the PCs are more and more high-level,and more and more cheaper too,so,the speed for a game or the other softwares is NOT the main problem at all...

But the OOP feature in C++ is very suit for the modern softwares,especial for a video game,it make the all object in a game become very easy to manage and organize,in general,you can create one class for each type game object,such as the NPC,leading actor,and the builder etc....

It will increase the efficiency for developing a big game more and more...

So,yeah,not wrong,use C++ to develop a game is a good idea

Share this post


Link to post
Share on other sites
C++ is pretty much the language of choice for games these days. I don''t know how all these articles you read could say that C++ is slow unless they are comparing it to assembly. Now if they are comparing C to C++, C++ can be said to be slower if you use its object oriented capabilities improperly. If you get crazy with class inheritance, it is my understanding that you will pay penalties in your program because of all the run-time type determination (I believe there is a more correct technical term for this, but I forget what it is) that is happening. For example, if you have a class GameObject in your game and then 10 other objects derived from that, and ten derived from those, and so on, and your functions take paramaters of type GameObject, your game''s performance will suffer because it has to constantly determine which derivation of GameObject you are actually passing. With the power of today''s personal computers, this isn''t too much of an issue, so be smart with inheritance and you will have all the speed you could possibly want (as long as your graphics routines are optimized, of course ;-))

Hope this helps...

Share this post


Link to post
Share on other sites
C is slightly faster than C++. But is it important? The overall productivity you get with C++ generally outweighs any speed drawbacks that C++ MIGHT incur.

Whoever wrote those articles must have something against the OO paradigm

Edited by - NuffSaid on December 1, 2000 2:36:42 PM

Share this post


Link to post
Share on other sites
I''m starting a crusade. I''m memorizing the FAQ of this board, and using link to it to answer every question that can be found in the FAQ.

Here''s some links, Pavel:
http://www.gamedev.net/reference/start_here/
http://www.gamedev.net/reference/start_here/#2
http://www.gamedev.net/reference/design/features/whatlang/
http://www.gamedev.net/reference/design/features/whatlang/page4.asp

Share this post


Link to post
Share on other sites
Well, it really depends on how good you are. Optimized ASM beats out any high level language, but its really how you use it. I could make something written in ASM run at 1 FPS, and C 30 FPS, maybe visa-versa, its how you use it.

Basically, make the decision on which language you think better suits you, C suits me well, and it certainly suits Carmack.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."

The Micro$haft BSOD T-Shirt

Share this post


Link to post
Share on other sites
Well, it really depends on how good you are. Optimized ASM beats out any high level language, but its really how you use it. I could make something written in ASM run at 1 FPS, and C 30 FPS, maybe visa-versa, its how you use it.

Basically, make the decision on which language you think better suits you, C suits me well, and it certainly suits Carmack.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."

The Micro$haft BSOD T-Shirt

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!