Is it worth porting a small C # "engine" to C ++ or similar?

So, after the tutorial that I found on MSDN, I created what you might call a "engine" using DirectX and C #. I have not seen many such things (personally, that is) done in C #, and most seem to prefer C / C ++, so I am curious if using C # will come back to bite me, or should I just go forward?

The reason I ask is because the textbook stopped quite suddenly and therefore there is a basis for something, but it is small enough to be ported without much hassle. I like C # itself, but I don’t know if there is something that everyone knows that I do not.

+4
source share
5 answers

Well, Peter, the main reason is that C ++ is an agnostic of the platform, and C # is not in the true sense, despite Mono (I don’t think you can run Mono C # on most mobile phones, Nintendo DS or Playstation3, for example).

In any case, most of these engines support DirectX and OpenGL and / or visualization software, so they are created from scratch to be agnostic. But, as in any agnostic system, this requires a lot of effort and resources.

Now, from what you say, your C # + DirectX engine, which means that your engine can now work on PCs, Xbox, Zune and some cell phones with a window. To be honest, this is not a bad range of platforms. Therefore, if you are satisfied with this degree of freedom, and you prefer C # to C ++, you can stick to what you have and spend time improving your engine. However, if you want to run your engine on anything other than Microsoft, you will need to make the switch to C / C ++ someday.

In order to understand what I mean, my team engine supports Xbox, PS3, Wii, PSP, PC, and possibly other platforms, so if we take the effort, however, we have 15 full-time engineers working on this is so ... you see that it is a great value. Now, if you want something like this for a free project, and you know C ++, you can try any of many open source engines like Ogre or Irrlicht.

+3
source

I suggest staying with what you are familiar with. Using C or C ++ should be considered only in your situation if you intend to perform some functions of a lower level, for example, perform your own image processing or create custom filters or transformations (depending on what you use directx for for).

Graphic applications can have intensive computing aspects. Most of them were covered in the DirectX api, which is just as fast if you use it in C ++ or C #.

If you are considering a lower level language: if you create some kind of image processing that could be performed faster initially, this only applies if it is not offered by DirectX Api, for example, the creation of some custom encoders / decoders. In this case, you can create a custom component in another language, and then upload it to your C # application separately. If you look at the use of C ++ Intrinsics, which allow you to program your processor, as well as take a look at the GPGPU APIs like CUDA.

+1
source

As a hobby game developer, I really prefer C # (with a third-party library call to SlimDX) over C ++. Yes, a game written in well-optimized C ++ will probably work better than in the same game written in well-optimized C #. But the time that I save using C # (I guess it’s very approximately 30-40%) can be used to optimize my algorithms, so the game in C # will work faster than if I wrote it in C ++ for same time.

As mentioned above, there are also cross-platform compatibility issues, since for most practical purposes, the C # game will only work on Microsoft platforms.

Another issue to consider is that if you are writing your application in C #, you will need to install the .NET Framework on the computers on which it is running. This can lead to the fact that the distribution of your application will be somewhat more complicated, although this is by no means an insurmountable obstacle.

+1
source

There are several studios using C # for games.

You can also take a look at XNA, there is also a quake3 engine port that flies over the internet ported to C #.

So everything should be fine.

0
source

If you feel more comfortable in C # and there are no performance issues that force you to switch to a language close to the CPU, then I don’t see the need for a change.

However, depending on what you plan to do in the future, and how far this engine should be taken, this can change a lot, and C # may be the wrong choice. But this is only time can say, unfortunately. A correct educated guess requires much more detailed information about the current implementation and your future plans.

0
source

All Articles