Managed DirectX vs C++

Started by
33 comments, last by Saruman 18 years, 10 months ago
I should have also mentioned a little more about the engine I have been working on after work. As I stated the engine is written in native C++ but you could code the game in either C++ or C# and the tools such as the world editor, etc are actually built in C#.

Why? Because it is currently aimed at the PC / XBox and hopefully the Xenon if I can aquire licensing mid-2006.

Our project at work is PC only and therefore using a full C# engine was definately the way to go. If we were looking to put this title on consoles though it would have been a whole other ballgame. But even then it would be quite easy to port the engine to C++ if needed.. I mean its not like the language and coding is the hard part of building an engine by any means.

Also I don't quite agree with:
Quote:Original post by CProgrammer
Hehe yeah nobody likes change in the industry.

Because quite honestly I could name off 10 large studios that love change as long as it makes them more productive.. and the number of small-medium development houses enjoying it is probably staggering. A large portion of studios have actually already ported or have started porting all of their tools to C#.
Advertisement
Yes, very good points.

C# is optimized internally from the start. Making C++ optimized is a challenge.

C++ will not be going away anytime soon. Look at PHP and PERL in the linux world. Perl is just used too much in so many areas for Perl to just be pushed off the shelves because of another language. It IS a matter of choice.

However, It is very nice to know, since I am learning here more about C# and what it CAN do. That C# will become more of a standard and common place in all areas where C++ was concerned, including Game programming.

Since, games are the most complex, intense programming one can do, ( which you account for sound, graphics, user controls, hardware compatitbily and frame rates ) it is a great way to see just how POWERFUL and EFFICENT a language actually is.

Well, Im loving it when it comes to C#. Looks like its the way to go for all types of programming where C++ used to be.

C++ however is a beautiful langugage in itself. However, C# is just a wonderful evolution to C++. First A, B, C, C++, now the wonder which is C#.

Thanks for all the replies.. code on my friends! ANd good luck with all your projects.

Regards,Matt - digipanel.com
Quote:Original post by Saruman
Quote:Original post by Konfusius
C# should be fine for everything else except AAA titles.

Actually that is complete BS because if you look at the listing of the top selling AAA games the majority of them could have easily been built in C#.


Ok [looksaround]
I was saying that from a technological purists viewpoint ("C++ as high level assembler"). C# requires the .NET runtime with its minor drawbacks (another install, more memory needed at runtime). It isn't as portable as C++ (ok, there's MONO... but how mature is that?) I do believe it will be still a few years until C++ isn't used anymore for most AAA titles.
Quote:Original post by Konfusius
C# requires the .NET runtime with its minor drawbacks (another install, more memory needed at runtime).

Totally correct on these points. Although if the memory needed to boot the .NET framework is an issue for you than I'm not sure how you're going to even boot a native game unless you are trying to squeek real low min specs :)

I do highly agree with a drawback being the need to install the .NET framework on machines that do not already have it, and also something you did not mention but along the same lines which is getting the correct managed DirectX version installed. This is a moot point due to the bootstrapper and being able to install these things, but for games that are distributed online this does bump up the download package size.

Quote:
It isn't as portable as C++ (ok, there's MONO... but how mature is that?)

Please note the following is my personal opinion and not a fact, but I believe C# is meant for Windows application development and thats it. If I am making a game for PC only there is absolutely zero reason not to build it in C#.. but the second I need to cross platform than using C# or the .NET framework for that matter is no longer an option to me.

On another note you should read into what you are talking about first, as MONO is a very mature implementation of the .NET framework.

Quote:
I do believe it will be still a few years until C++ isn't used anymore for most AAA titles.

It really depends. I mean if the AAA titles are meant to be cross platform you are dead right, because targeting C# for development in that case is the wrong choice. On the other hand for studios making Windows PC only games my opinion is that C# is the only way to go in the future unless you are a large established company with backing and existing technology.
It's great to see how many people are backing C# for game development. I've been looking at integrating C# into my projects for awhile now, but it's usually been limited to tools programming as my school coursework requires C++ for projects.

It's great that you mention Reality Engine, Saruman. I was fortunate enough to sit through a demo of the engine at a presentation at school given by the President of Artificial Studios. I was ecstatic to see how well C# worked in a professional development environment.

Anyways, I've got a quick question as well, hopefully Saruman can field this one. I've been planning an engine for awhile, built using C++ but with the ability to be extended using C# or C++. I've yet to find any information about how to join the two together, whether it be extending the engine with C# or the other way around - embedding the engine in a C# tool like a level editor.

I'm assuming the answer to the latter is to access the engine in a DLL from a C# application, but as for accessing C# from C++, I have no idea where to begin. Any suggestions would be greatly helpful.

Thanks,
Matt Rudder
You in luck. C# does not use pointers by default. However you can use C++ code in C# code simply by assigning blocks of code with the keyword unsafe { C++ pointers and code here } and whoalla you have C++ code in C# application.

C# allows you to code with C# rules however you can at anytime move out of that with unsafe { } etc... check it out.
Regards,Matt - digipanel.com
Correct me if I'm wrong, but isn't the .NET runtime written in C/C++? And isn't ManagedDX is just a .NET wrapper for the C++ based DirectX? So surely there must be a slight performance issue when using the two languages, surely C++ and DirectX would be faster than C# and ManagedDX?

In terms of development ease, I appreciate that C# is probably quicker as you don't have to reinvent the wheel each time you want to make something.
"I just wanted to hang a picture on my wall, but somehow now I'm in the Amazon Jungle looking for raw materials." - Jekler
Personally, I'd love to get into some serious C# game development, but online distribution of the .NET Framework and the proper version of Managed DirectX is the brick wall that's stopping me. As mentioned above, the sizable amount that these add to the filesize of a game is enough to cut down your potential audience by a fair bit (dial-up users and other low-bandwidth folks).

Once Microsoft gets their helmet on straight and comes up with a better way for redistributing MDX, you'll definitely be seeing me on the C# gamedev scene. :)
That's my big problem. I don't want to use Managed DX. I'd like to stick to C++ to do all the base architecture - Graphics, Sound, Physics, etc. I want to be able to consume my engine from a C# Application (World Builder) and support the language for scripting. The Reality Engine does this exceptionally well. I've tried to make contact with the developers about how they used the .NET Framework to acheive this, but I've yet to hear back.
Yes, Im sure that future releases of the windows OS will of course have Managed Direct X built in.. it just needs time to become standardized.. all the complaining about it now makes no sense to me as we all know that C# is something good and WILL become standard over the years.. it just takes time.

For now the larger downloads and care take to make sure your C# game runs properly, or at all, is just standard procedure for any NEW technology.

sheeesh!

Regards,Matt - digipanel.com

This topic is closed to new replies.

Advertisement