Announcement

Collapse
No announcement yet.

Miguel de Icaza Calls For More Mono, C# Games

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #81
    There's nothing which makes C# particularly suited for writing games, the only thing really tying C# and game development together is XNA, which is a proprietary Microsoft-platform-only development framework basically targeted at x360 indie game development. If you are looking to write games with the outmost ease then you are better off using a language directly written for game development such as Game Maker or Blitz Basic/Monkey etc, which also supports more platforms than those provided by Microsoft.

    Then there's what I think of as prototype game frameworks like pygame and l?ve which offer game development using scripting languages such as python and lua together with strong frameworks offering lots of features like built-in box2d physics.

    Mono seems like an answer looking for a question, which is likely why it's been changing it's targeted environment from desktop to game development tools. It's currently much slower than Java and even has to see itself beaten in performance by newer languages like Go. If you're already a C# programmer who wants to develop games then there's certainly a good reason to look at Mono for game development, but I can't see any reason for someone to pick up C# programming in order to program games unless you are directly targeting the XNA platform.

    Comment


    • #82
      There's nothing which makes C# particularly suited for writing games
      How about value types, built-in reflection, great C interop, access to SIMD instructions, good platform support, great documentation, an active gamedev community and tons of useful libraries and frameworks?

      Comment


      • #83
        Originally posted by BlackStar View Post
        How about value types, built-in reflection, great C interop, access to SIMD instructions, good platform support, great documentation, an active gamedev community and tons of useful libraries and frameworks?
        What makes C# style value types (iirc basically structs with deep copy) and reflection particularly suited for game programming? And the other things you listed are available for most other languages and frameworks. And while garbage collection is convenient it has a long history of causing problems in applications such as games where a constant smooth framerate is key to an enjoyable experience. I remember tons of XNA garbage collection horror stories when XNA development was picking up and from what I've read Mono's garbage collector is alot less performant than that in Microsoft's runtime.

        Comment


        • #84
          Originally posted by BlackStar View Post
          How about value types, built-in reflection, great C interop, access to SIMD instructions, good platform support, great documentation, an active gamedev community and tons of useful libraries and frameworks?
          libraries and frameworks which probably don't work straight out of the box with Mono, again proving my point. If only Microsoft made C# right from the start. Nehhh is Microsoft, you can't ask them much.

          As long they don't embrace other platforms (sorry Mono folks, you're doing a hell of a good job, but still not close as being upstream) C# is not going anywhere anytime soon.

          What made Java so famous. It can run even on a toaster. C#? Not even close.

          Comment


          • #85
            Originally posted by XorEaxEax View Post
            What makes C# style value types (iirc basically structs with deep copy) and reflection particularly suited for game programming? And the other things you listed are available for most other languages and frameworks. And while garbage collection is convenient it has a long history of causing problems in applications such as games where a constant smooth framerate is key to an enjoyable experience.
            And that's why value types rock: they avoid these GC issues you just mentioned. Between value types, stackalloc, raw pointers, GCHandles and a fast generational GC, you have everything you need for fast game code without GC problems (unlike Python or Java, where you *don't* have these facilities).

            C# is very powerful language in the hands of a competent developer.

            Originally posted by darkcoder
            libraries and frameworks which probably don't work straight out of the box with Mono, again proving my point.
            Nice strawman, there.

            Every library and game I write is tested to work on Mono. As long as you avoid libraries with "Windows" in their names, such as WinForms or WPF, you are pretty much good to go. Even XNA has no less than three cross-platform reimplementations (but you shouldn't use XNA anyway, since it has been abandoned by Microsoft).

            Between OpenGL, OpenAL, OpenCL, Ogg and Mono you have everything you need to write cross-platform games in C#.

            Comment


            • #86
              Originally posted by BlackStar View Post
              How about value types, built-in reflection, great C interop, access to SIMD instructions, good platform support, great documentation, an active gamedev community and tons of useful libraries and frameworks?
              You have to be kidding me. What about a GC that is hard to control, boxing of variables, an unpredictable JIT, etc. Great C interop for .NET is a joke, what if you've done a standalone .NET API in an assembly you want to access with a C component?

              Comment


              • #87
                Originally posted by BlackStar View Post
                And that's why value types rock: they avoid these GC issues you just mentioned. Between value types, stackalloc, raw pointers, GCHandles and a fast generational GC, you have everything you need for fast game code without GC problems (unlike Python or Java, where you *don't* have these facilities).
                So value types are good because they solve a problem that is inherent to it's language VM? How does that make it particularly suited for game programming?

                Originally posted by BlackStar View Post
                C# is very powerful language in the hands of a competent developer.
                Same goes for pretty much every language out there. And there are other languages which a competent developer can get more performance from.

                Originally posted by BlackStar View Post
                Between OpenGL, OpenAL, OpenCL, Ogg and Mono you have everything you need to write cross-platform games in C#.
                Again, same goes for any other language, also with languages like C/C++/ObjC etc you can use practically every framework there is out there as they are either written in those languages or can be linked directly to them.

                Like I said earlier, looking past XNA I can't see any reason to pick up C# as a game programming language as there are no inherent properties in the language that makes it particularly suited for games as opposed to lots of other languages, however if you already are a C# programmer then obviously it's preferable if you can use it for game programming rather than learning/using another language with which you feel less comfortable.

                Comment


                • #88
                  Originally posted by XorEaxEax View Post
                  So value types are good because they solve a problem that is inherent to it's language VM? How does that make it particularly suited for game programming?
                  C# understands that the GC is not the solution to every problem and gives you the flexibility to avoid it when necessary. That's why it is particularly suited to game programming.

                  For 80% of the code, the GC is an advantage. For the other 20% you have value types and stackalloc.

                  Again, same goes for any other language, also with languages like C/C++/ObjC etc you can use practically every framework there is out there as they are either written in those languages or can be linked directly to them.
                  You know that C# can consume C and C++ code, right? Pretty much every single game library and 3d engine out there has a ready-to-use C# binding.

                  C# brings tangible benefits to game programming, which is exactly why it is so damn popular in this scene. It brings some unique features that are simply not available in traditional C++, like painless scripting with direct access to the game engine. And if nothing else, it is a very well-designed language, with best-of-class tools, good performance and good platform support.

                  Comment


                  • #89
                    Originally posted by BlackStar View Post
                    C# understands that the GC is not the solution to every problem and gives you the flexibility to avoid it when necessary. That's why it is particularly suited to game programming.
                    No it's not, you seem confused. You can achieve the same thing by using RAII and smart pointers in C++ with even more flexibility, even better there's no wasted cpu usage from the GC garbage collector runs which eats cpu even if it doesn't find any memory to retrieve.

                    There are benefits and drawbacks with GC, and it's not better suited for game programming than it is suited for any other type of code and if anything I'd argue that it's less suited for game programming due to it's reliance on delivering gameplay at constant framerates which is something the GC can make problematic and therefore need to be programmed around, and even if you do so you can run into other problems like the GC suddenly deciding to start compacting memory.

                    Originally posted by BlackStar View Post
                    which is exactly why it is so damn popular in this scene.
                    It is? Compared to what? I frequent game programming forums like tigsource and others and I sure don't see any popularity of C#. Actionscript (flash), Game Maker and C++ seems to be most prominent. Or are you talking about some other 'scene'?

                    Originally posted by BlackStar View Post
                    good performance
                    Compared to what? Mono in particular seems to have poor performance from all the benchmarks I've seen.

                    Comment


                    • #90
                      Originally posted by XorEaxEax View Post
                      No it's not, you seem confused. You can achieve the same thing by using RAII and smart pointers in C++ with even more flexibility, even better there's no wasted cpu usage from the GC garbage collector runs which eats cpu even if it doesn't find any memory to retrieve.

                      There are benefits and drawbacks with GC, and it's not better suited for game programming than it is suited for any other type of code and if anything I'd argue that it's less suited for game programming due to it's reliance on delivering gameplay at constant framerates which is something the GC can make problematic and therefore need to be programmed around, and even if you do so you can run into other problems like the GC suddenly deciding to start compacting memory.
                      Not even close.

                      First, the GC is much more flexible than smart pointers.

                      Second, the GC allocations are ridiculously faster: they just increment a pointer. C++ new has to traverse a linked list, locate an empty spot, allocate it, then initialize a 'smart pointer' structure - that's much more complex than a plain pointer.

                      Third, RAII is eager whereas GC is lazy. This means that the GC is significantly more efficient when you have free memory (as it never runs). Once memory pressure builds, the GC will run once to collect n objects, which is *still* more efficient than RAII, which runs n times to collect n objects.

                      Fourth, "smart" pointers are slower to access than raw pointers, so not only do you lose performance when you create/collect an object, you lose performance every single time you access it.

                      Fifth and last, you can avoid GC pauses in C# via judicious use of value types and object pools. This is something every game developer knows and implements - in other words, your whole argument is built upon a strawman.

                      Other languages suffer from the problem you desribe - C# does not.

                      It is? Compared to what? I frequent game programming forums like tigsource and others and I sure don't see any popularity of C#. Actionscript (flash), Game Maker and C++ seems to be most prominent. Or are you talking about some other 'scene'?
                      Ever heard of Unity3d?

                      Edit: as a frame of reference, Unity Technologies Surpasses 750,000 Registered Developers (Nov 2011).

                      Compared to what? Mono in particular seems to have poor performance from all the benchmarks I've seen.
                      Compared to the performance you need to create a good game. People have been writing popular games in Javascript (100x slower), Python (10x slower), Lua (10x slower), Java (around the same) and tons of other languages. Mono provides good performance and can interop with C/C++ if you ever need to optimize a particular bit.
                      Last edited by BlackStar; 17 February 2012, 11:13 AM.

                      Comment

                      Working...
                      X