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. Game Programming [modified]

Game Programming [modified]

Scheduled Pinned Locked Moved The Lounge
csharpquestiongame-dev
29 Posts 26 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.
  • P Offline
    P Offline
    pjvander
    wrote on last edited by
    #1

    I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

    H G E J K 13 Replies Last reply
    0
    • P pjvander

      I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

      H Offline
      H Offline
      Harald Krause
      wrote on last edited by
      #2

      The game engine is programmed in C++, all the .net languages are way to slow. Here you can download the sourcode of quake: http://www.idsoftware.com/business/techdownloads/[^]

      bb |~ bb

      J T T 3 Replies Last reply
      0
      • H Harald Krause

        The game engine is programmed in C++, all the .net languages are way to slow. Here you can download the sourcode of quake: http://www.idsoftware.com/business/techdownloads/[^]

        bb |~ bb

        J Offline
        J Offline
        Josh Smith
        wrote on last edited by
        #3

        Harald Krause wrote:

        The game engine is programmed in C++, all the .net languages are way to slow.

        A language is not slow. The virtual machine in which intermediary language instructions execute can be too slow.

        :josh: My WPF Blog[^] FYI - Bob is a scarecrow who keeps Chuck Norris away from CodeProject.

        W H 2 Replies Last reply
        0
        • J Josh Smith

          Harald Krause wrote:

          The game engine is programmed in C++, all the .net languages are way to slow.

          A language is not slow. The virtual machine in which intermediary language instructions execute can be too slow.

          :josh: My WPF Blog[^] FYI - Bob is a scarecrow who keeps Chuck Norris away from CodeProject.

          W Offline
          W Offline
          WillemM
          wrote on last edited by
          #4

          In that case, try XNA. At the devdays they showed some demo's on how to build games with it. Quite fun to see. I suspect that C++ is still faster, but can be hard to learn for the hobbyist.

          WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson My blog

          P 1 Reply Last reply
          0
          • W WillemM

            In that case, try XNA. At the devdays they showed some demo's on how to build games with it. Quite fun to see. I suspect that C++ is still faster, but can be hard to learn for the hobbyist.

            WM. What about weapons of mass-construction? "What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson My blog

            P Offline
            P Offline
            pjvander
            wrote on last edited by
            #5

            Thanks! I plan on looking into what has been suggested. Like I said, more curiousity than anything - I don't even play PC/video games . Had a few C++ classes back in college, but nothing that would prepare me for that level. Sure it will be interesting though... Thanks again!

            1 Reply Last reply
            0
            • P pjvander

              I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

              G Offline
              G Offline
              Graham Shanks
              wrote on last edited by
              #6

              Perhaps the best on-line resource is gGamedev.net[^] (you could try the Game Programming Wiki[^] as well). The Game Programming Gems[^] series of books are some of the best books on the subject, although something like Tricks of the Windows Game Programming Gurus [^] is probably a better introductory book

              Graham The fact that we live at the bottom of a deep gravity well, on the surface of a gas covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be. Douglas Adams

              L 1 Reply Last reply
              0
              • J Josh Smith

                Harald Krause wrote:

                The game engine is programmed in C++, all the .net languages are way to slow.

                A language is not slow. The virtual machine in which intermediary language instructions execute can be too slow.

                :josh: My WPF Blog[^] FYI - Bob is a scarecrow who keeps Chuck Norris away from CodeProject.

                H Offline
                H Offline
                Harald Krause
                wrote on last edited by
                #7

                Yes this is exactly why they are slow. All the .net languages are basically interpreted languages (yes I know about the just in time compiler). C, and C++ are not interpreted languages, they compile into native machine code, therefore they are faster by default.

                bb |~ bb

                J S M F 4 Replies Last reply
                0
                • P pjvander

                  I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

                  E Offline
                  E Offline
                  El Corazon
                  wrote on last edited by
                  #8

                  as mentioned by others, there are many ways. Some people write their own engines, some people buy someone else's engines. Some will find a middle point and get an optimized scene graph in their language of choice and get the boost into building their own engine. A scene graph only takes care of the drawing, not the intelligence or game-like manipulations. There is the dark basic route, you can license the ID game engine or others if you prefer. You can start from scratch and write your own, though I do not recommend this if you intend only to write games, but it is a good step if you want to truly understand the internal process. You can get a full game engine in C++ from the US Navy post-graduate school: http://www.delta3d.org/[^] and unlike dark-basic, it comes free. However compiler environments under Windows are a little more costly with a few exceptions.

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

                  1 Reply Last reply
                  0
                  • H Harald Krause

                    Yes this is exactly why they are slow. All the .net languages are basically interpreted languages (yes I know about the just in time compiler). C, and C++ are not interpreted languages, they compile into native machine code, therefore they are faster by default.

                    bb |~ bb

                    J Offline
                    J Offline
                    Johnno74
                    wrote on last edited by
                    #9

                    uhhhhh.... saying they are basically interpreted languages and then saying you know about the JIT means you are mistaken in your understanding. they are two completely different things. an interpreted language is just that, interpreted. Each line is translated to machine code each time it runs. With a JIT, each function is compiled to optimised machine code the first time that function is run. The level of optimisation that the JIT can manage within the time constraints is quite impressive, and not that far off what an "old school" offline c++ compiler can manage. Quite a while back Rico Mariani and Raymond Chen wrote a fairly simple benchmark in c++ and c#, then they each optimised their versions http://blogs.msdn.com/ricom/archive/2005/05/10/performance-quiz-6-chinese-english-dictionary-reader.aspx Yes, at the end of the day the unmanaged code WAS faster, but only after a LOT of hand-tuning. Raymond had to do a LOT of profiling and tuning before he was faster than Rico's managed code. managed code isn't slow, but does use more memory. The frameworks are generally much more heavyweight, which I guess comes from how easy it is to develop for them.

                    A D 2 Replies Last reply
                    0
                    • H Harald Krause

                      Yes this is exactly why they are slow. All the .net languages are basically interpreted languages (yes I know about the just in time compiler). C, and C++ are not interpreted languages, they compile into native machine code, therefore they are faster by default.

                      bb |~ bb

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

                      Perhaps you don't know about ngen?

                      1 Reply Last reply
                      0
                      • P pjvander

                        I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

                        J Offline
                        J Offline
                        Jasmine2501
                        wrote on last edited by
                        #11

                        These games are built up in levels like all complex applications. I've programmed two of these levels myself, but each thing is very difficult and time-consuming, and in most cases, way too much work for one programmer. So, smaller teams take engines from other places and use them in their games. There are many games for example, based on the Unreal engine, which includes several parts needed to make a 3d first-person shooter type game. You still have to come up with the creative aspects yourself - story, artwork, interactions, NPC AI, etc... There are: Graphics engines - many of these are provided by the vendors of the platform you are operating on. For example, Windows provides Direct3D. XBox provides XNA (which has graphics and other features), and PS3 has it's own thing (Glide maybe... I forget?) Sound engines - these provide music, ambient sounds, and incidental sounds for the game. Physics engines - these typically provide the bulk of the game's processing. Physics controls everything from the movement of characters to the flight of projectiles. Collision detecting can be considered part of this too. A good physics engine can make or break a game, and there are many types, specialized for different types of games such as physically complicated 3d shooters like Half-Life, flight sims, driving games, or arcade style shooters which have almost no physics other than collisions. Scripting engines - these provide story-lines and AI for non-player characters. Scripting engines are also used to make sequential puzzles work, handle complex interactions like unlocking doors, and determining when players have completed objectives, and what happens next. Scripting engines use high-level programming techniques, and special languages which apply to the type of game. A level-based game like Doom will have a very different scripting engine than something like an RPG, which is more continuous. These are very specialized but very powerful. Interface engines - these allow applications to accept input from users, and perhaps provide feedback through controllers (force feedback or vibrations). In many cases these will be designed specifically for each game. Most of the above will use C++, with the exception of scripting engines, which have their own languages. In addition, a big-budget game spends a lot of money on artwork, music rights or custom music, actors, and promotional expenses. I have made a 3D graphics engine, and I'm currently working on a scripting engine for RPGs. It's all very time-consuming work,

                        1 Reply Last reply
                        0
                        • P pjvander

                          I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

                          K Offline
                          K Offline
                          Keli Hlodversson
                          wrote on last edited by
                          #12

                          If you have an access to a Mac, you should try out Unity, which is a easy to use game development platform that uses C#, JavaScript or Boo for the scripting. It is available from http://unity3d.com

                          1 Reply Last reply
                          0
                          • P pjvander

                            I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

                            F Offline
                            F Offline
                            FredN64
                            wrote on last edited by
                            #13

                            I did this exact search a few weeks ago as i have exactly your experience and want to start some game programming a good starting point is [^] at the end my choice was for XNA www.xna.com Performance is actually quite good and will improve as Microsoft is investing on it (try the examples, i.e. the car racing demo) and the learning curve very easy for C# .NET programmers especially with the hands-on tutorials.

                            Fred64

                            1 Reply Last reply
                            0
                            • H Harald Krause

                              The game engine is programmed in C++, all the .net languages are way to slow. Here you can download the sourcode of quake: http://www.idsoftware.com/business/techdownloads/[^]

                              bb |~ bb

                              T Offline
                              T Offline
                              tec goblin
                              wrote on last edited by
                              #14

                              I know that in Ubisoft they use c# for the interfaces and perl below for scripting. Nowadays you often end up with something like: 1) High interface (character generation, initial login screen in WoW/DDO etc) in some managed .NET language - it's a secure entry point and is not intensive in resources. 2) Game engine in C++ usually (after all a lot of game engines are based on previous ones, so they just copy/paste/modify I suppose) 3) Often some scripting in another language. But it also depends on the type of game and the platform. For XBOX360+Windows dual platform games XNA seems the easy way to do it.

                              1 Reply Last reply
                              0
                              • P pjvander

                                I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

                                D Offline
                                D Offline
                                Dulchase
                                wrote on last edited by
                                #15

                                There's an open source 3d engine called OGRE you may want to check this http://www.ogre3d.org/ And some .Net wrappers http://www.ogre3d.org/wiki/index.php/OgreDotNet http://www.ogre3d.org/wiki/index.php/MOGRE

                                1 Reply Last reply
                                0
                                • H Harald Krause

                                  Yes this is exactly why they are slow. All the .net languages are basically interpreted languages (yes I know about the just in time compiler). C, and C++ are not interpreted languages, they compile into native machine code, therefore they are faster by default.

                                  bb |~ bb

                                  M Offline
                                  M Offline
                                  Machaira
                                  wrote on last edited by
                                  #16

                                  "faster" and "slow" are relative. One or two frames per second is an acceptable loss when development and maintenance are so much faster and easier. Sure, if you're doing cutting edge graphics engine development you're going to want to get all the performance you can out of your engine, but how many people are doing that? If you haven't done both C++ and .NET game development (I have) you might try it before posting any more.

                                  1 Reply Last reply
                                  0
                                  • H Harald Krause

                                    The game engine is programmed in C++, all the .net languages are way to slow. Here you can download the sourcode of quake: http://www.idsoftware.com/business/techdownloads/[^]

                                    bb |~ bb

                                    T Offline
                                    T Offline
                                    thompson4822
                                    wrote on last edited by
                                    #17

                                    The game engine is programmed in C++, all the .net languages are way to slow. Here you can download the sourcode of quake: Here is the deal. No one is going to write an entire game of any sophistication in Java or .Net. As mentioned, there are much faster solutions. But the good news is that it doesn't matter - in most cases the really speed critical stuff (ie; handling graphics, audio, etc) is already done for you and available in a number of libraries, whether ultimately coded in C++, C, Assembler, or a combination thereof. Writing Java/.Net games that utilize these is therefore a perfectly reasonable proposition, and unless you're doing some heavy AI work, you're going to be plenty fast enough. Sit down with something like the SDL and/or OpenGL libraries and you'll find that you can create some very fast and beautiful games indeed. And to completely befuddle many of the '.Net aint fast enough' experts here, write it in VB.Net or IronPython or somesuch. I guarantee that for any games a single developer/small shop can come up with, if you are able to exploit common libraries to do all of your heavy lifting, you are going to be: 1) Plenty performant enough (machine cycles). 2) Be able to outpace your counterparts who've been brainwashed into thinking they have to create games completely in C/C++ (developer cycles). Best regards as always, Steve

                                    1 Reply Last reply
                                    0
                                    • G Graham Shanks

                                      Perhaps the best on-line resource is gGamedev.net[^] (you could try the Game Programming Wiki[^] as well). The Game Programming Gems[^] series of books are some of the best books on the subject, although something like Tricks of the Windows Game Programming Gurus [^] is probably a better introductory book

                                      Graham The fact that we live at the bottom of a deep gravity well, on the surface of a gas covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be. Douglas Adams

                                      L Offline
                                      L Offline
                                      Luke van der Hoeven
                                      wrote on last edited by
                                      #18

                                      I agree, Tricks of the Windows Game Programming Gurus is an excellent intro book. Thats where I started.

                                      -Luke vdH

                                      1 Reply Last reply
                                      0
                                      • P pjvander

                                        I visit CP often as I am generally interested in .NET/C#, but am not a professional programmer. I friend recently asked a question that I could not clearly answer, so I thought I would post it here: How are games, such as first-person shooters like Doom, programmed? I assume there is an engine of sorts, but is there than a languange the engine uses? I am sure it is a fairly complex answer, but does anyone have any resources (CP or other) about the process? Just need to feed my curiousity a bit. Thanks! -- modified at 11:31 Sunday 17th June, 2007

                                        D Offline
                                        D Offline
                                        Daqwenia
                                        wrote on last edited by
                                        #19

                                        www.visual3d.net => Visual3D.NET is a 3D game engine in its early beta stages that will soon support every .NET programming language.

                                        1 Reply Last reply
                                        0
                                        • J Johnno74

                                          uhhhhh.... saying they are basically interpreted languages and then saying you know about the JIT means you are mistaken in your understanding. they are two completely different things. an interpreted language is just that, interpreted. Each line is translated to machine code each time it runs. With a JIT, each function is compiled to optimised machine code the first time that function is run. The level of optimisation that the JIT can manage within the time constraints is quite impressive, and not that far off what an "old school" offline c++ compiler can manage. Quite a while back Rico Mariani and Raymond Chen wrote a fairly simple benchmark in c++ and c#, then they each optimised their versions http://blogs.msdn.com/ricom/archive/2005/05/10/performance-quiz-6-chinese-english-dictionary-reader.aspx Yes, at the end of the day the unmanaged code WAS faster, but only after a LOT of hand-tuning. Raymond had to do a LOT of profiling and tuning before he was faster than Rico's managed code. managed code isn't slow, but does use more memory. The frameworks are generally much more heavyweight, which I guess comes from how easy it is to develop for them.

                                          A Offline
                                          A Offline
                                          Alan Balkany
                                          wrote on last edited by
                                          #20

                                          There seems to be a myth floating around that .NET code can be as fast as unmanaged C++. The myth is persistent, despite contradicting objective reality. I've been working with both Visual Studio 6 in C++ and Visual Studio 2005 in C# .NET, and there's no comparison. When you start Visual Studio 6, it comes up almost instantly. 2005, like .NET applications in general, is sluggish. .NET applications must do automatic garbage collection, array bounds checking, boxing/unboxing, and JIT compilation. Unmanaged applications don't do any of this. There are other slow-downs too, such as GDI+'s GetPixel and SetPixel. At this point in time, .NET is only appropriate for simple games that don't require speed.

                                          J 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