Jump to content
  • Advertisement
Sign in to follow this  
Roger Rabbit

Which language is best for a 3d Games Engine?

This topic is 4477 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 All I'm about to embark on a project to create a 3D Games Engine with some fellow programmers. I was wondering which language would be best to use for creating the engine; C++ or C#? The engine will be DirectX based, and aimed, for now, just for PC gaming. Thanks! -Andy

Share this post


Link to post
Share on other sites
Advertisement
If you want pure speed, go with C++. If you don't like dealing with pointers and want to use Managed DirectX, go with C#. It'll be pretty slow in C# though, so if you are planning to have a high-poly count and multi-pass techniques, forget it. For low-poly geometry, C# and Managed DirectX are OK.

Share this post


Link to post
Share on other sites
Quote:
Original post by deathkrush
If you want pure speed, go with C++. If you don't like dealing with pointers and want to use Managed DirectX, go with C#. It'll be pretty slow in C# though, so if you are planning to have a high-poly count and multi-pass techniques, forget it. For low-poly geometry, C# and Managed DirectX are OK.


Please do specify your source for this particular tidbit of misinformation.

OP: Either language will do, however, you will find that some languages are a lot easier to learn/use than others. C++ is not a newbie friendly language, and I would tend to recommend going with something else.

Share this post


Link to post
Share on other sites
Go with whatever language you know better. If you don't know either, follow Washu's sage advice. C++ is not a good choice for a beginner to learn.

MDX and C# are perfectly capable of doing high-performance, high-polygon count rendering. Many of the bottlenecks in graphics programming are logical (your culling sucks and you are rendering too much), unavoidable (ring-0 switch in the driver), or not CPU-bound (your shaders are too expensive). These are all language agnostic. The "performance overhead" inherent in managed languages and APIs (such as C#/MDX) will be insignifigant next to these.

MDX + C# does, however, give you a development-time speed increase assuming you are already familiar with the language and API (and even if you are not familiar you can often still develop quicker).

Share this post


Link to post
Share on other sites
C# is a wonderful language that is much more n00b friendly, and the above post about speed is completely incorrect. C# code is very fast, and "high poly counts" or "multi-pass techniques" are reliant on the speed of the video card far more than the speed of the code (given the code isn't terribly written, anyway).

To "others", please don't give advice when you don't know what you're talking about. Thank you.

Share this post


Link to post
Share on other sites
If you know either language (or any other compiled language; you can just as well write a good 3D game in Delphi, VB.net [not normal VB tho] etc), use that. If you know neither, use C# because it's far easier to learn and far more forgiving – it's much harder to write bad C# code than it is bad C(++) code.

C# is ever so slightly slower, but not noticably if you use Managed DirectX as all the work is being done on the GPU (outside your code) anyway. Don't worry about speed.

Share this post


Link to post
Share on other sites
I myself would use c++, because thats I use/know.

I dont know if c# is any slower, but you lose access to pointers, which might be a blessing or a curse. The examples that come with the directX SDK are both for: c#/c++ so that wont really matter.

Share this post


Link to post
Share on other sites
Quote:
Original post by Aiursrage2kI dont know if c# is any slower, but you lose access to pointers, which might be a blessing or a curse.


Not necessarily. At any time in C# you can drop into "unsafe" mode, and then you get access to all of your pointers again. For the code that has to be super-fast (image manipulation and such), this is a huge blessing.

Share this post


Link to post
Share on other sites
A better question to ask is why you want to create a 3D engine rather than learning to use a free one like Irrlicht or OGRE (though OGRE is more of a renderer than an engine) or a cheap one like Torque or C4. Unless you need a feature that none of them provide (and would be difficult to implement in them), can do a better job, and are sure you aren't suffering from not invented here syndrome.

Of course, if you want to do it for educational purposes, go ahead with it, you'll learn much. But if you want to make an actual game rather than an engine your time will probably be better spent leveraging existing tools.

Share this post


Link to post
Share on other sites
Quote:
and are sure you aren't suffering from not invented here syndrome.

But if you want to make an actual game rather than an engine your time will probably be better spent leveraging existing tools.


First, I'd like to point out that I get the feeling this guy is doing it for educational purposes. That being said...

Often "Not Invented Here Syndrome" is blamed, when in reality the learning curve of a full game engine is harder then just writing your own from scratch that fits your needs without the fluff.

I found that I could write a 2D game engine + physics in a fraction of the time that it took to learn Torque2D, and the interface was the way I prefer it. Sure, my engine doesn't currently support all of the features T2D has, but it supports all of the features that I need for my current project.

Using a commercial engine is a great idea if you need the feature set of the engine, and you can weigh the cost of getting up to speed with the engine VS writing your own. But it's not the end-all solution to the problem... what if you want to make Katamari Damacy? It really has it's own special set of challenges that required it's own engine to make it work efficiently. I had the same issue with Rumble Box, Torque + ODE would have been a nightmare.

One other example is a recent 2D puzzler that I worked on using the PopCap Developers Framework. Because my UI designs rarely function via the windows-like "standard", the framework ended up being a barrier as opposed to a boon, despite it's ease of use.

Use the right tool for the job :)

</rant>

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!