Results 1 to 4 of 4

Thread: Games in C#

  1. #1
    Join Date
    Oct 2008
    Posts
    38

    Games in C#

    Hey guys,
    I just in the middle of course of C#, just thought to make some simple games, any idea how do i start with basics, if you have made then please give me some tips, i really need, i'm learning some online tutorials for this but not getting much. I need the basic tips. Please do your best favor. Thanks

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Games in C#

    No i don't know about the making games in C#, but i have heard that its really difficult task to do, there is no direct-X calls in .net , and i think you 'll need to use a vb wrapper or even c++ wrapper to make calls to directX.

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Games in C#

    If C# is so great, why is not everybody in the game industry already using it? The first problem is: it's not really cross platform. Its primary target was the PC, it has only been available on xbox360 since the end of 2006 (with the release of XNA 1.0) and there are still a lot of limitations in this case (for example, it's impossible to write a tool running on PC that talks to the console while the game is running), and it's not supported at all on other consoles.

    The second problem is middlewares: they are all written in native code, with a C++ API. It is totally possible to call such an API from C#, for example to write a managed program that uses OpenGL for rendering. There are several drawbacks to take into consideration though:

    • Writing the wrapper translating the C# calls to C++ (because the types are not the same in both languages, for example a C++ function can take a char* parameter) is tedious and error prone. And it has to be done each time you get a new version of the middleware. This can be automated to some extent, but from what I've heard there are always some tricky cases that have to be handled manually.
    • Each call to the middleware means switching from a managed context to a native context and back, which is expensive performance wise. This will also make debugging more difficult in general (assuming you have the source code of the middleware).
    • Using native libraries kind of defeats the purpose of writing a managed application in the first place, since these libraries won't benefit from garbage collection for example, if they allocate memory.


    A third problem is executing the game: in addition to DirectX or OpenGL, a C# game needs the .NET framework in order to run. This issue is not too bad, PC games already contain a redistributable version of the DirectX runtime, they could also install the .NET framework if it's missing on the target computer. On xbox360, I suppose Microsoft could push the framework through Xbox Live if they wanted to, but it would also have to be included on the DVD anyway (for people not connected to Xbox Live).

    Source: fairyengine.com

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Games in C#

    Actually creating wrapper for DirectX is done automatically. You only need to dll "Add Reference" in VS.Net. Once you successully created the wrapper, IMO becomes easier to program in C# than the C++ because you'll not need to deal with COM.

Similar Threads

  1. Replies: 4
    Last Post: 16-02-2012, 02:18 PM
  2. Replies: 7
    Last Post: 07-07-2011, 10:32 PM
  3. Replies: 3
    Last Post: 22-12-2010, 08:56 AM
  4. Mobile Games: Gameloft will sell its games via SMS Premium
    By Pyrotechnic in forum Off Topic Chat
    Replies: 1
    Last Post: 17-12-2008, 07:50 PM
  5. Replies: 5
    Last Post: 19-11-2008, 08:24 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,772,546.38943 seconds with 16 queries