Viability of C#/.NET as the new standard game dev platform?

前端 未结 13 1901
遇见更好的自我
遇见更好的自我 2021-01-31 04:26

For a long time now C++ has been the dominate game development language. Many AAA quality 3D engines are available to fit any budget.

My question is, with the rise of X

相关标签:
13条回答
  • 2021-01-31 05:04

    I think C++ will go out of fashion in the next 10 years just the same way as assembly did. I'm a professional game programmer for more the 15 years. In early 90's lot of people said that C is not efficient enough for games. In the late 90's same people said that C is OK but C++ is just way too slow for performance critical applications such as games. Now C++ is the standard high performance language and people argue that other languages would be too slow. In the meantime today's games use script languages like Lua, Python or Unrealscript for game logic which are ten times slower than C# or Java.

    C++ is much faster when you do math in your game. Doing linear algebra is painfully slow in C# or Java. However, this is only a part (10 - 25%) of the game. When it comes to the game logic bottleneck is memory access so using an other language does not reduce the performance significantly. The tool side of the game, which use to be the 50-80% of the code, really does not require any C++. It happily runs in C# which is fast enough for almost any tool.

    One also should not forget that C++ is derived from C, which is made in the early 70's. So C++ is obsolete in many ways. The most annoying thing is probably the pre-processor which kills transparency and causes insanely long compile times. An average state of art C++ game engine compiles in 30-60 minutes. In such time you could compile every C# and Java project ever made by humans. Lack of self reflection and dynamic code creation is also a drawback. It often costs a lot of development time to overcome on these shortcomings.

    Nevertheless C++ development costs a lot it would cost even more for a game studio to risk a failure by switching to a new technology which is not yet proven in game development. It is also an important factor that majority of experienced game programmers use only C/C++ and they do not have experience with other languages which would definitely increase the risk of switching. Because of these, you probably will not see game studios in the next couple of years switching to C#. However, it is likely that a Microsoft owned studio will make a big hit with a C# game in the next 5 years which will convince other studios that it is feasible to make AAA titles in C# and then you will see more and more studios switching to C#.

    For now, my advice is: If you want to make an AAA multi-platform title you have no other choice than C++ for the runtime part of the game. Consider using C# for the tool side. It's a little bit tricky to efficiently connect managed and unmanaged code but on long run it worth the effort you spend on it. If you do a hobby project or a B title where performance is less important than development cost/time then forget C++ and just use C# for everything and spend some extra time to optimize the math.

    0 讨论(0)
  • 2021-01-31 05:05

    It is not just the studios to consider, it is the audience. Chances are that as long as Sony and Nintendo are around, they are unlikely to move the a C#/XNA platform. At least for Nintendo, when you have the mass-market appeal that they currently do, they will continue to dictate their development platform.

    I love XNA, since I can now write applications for my Zune, but C++ for a broad-based development platform for gaming is going to be around for a long time. There might be an influx of new indie developers for Microsoft devices, but we are a far way from seeing XNA be used across the board, if ever.

    0 讨论(0)
  • 2021-01-31 05:06

    As a poster mentioned, XNA is currently limited to Microsoft platforms but you can still use C#, .NET and any .NET programming languages to develop games in a cross-platform way.

    The Mono runtime does provide a cross-platform engine that can be used to run your C# (or .NET code) under a variety of desktop platforms (Windows, MacOS, Linux) as well as gaming consoles (Wii supported by Novell, PS3 coming soon and Xbox360 "on your own").

    There is also a commercial gaming platform called Unity3D that has done wonders using Mono. They are a game IDE that surpasses XNA as a game development environment: physics, graphics, lights, models, collisions are handled all in native C++ code while all of the gaming logic (AI, camera control, views and so on) are handled by managed code written typically in C# or UnityScript (a strongly typed Javascript implementation that gives you the best of both world: the Javascript syntax, but strong types that improve performance).

    0 讨论(0)
  • 2021-01-31 05:09

    Surprised nobody has mentioned the possibilities for a mobile gaming. I can't see any managed code competing with C++ anytime soon for the likes of Half-Life and Halo, but for less-intensive mobile device games it seems like it's got legs.

    0 讨论(0)
  • 2021-01-31 05:13

    Lua should be of interest to you, as you can embed it in C# and access your objects from LuaScript.

    0 讨论(0)
  • 2021-01-31 05:14

    The large gaming studios will probably not adopt XNA any time soon. Some indies are using it, but definitely has the potential to eventually be very successful and leave C++ behind.

    XNA provides many classes that you can use in game development, but many others often choose to use a fully fledged games engine. Although XNA is rather good for beginner's to cut their teeth on if you are new to programming games.

    C# is a good language to use for games development. Games development produces applications that require sound, advanced graphics, AI, Physics, etc. All that requires a powerful and fairly quick language environment. While most of the top tier PC and console games are written in C++, C# has a road map that will likely leave C++ behind. The coming changes in C++0x will no doubt reinvigorate C++ for a little while but C# looks poised to overtake it.

    If you really want to be a games developer I would urge you to at least learn C++ and write your own game engine. Using a pre-made game engine is easy and you can code something that is 'okay' but you will run into many limitations that you won't be able to code around. You will effectively be confined to the capabilities of the game engine (unless you have access to the source, which you could then modify to your liking).

    Learn C++ and preferably OpenGL :) Once you know OpenGL you can learn DirectX pretty easily.

    C# is a piece of cake once you know C++.

    0 讨论(0)
提交回复
热议问题