Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Games in C# is it even Possible

Games in C# is it even Possible

Scheduled Pinned Locked Moved The Lounge
csharpjavagame-devquestion
73 Posts 32 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L L Viljoen

    I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

    Oliekrokenosterpikkelikkeastrysvoel

    T Offline
    T Offline
    Thomas Freudenberg
    wrote on last edited by
    #59

    Arena Wars[^] is a great game.

    Regards Thomas


    Disclaimer:
    Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.

    1 Reply Last reply
    0
    • Q QuiJohn

      Christian Graus wrote:

      Shown by who ? C++ programmers who don't know how to use C# ?

      I think I was basing my "twice as slow" comment on this link that I found a while ago. Judging from the site name I doubt they're biased against C#. In particular the Sieve of Eratosthenes results were interesting (scroll down, the Hello World results are useless and not at all unexpected). BTW, I program in C# and believe that in the vast majority of applications, being twice as slow doesn't matter at all (most programs spend most of their time waiting for the much slower human component). I like C# as a language. But it's not as efficient as C or C++, and by design it can't be. So for something like a modern 3D game, which needs all the performance it can get, C++ is going to be the better choice. As for DirectX only being 4-5% slower when using C#, that's all well and good but considering DirectX spends most of its time in libraries that aren't written in C#, it's not surprising and nor is it very useful. The rest of the app (physics, AI, what have you) will be much slower and significantly so.

      D Offline
      D Offline
      Daniel Grunwald
      wrote on last edited by
      #60

      You should replace for (int i = begin; i < end; ++i) with for (int i = begin; i < primes.Length; ++i) And do the same with the inner loop. This is a special construct recognized by the JIT that eliminates array bounds checking. I haven't tested this on .NET 2.0 yet, maybe .NET 2.0 eliminates array bound checking even when not using that fix.

      1 Reply Last reply
      0
      • C Christian Graus

        Chona1171 wrote:

        Mabe I should just stick to Information Systems its what I am good at.

        Nah, stretch yourself, become good at other things. Resources such as bitmap handles and database connections can be cleaned up by the IDisposable interface, which just means if an object has a Dispose method, you should call it when you don't want an object anymore. It's a poor mans substitute for deterministic destruction.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        C Offline
        C Offline
        Chris Charabaruk
        wrote on last edited by
        #61

        Actually, with a game, you shouldn't dispose resources as soon as you're finished with it. If possible, you should make sure the GC doesn't, either. The idea is to dispose unused resources during a transition (those times when the loading screen pops up) so as to avoid hiccups in the frame rate. It's not all that important when it's just one or two little resources but if you're clearing out game resources in bulk players will notice. Same goes for loading them.

        Christopher S. 'coldacid' Charabaruk

        1 Reply Last reply
        0
        • Q QuiJohn

          Christian Graus wrote:

          Why ?

          Possibly because C# has been shown to be about twice as slow as C++? For a time critical app like a 3D game, that might be important.

          C Offline
          C Offline
          Chris Charabaruk
          wrote on last edited by
          #62

          Puh-leeze. C# isn't faster or slower than any other language, it's all in how it's used. I developed a little game in 3 days that used only 2D graphics with the help of SDL.NET, and it struggles at 30 FPS. I've seen MDX and Tao.OpenGL that just fly. C# is a perfectly good language for game development, concerns about resource & memory management or no.

          Christopher S. 'coldacid' Charabaruk

          1 Reply Last reply
          0
          • L L Viljoen

            I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

            Oliekrokenosterpikkelikkeastrysvoel

            P Offline
            P Offline
            pkoselski
            wrote on last edited by
            #63

            Try to implement perpixel alpha blending in C# and you'll see why there are no many games written in .net. The answer is - because there are many winapi functions which doesn't have corresponding .net methods. These functions are in most cases so-called low level, such as WINAPI UpdateLayeredWindow function. So, the only way to implement pp alpha blending is to call WINAPI function from C# but does it make any sense? Isn't it better to write the game in C++ and use WINAPI functions directly?

            1 Reply Last reply
            0
            • L L Viljoen

              I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

              Oliekrokenosterpikkelikkeastrysvoel

              X Offline
              X Offline
              X Cyclop
              wrote on last edited by
              #64

              Sure, you can. But, C# has a disadvantage: .Net Framework/MONO. For this reason i'd use C++.;)

              1 Reply Last reply
              0
              • L L Viljoen

                I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

                Oliekrokenosterpikkelikkeastrysvoel

                A Offline
                A Offline
                AntiSilence
                wrote on last edited by
                #65

                Very possible. Check out this article at Coding4Fun... Rocket Commander

                1 Reply Last reply
                0
                • E El Corazon

                  Christian Graus wrote:

                  but most of my processing is a lot less intense than that lot was ( HDR image merging ), and it works just fine in C#.

                  have you tried the C# Microsoft Research Accelerator? I would expect for HDR image manipulation it would work great. It moves C# to utilizing both CPU and GPU for parallel processing. http://channel9.msdn.com/wiki/default.aspx/Accelerator.HomePage[^] I haven't used it yet, but it is the first item of C# that made me do a double take. That is worth learning a new language (not that I have had any time to).

                  _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                  S Offline
                  S Offline
                  si618
                  wrote on last edited by
                  #66

                  Interesting, cheers for the link! There is also NGen for improving managed assemblies performance: http://msdn2.microsoft.com/en-us/library/6t9t5wcf.aspx

                  1 Reply Last reply
                  0
                  • L L Viljoen

                    I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

                    Oliekrokenosterpikkelikkeastrysvoel

                    S Offline
                    S Offline
                    samir ray
                    wrote on last edited by
                    #67

                    Not only is it possible, Koios Works has released multiple games all developed in C#. Their latest game, Panzer Command: Operation Winter Storm just came out in June.

                    1 Reply Last reply
                    0
                    • Q QuiJohn

                      Christian Graus wrote:

                      Why ?

                      Possibly because C# has been shown to be about twice as slow as C++? For a time critical app like a 3D game, that might be important.

                      B Offline
                      B Offline
                      baldricman
                      wrote on last edited by
                      #68

                      bwahahahaha!!!! and 72% of all statistics are made up on the spot.

                      1 Reply Last reply
                      0
                      • L L Viljoen

                        I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

                        Oliekrokenosterpikkelikkeastrysvoel

                        A Offline
                        A Offline
                        Abrian P Stemmet
                        wrote on last edited by
                        #69

                        Check out this game written in C#: http://www.rocketcommander.com[^] Rocket Commander Tutorials: http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx[^]

                        1 Reply Last reply
                        0
                        • L L Viljoen

                          I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

                          Oliekrokenosterpikkelikkeastrysvoel

                          R Offline
                          R Offline
                          Robert Vukovic
                          wrote on last edited by
                          #70

                          There are some great tutorials on the following links. [http://abi.exdream.com/ http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx](http://abi.exdream.com/
                          http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx)[[^](http://abi.exdream.com/
                          http://msdn.microsoft.com/coding4fun/gamedevelopment/rocketcmd/default.aspx "New Window")] Arena Wars is commercial game written in .NET. http://arenawars.krawall.de/com/[^]

                          1 Reply Last reply
                          0
                          • L L Viljoen

                            I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

                            Oliekrokenosterpikkelikkeastrysvoel

                            A Offline
                            A Offline
                            AlexanderF
                            wrote on last edited by
                            #71

                            Hi, there already is a professional 3d Game programmed in C#/.NET: http://arenawars.krawall.de/start.html

                            1 Reply Last reply
                            0
                            • E El Corazon

                              Christian Graus wrote:

                              but most of my processing is a lot less intense than that lot was ( HDR image merging ), and it works just fine in C#.

                              have you tried the C# Microsoft Research Accelerator? I would expect for HDR image manipulation it would work great. It moves C# to utilizing both CPU and GPU for parallel processing. http://channel9.msdn.com/wiki/default.aspx/Accelerator.HomePage[^] I haven't used it yet, but it is the first item of C# that made me do a double take. That is worth learning a new language (not that I have had any time to).

                              _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                              G Offline
                              G Offline
                              gancev
                              wrote on last edited by
                              #72

                              c++ rulez

                              1 Reply Last reply
                              0
                              • L L Viljoen

                                I have been studying Information Systems programming for two years now, but have always been intrigued by games programming, now there is a campus opening in SA that offers C# 3D Games Programming using Direct X. Now this all sounds very cool since I am a great fan of Java and C# but does anyone know is it possible to create a good game in C# that can compete in the market?

                                Oliekrokenosterpikkelikkeastrysvoel

                                S Offline
                                S Offline
                                Stick
                                wrote on last edited by
                                #73

                                It is possible, but you would only select C# for game develoment in the case of a game that did not require state-of-the-art performance. C# is indeed slower than properly written C++. However, in either language you can tank the performance if you are not an experienced programmer. C# in the hands of a good developer could actually exceed the performance of a poor programmer using C++, depite being interpreted. If you are planning on writing the next FPS, like Quake X, then you'll need to use C++. If you are writing another version of Soduku, then C# will perform fine. In the industry, programmers skilled in both languages typically use C++ for coding the game, and C# to code tools, like level editors. Why? Well, in the game, I want to be able to do anything at any time for maximum performance. I may even go to inline asm. But, I want the tools to develop game content (levels, animations, etc.) built quickly and C# allows that to happen without worries about memory management. To truely be proficient in programming in C# you'll need to understand memory management to understand how it works behind the scenes, or you'll be writing slow code anyway. So, learn both. Patrick

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups