Forgot your password?
typodupeerror
Programming Games

Ask Slashdot: Best Way to Learn C# For Game Programming? 254

Posted by timothy
from the can't-sharpen-the-sea dept.
An anonymous reader writes So I, like many people, want to make my own game. Outside of MATLAB, Visual Basic, and LabVIEW I have no real programming experience. I initially started with Ruby, but after doing my homework decided that if I ever wanted to progress to a game that required some power, I would basically need to learn some form of C anyway. Further digging has led me to C#. The other parts of game design and theory I have covered: I have ~8 years of CAD modeling experience including Maya and Blender; I have a semiprofessional sound studio, an idie album on iTunes, and am adept at creating sound effects/music in a wide variety of programs; I'm familiar with the setbacks and frustration involved with game development — I beta tested DotA for 9ish years; I already have my game idea down on paper (RTS), including growth tables, unit types, unit states, story-lines, etc. I've been planning this out for a year or two; I will be doing this on my own time, by myself, and am prepared for it to take a couple years to finish. The reason for listing that stuff out, is that I want people to understand that I know what I'm getting myself in to, and I'm not trying to put out a not-so-subtle "help me make a game for free lol" type of post. With all of that said, where is a good place to start (i.e., recommended books) for learning C# for game programming? I am familiar with object oriented programming, so that's a little bit of help. I'm not necessarily looking for the syntax (that part is just memorization), but more for the methodology involved. If anyone also has any suggestions for other books or information that deal with game development, I would love to hear that too. I know enough to understand that I really don't know anything, but have a good foundation to build on.
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Best Way to Learn C# For Game Programming?

Comments Filter:
  • Udemy (Score:4, Informative)

    by Bodhammer (559311) on Friday June 20, 2014 @06:55PM (#47285561)
    Udemy has 12 courses(https://www.udemy.com/courses/search/?ref=home&q=c%23) up there and they have big sales all the time. If you can get some for $10, it might be worth it.
  • by Anonymous Coward on Friday June 20, 2014 @06:57PM (#47285581)

    do the unity3d tutorials and mess around with C# in there. you get to use your 3d skills and actually make something whilst you learn

  • by tepples (727027) <tepples@nOSpAM.gmail.com> on Friday June 20, 2014 @06:57PM (#47285589) Homepage Journal

    Everyone I know that tried it, gave-up on it.

    Except for those people who had to target a platform that requires verifiably type-safe CIL that targets the .NET Compact Framework. Xbox Live Indie Games was this way, as was Windows Phone 7. Practically the only language that produces such bytecode is C#, as standard C++ as compiled by C++/CLI is not verifiably type-safe and IronPython requires Emit which isn't part of the Compact Framework.

    the C++ code ran on a server instead of a desktop OS like C# requires.

    Windows Server is a server operating system whose NT kernel is inspired by the architecture of Digital's VMS. It runs C# in the .NET Framework. FreeBSD is a server operating system. It has a port of Mono, a .NET Framework workalike, called BSD#.

  • Re:It's too slow. (Score:1, Informative)

    by Anonymous Coward on Friday June 20, 2014 @06:57PM (#47285591)

    Sounds like you're a shit programmer. You should stick to COBOL.

  • C# MMO (Score:1, Informative)

    by Anonymous Coward on Friday June 20, 2014 @07:11PM (#47285665)

    I was in a similar position to you a few years ago. Wanted to code up my dream game and C# was the obvious answer. I knew C and Java at that point, so I ended up learning C# and using XNA. I'd say that it's not a bad choice these days, but Unity3d is easier. MonoGame is a good library that is the spiritual successor of XNA.

    The issues of performance are an easy point to gripe about, but honestly I wouldn't worry about it too much. The advantages of a higher-level language offset the performance losses compared to C/C++. If you're going into this as a one man team, you should really focus on optimizing for development time instead of performance. You can optimize your code when you start to need it. Check out /r/gamedev there are a lot of really good people there that can help you with planning this out.

    If you want to check out my project, it's at http://spacerambles.com/

  • by gbjbaanb (229885) on Friday June 20, 2014 @07:15PM (#47285685)

    True - if you're going to write games in C#, you need Unity. Unfortunately Unity is really Mono so you will have some issues with the toolchain - ie its not as nice as native Visual Studio coding.

    But even then, all the games I've seen written in Unity work, but they suck up your CPU like nothing else. If you really want to code games, stick to what most people in the industry use - C++.

    There are plenty of engines that help you, like Irrlicht, or Ogre3d. Or go with a commercial engine like Unreal.

    Take a look at the list, count the number targeting the different languages.
    http://en.wikipedia.org/wiki/L... [wikipedia.org]

  • Re:It's too slow. (Score:3, Informative)

    by jd2112 (1535857) on Friday June 20, 2014 @07:16PM (#47285693)

    C# is typically slightly slower than Java so....

    Citation please? In my experience C# is somewhat slower than native code but much faster than Java.

  • Re:Play with Unity3D (Score:3, Informative)

    by Anonymous Coward on Friday June 20, 2014 @07:23PM (#47285719)

    Yep,
    Unity - you would be surprised how many commercial games are using it. Several new independent titles like Wasteland 2, Torment: Tides of Numenera, Castle Story, Kerbal Space Program. Runs on Windows, Mac, Linux, iOS, Android. I also heard that over 50% of the mobile games are using unity (check out "The Room" and "Temple Run" for examples). The scripting language is C#. The workflow is tailored to the visual assets, so it is perfect for someone with your background. The unity engine does a lot of the work for you, so you can accomplish quite a lot with not a lot of scripting.

  • Patterns (Score:5, Informative)

    by CODiNE (27417) on Friday June 20, 2014 @07:32PM (#47285767) Homepage

    http://gameprogrammingpatterns... [gameprogra...tterns.com]

    This site takes a subset of the "Gang of Four" patterns and explains how and why to use them in your games.

    You'll especially enjoy the command pattern which will be heavily used in an RPGSgame.

  • by St.Creed (853824) on Friday June 20, 2014 @08:31PM (#47286167)

    Surprisingly enough, there is. A lot of game developers use GameMaker to prototype games. But some of them are good enough to be published on Steam straight out of Gamemaker. And it's simple enough that my 11-yr old has been using it for his own game.

    Disclaimer: my former prof built it.

    There's also Unity3D.

    These tools take away a lot of details that used to be 80% of the work, and leave you to work on the *game*, as opposed to rendering the screen without tearing or trying to get the audiobuffer to play without clipping, or... etc.

  • by paulpach (798828) on Friday June 20, 2014 @08:36PM (#47286207)

    I use unity. Like you say, if you make more than $100K per year, then you need to buy pro.

    But really, who cares? $1500 - $4500 (depending on what you need) is a very reasonable price for the tool, and an insignificant cost at that point. The cost of writing games is orders of magnitude higher than that, and Unity will end up saving you more in time than $4500 worth of programmer's time. They don't even charge royalty.

    Also, why a trap? The terms are clear and you know them up front. Nobody is deceiving you into paying for something you did not want. From my point of view, the terms are quite generous and reasonable, and if you don't think so, then you simply use other tool and this does not affect you

    If you have to pay $4500 because you are making $100K/year , it is a very nice problem to have :).

  • Re:It's too slow. (Score:4, Informative)

    by Anonymous Coward on Friday June 20, 2014 @08:53PM (#47286301)

    C# doesn't 'run through a virtual machine' - CIL bytecode is 'always' JIT compiled to native machine code in both Microsoft's .net platform and in Mono.

    The only overhead/problem here is quality of the JIT (you need only look as far as ECMA 262 to see how much difference that can make, eg: JaegerMonkey vs. V8), CIL JIT has type checking requirements - so there's once-off validation overhead for each JIT, and lastly unlike C/C++ your JIT compiler rarely has (or wants to have, due to memory and performance considerations) a complete view of the entire program - so you don't get anything remotely similar to link-time optimisations.

    That said - for relatively flat code structures - well written C# will JIT into, in many cases, identical instructions to what GCC/Clang/MSVC will do for equivalent C/C++ code.

    The primary differences are around exception handling and boxed types. Neither of which you're going to be using heavily in performance critical code segments in C# anyway - because all of them can be avoided with well written C# or some unsafe magic.

  • Re:Take a free class (Score:5, Informative)

    by UnknownSoldier (67820) on Friday June 20, 2014 @09:12PM (#47286389)

    Three of us took that "Beginning Game Programming with C#" Coursera course. Two of us were professional programmers (myself a professional game developer) so we blew through the course; our third was a gaming buddy who wanted to try out programming -- he was an excellent gamer but had never done any programming. (Back in the day he had done a little shell scripting on Windows.)

    The coursera is NOT a beginner friendly course -- it had two major problems:

    * it teaches concepts in the wrong order, and
    * doesn't explain key critical concepts at all, or extremely poorly.

    My buddy dropped out after a few weeks because he just felt completely lost. We would spend hours going over concepts with him and he would get most of it. But when it came to the assignments he didn't have enough of the big picture and low level details to reason things out. IMHO there are better lessons out there, such as:

    * http://www.codecademy.com/ [codecademy.com]
    * http://learn.code.org/hoc/1 [code.org]

    Which is a shame too, because the professor is actually friendly, and has good intentions.

    MOOCs are "famous" for having a 98% drop-rate. Seriously, like 20,000 students signed up. Very few made it to week 5.

  • Coursera (Score:4, Informative)

    by gnupun (752725) on Saturday June 21, 2014 @05:31AM (#47287563)
    Also sign up at Coursera [coursera.org]. They have a course titled "Beginning Game Programming with C#" taught by the University of Colorado. The course also teaches basic C# syntax, so it's very beginner friendly. You just have to wait for it to be offered again before signing up.

If I want your opinion, I'll ask you to fill out the necessary form.

Working...