Announcing: Slashdot Deals - Explore geek apps, games, gadgets and more. (what is this?)

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!

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

timothy posted about 7 months ago | from the can't-sharpen-the-sea dept.

Programming 254

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.

Sorry! There are no comments related to the filter you selected.

The best way... (-1, Troll)

Anonymous Coward | about 7 months ago | (#47285517)

Punch yourself in the face until your feet fall off.

just try it, it's fun (2, Insightful)

Anonymous Coward | about 7 months ago | (#47285529)

You should just start. I'm an "expert" on game programming in C#, and the hardest thing about it is not reading slashdot.

The best way to learn $foo is to practice $foo. (3, Insightful)

Anonymous Coward | about 7 months ago | (#47285541)

So just do it. Use free tools so you don't spend coin on something until you are sure it's something you'll stick with.

help me make a game for free lol (0)

Anonymous Coward | about 7 months ago | (#47285543)

i can't help ya, dude. but i'll take what you have so far.. for educational purposes, yeah. it's all on github rite?

It's too slow. (-1, Troll)

Anonymous Coward | about 7 months ago | (#47285549)

Everyone I know that tried it, gave-up on it. Yes, it is harder to program in real C++, but it is necessary because C# is so damn slow. Even for the web-based payroll calculator my company created, we had to give-up on C#. It took almost three hours to generate a preview of our test company's payroll. With our old COBOL code, it only took about three minutes for our test company. Switching to C++ and to a real UNIX server instead of that Microsoft Windows garbage reduced the time to less than ten seconds. The C++ code was roughly a thousand times faster than C#. Of course that isn't a completely fair comparison since the C++ code ran on a server instead of a desktop OS like C# requires.

Re:It's too slow. (-1)

Anonymous Coward | about 7 months ago | (#47285563)

Doesn't C# require Windows 8? That's not a desktop OS.

Re:It's too slow. (1)

The Mysterious Dr. X (1502541) | about 7 months ago | (#47285675)

I just want to make sure you're trolling. You are, right?

Re:It's too slow. (0)

Anonymous Coward | about 7 months ago | (#47285877)

Yes, I am.

Re:It's too slow. (-1)

Anonymous Coward | about 7 months ago | (#47286035)

Windows is a gaming OS. Using it for anything else is just madness.

Re:It's too slow. (1)

steppin_razor_LA (236684) | about 7 months ago | (#47285569)

I'm not going to argue that C# is faster than C++, but 1000x seems a bit surprising. I'm also not sure why you say that C# requires a desktop OS?

Re:It's too slow. (1)

sideslash (1865434) | about 7 months ago | (#47285587)

I would say that this AC was either trolling or clueless about software optimization.

Re:It's too slow. (-1, Flamebait)

binarylarry (1338699) | about 7 months ago | (#47285659)

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

Re:It's too slow. (2, Informative)

jd2112 (1535857) | about 7 months ago | (#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:It's too slow. (1)

ericloewe (2129490) | about 7 months ago | (#47285791)

[Citation needed]

If anything, they should be comparable.

Re:It's too slow. (2)

Jane Q. Public (1010737) | about 7 months ago | (#47285855)

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

Which means, just as GP AC said, it's completely unsuitable for a "serious" game.

What OP needs to learn is C, or at a minimum C++. Nothing else will fly for this application. Rudimentary games can be done in other languages, but anything that really needs fancy graphics or fast processing will need C++ or C.

Re:It's too slow. (0)

Anonymous Coward | about 7 months ago | (#47286355)

>What OP needs to learn is C, or at a minimum C++. Nothing else will fly for this application.

Except for you know most major titles that have their own scripting engines built in, like Unreal and Cryengine. They can handle the C++ engine, rendering, AND running script, and do it efficiently enough to run on decent hardware....

C# is just fine for many games.

Re:It's too slow. (0)

digitalchinky (650880) | about 7 months ago | (#47286409)

OP doesn't necessarily need to learn C or C++. The gap in other languages is closing faster than you might be aware. Have you taken a look at HTML 5 and canvas lately? There are a load of very detailed (fancy) 3D games using WebGL, not rudimentary at all.

Re:It's too slow. (1, Troll)

alen (225700) | about 7 months ago | (#47286031)

everything is faster than java

Unless your platform requires C# (5, Informative)

tepples (727027) | about 7 months ago | (#47285589)

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. (1, Informative)

Anonymous Coward | about 7 months ago | (#47285591)

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

Re:It's too slow. (0, Troll)

drakaan (688386) | about 7 months ago | (#47286377)

Mod. Parent. Up.

Re: It's too slow. (0)

Anonymous Coward | about 7 months ago | (#47285595)


Re:It's too slow. (0)

Anonymous Coward | about 7 months ago | (#47285599)

that is probably because you had C# manipulating the data, instead of the database where it belongs

Re:It's too slow. (4, Insightful)

neminem (561346) | about 7 months ago | (#47285631)

I'm pretty sure the reason your payroll calculator written in C# was that slow had nothing to do with the .net framework and everything to do with something you failed to optimize in that version, but did optimize in the original Cobol version. Either that or you were running it on a way slower computer - a "desktop OS" rather than a "server", even though those terms are pretty meaningless and there should not be any reason you would have to run it on a desktop machine? Unless, of course, you're defining "server" as "machine that doesn't run Windows", in which case, that's pretty no-true-scotsman-like. You can make a plenty fast Windows server machine, then run headless, server-like C# programs on it.

Yes, obviously C# programs aren't going to be quite as fast as equivalent c++ programs - you *are* compiling C# code to bytecode and then running it through a virtual machine, so of course it'll be a little slower. But only a little. I doubt you could write a balls-to-the-wall Crysis-like shooter in C#, but I don't imagine there'd be any performance-related reason you couldn't write an RTS in C# and have it run just fine on any machine not so old that its OS wouldn't support the .net framework anyway.

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

Anonymous Coward | about 7 months ago | (#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:It's too slow. (2)

mlw4428 (1029576) | about 7 months ago | (#47286341)

The performance reasoning may go away sometime soon. Microsoft has been working on a native compiler and has a preview for Windows Store apps. They've said they're bringing it to the full .NET platform. At which point you get all the performance of C++ with the benefits of a robust framework and a good language.

Re:It's too slow. (1)

Opportunist (166417) | about 7 months ago | (#47285749)

Considering that he's a beginner: Badly optimized C++ code is slower than well optimized C# code. Or, in another way, if you're new to programming and optimization is the least of your problem (because getting that damn thing to compile and do what it is supposed to do is a much bigger one), it doesn't really matter that much...

One thing has to be said for C#, as much as I am a subscriber to the "If C is Play-Doh, and C++ is Lego - C# is Duplo" philosophy, it does allow to get results fast without having to use a ton of libraries that in the end weigh you down more than C# would.

Re: It's too slow. (1, Insightful)

Anonymous Coward | about 7 months ago | (#47285819)

Ok. I'm going to make wild ass guesses here.

1. Your company was using COBOL-based payroll system. FROM WHICH:

      a. Your company is not in the business of writing software for sale to others. They're not software engineering experts.

      b. Your company's business process changes very slowly. It is not a dynamic working environment. Slow growth, if any, OR

      c. Your company's business is highly regulated.
2. Your management is fairly conservative.
3. Management does not know, value or do a particularly good job of using technology to increase productivity and automation.

This kind of environment isn't a preferred opportunity for highly skilled, creative software engineers. Your engineers were likely average or low-average talent. Probability. Not fact. That's OK. Not everyone is a superstar. It doesn't take superstars to get the job done. It just takes work.

People who really understand how to work in COBOL have a set of patterns and ideas about software engineering that is a lot different from
the usage patterns in which Java and .NET were designed to perform well.

I'm not saying that there aren't plenty of engineers who "get" COBOL who also "get" .NET. It's just that gaining expertise in those to skill sets come from divergent experiences.

Finally, it's just not that hard to do things with .NET and Java that make it be slow. They're garbage collected and safety checked. Sometimes that hurts.

So, bottom line, your software engineers probably used C++ to construct a system that was likely structured a lot like the COBOL system was structured. It's safer to do it that way.
And likely, some of that structure and a few of the idioms they used within it were killing performance on .NET. .NET and Java are awesome platforms. They have limitations. It's not always clear what they are at first glance.

The good news is that most of the time, you can get a lot of performance gains for not much work if you just sit down and do it methodically.


There's a lot of games out there with core logic and game engine type stuff written in C#. The graphics, IO, Sound systems are the ones that have to perform fast.

When you want to push a lot of bits, code closer to the hardware. When you want to do a lot of complex logic, give yourself some help with higher abstraction.

Good luck.

Re:It's too slow. (4, Interesting)

Anthony Turner (2906247) | about 7 months ago | (#47285823)

I'm currently using C++ for developing an RPG, and I would recommend it over C#. I don't know much about C#, butI have coded in it a few small programs. C++ is very well known in game development. I would recommend it and a framework such as SFML or SDL. Once you get more familiar with these, you can move onto learning Directx3D and OpenGL. Learn about Game States (I just learned this the other day and it drastically makes management of game code so much easier), game timing, game loops, Isometric games, sprite-sheets and tiling. The latter two are important for 2D games and since you are building a RTS, It may be essential for you. I know you are not doing a RPG game, but a lot of the material can be used for an RTS. I'm following a book called Programming Role Playing Games in Direct x, it's not for beginners, but it has valuable information on gaming algorithms for Enemy AI, Game States, Game loops, etc. I would recommend checking out Coke and Code ( type that into Google ). I think the same person also released a Youtube RPG tutorial series. 3DBuzz has some tutorials, but some are paid. There C++ one also does a RPG game. SFML Made Easy is another series on Youtube that is really good. It wont be an easy task, just start small, take your time, and don't do too much at once. Start with just getting a character walking around on a screen ( this will require animation frames, so look that up ). Understand the update() and render(), calls in a game loop.

Re:It's too slow. (0)

Anonymous Coward | about 7 months ago | (#47285913)

You are troll sir. All our midle tier messaging and web services layer is built using c# and web api [with a mix of WCF] and it's blazing fast. I guess you have an incompetent programming team!

Re:It's too slow. (1)

Qwertie (797303) | about 7 months ago | (#47285997)

C#'s speed depends on the coding style than on the language. If you know what you're doing, Microsoft .NET gets within 2x of C++ speed most of the time. Mono is substantially worse (have a look at these benchmarks [codeproject.com] , which focus on simple programs that are written in a "C with classes" style.) If you are using features like LINQ (considered a "must-have" C# feature) you'll take a performance hit, but when you write C# code as if it were C code then its performance isn't far from C. Luckily you don't have to write the whole program so carefully, just the parts that have to be fast.

Games aren't just concerned with what is traditionally thought of as "speed", namely throughput; games are also concerned with latency. C# is based on Garbage Collection, and GC tends to add more latency than deterministic memory management (C/C++). Since writing games largely in GC languages is now a very common thing (e.g. Java on Android), I'm sure articles have been written about how to avoid getting bitten by the GC, but I don't have an article handy to show you.

I doubt the OP wants to write a graphics engine in C#. I'm no game dev so I won't suggest an engine, but the point is, the most sensitive part of game performance tends to be in the area of graphics, and you probably can use a C# wrapper of a C++-based graphics engine, so that the overall performance of the game doesn't depend that much on the performance of the .NET CLR (but performance may be sensitive to native interop costs, which are not insignificant. Interop benchmarks are included in the link above.)

Re: It's too slow. (1)

halfdan the black (638018) | about 7 months ago | (#47286161)

Once the app is up, if done right, performance can be decent for most things, pretty comparable to C++. The big thing is once it's up. The REAL killer of any c#/.net app (or any env that requires a VM like Java) is the load times. Even tiny c# apps take forever to load. So I would really recommend c++. I know if you really wanted you can do cross platform with mono but it's a lot easier with c++, especially if you use a framework like SDL.

Udemy (3, Informative)

Bodhammer (559311) | about 7 months ago | (#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.

Re:Udemy (1)

ZenMatrix (1299517) | about 7 months ago | (#47286317)

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.

Has anyone actually used these. I've looked at some of the courses but haven't been able to bit the bullet even with some of the deals they do.

Pick up a book and turn off the internet (1)

cyberspittle (519754) | about 7 months ago | (#47285579)

Once you don't hear the noise, you can think. With no internet, you won't be able to cry for help and then have to work through your own problem. Don't worry about reinventing the wheel.

Re:Pick up a book and turn off the internet (1, Insightful)

Anonymous Coward | about 7 months ago | (#47285703)

Yeah, no shit... is anyone else sick and tired of these Ask Slashdot "stories" where the obvious answer is "pick up a fucking book"?

Seriously, Amazon has a shitload of them with titles like "C# Game Programming," "Learning C# by Programming Games," "Beginning C# Game Programming" etc. etc.

What the hell is wrong with kids these days? Oh... I'm sorry, the question was "what's the BEST way?"

There are these little stars next to the book titles on Amazon...

mess around in unity3d (3, Informative)

Anonymous Coward | about 7 months ago | (#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

Re:mess around in unity3d (0)

Anonymous Coward | about 7 months ago | (#47285679)

This. Also most of their documentation is in javascript, but objects and methods work the same on both sides. they mix disgustingly well.

Re:mess around in unity3d (4, Informative)

gbjbaanb (229885) | about 7 months ago | (#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:mess around in unity3d (1)

Anthony Turner (2906247) | about 7 months ago | (#47285745)

Agreed. I seen some of Unity, and I really don't like. I would much rather code directly with C++.

Re:mess around in unity3d (1)

eulernet (1132389) | about 7 months ago | (#47285989)

If you really want to code games, stick to what most people in the industry use - C++.

While I agree with you, because C# is too high-level for game programming, Microsoft just released a native C# compiler:
http://msdn.microsoft.com/en-U... [microsoft.com]
This should provide performance almost equivalent to C++.

Re:mess around in unity3d (0)

Anonymous Coward | about 7 months ago | (#47286151)

Or, heaven forbid, you could use the Visual Studio Express for Web, which is a free download from MSFT. In that you can do Basic, C, C++ and C# and there is even the ability to do F#. But, of course, for all you /.ers, it is MSFT and not some Open Source stuff.

Re:mess around in unity3d (1)

ZenMatrix (1299517) | about 7 months ago | (#47286329)

why web.... just download c# or even better try xna studio to start. They give you a basic start and go to http://xbox.create.msdn.com/en... [msdn.com] for help on where to start

Re:mess around in unity3d (3, Insightful)

Brulath (2765381) | about 7 months ago | (#47286235)

Not every game needs to be super CPU-intensive though; Hearthstone is created in Unity3D, for example, and that works super well on everything but an iPad2. Skipping C++ initially and learning to create a game in Unity3D with C# is probably a wise choice for a bunch of people, at least for prototyping and for a wide variety of games that aren't CPU-limited.

Head First C# (5, Interesting)

__roo (86767) | about 7 months ago | (#47285603)

Warning: this is blatantly self-promotional. It's also a pretty good answer to the question, I think, so hopefully I won't get violently modded down.

It sounds like you're exactly who Jenny Greene and I wrote Head First C# [oreilly.com] for. I played around with a lot of different ways to teach both C# language and core object oriented programming and computer science concepts, and I found that building games was easily the most satisfying way to do it.

The only way to really learn a language is writing a lot of code, and one of the biggest challenges I had putting the book together was coming up with many different projects. The answer was games: a card games, a turn-based game, arcade games -- it turns out that building a game is a great way to keep readers motivated, especially when they're learning new concepts. I've had a lot of really positive feedback from first-time programmers who found it really satisfying to get through the book, and especially building the final project (a retro Space Invaders game).

You can download a free PDF of the first three chapters of Head First C# from the O'Reilly page [oreilly.com] and see if you like it.

Re:Head First C# (0)

Anonymous Coward | about 7 months ago | (#47285859)

I've picked up the Head First books on HTML5 and the more recent one on JavaScript. They are truely great.

I have no experiance with the C# Book, but if it holds true, then it's most defently worth your time to download the first three chapters.

Re:Head First C# (0)

Anonymous Coward | about 7 months ago | (#47286407)

Nothing against the authors, but I find the Head First format infuriating. They try sooooo hard to keep your interest and keep you on track so you don't get bored while reading a dry computer text.

Unfortunately, I'm the kind of reader who learns best by jumping around a lot - I like to skim over the headers, read the captions on the illos, look up terms in the index etc. This reinforces the concepts so that when I dig into the section text, I'm well prepared.

Head First books are almost impossible to read this way. 'A' for effort, but they are definitely geared toward a certain type of reader.

Re:Head First C# (1)

fldsofglry (2754803) | about 7 months ago | (#47286421)

I really enjoy the Head First Series of books. Head First C and Head First C# are great!

C#? (5, Interesting)

Dan East (318230) | about 7 months ago | (#47285605)

Why C#? Develop your game in C++ using OpenGL ES for rendering. Your code will compile as-is for iOS, Android, Windows, OSX, and others. You will only need a couple hundred lines of native code (java for Android, Objective C for iOS, etc) to handle events and pass execution into your C++ code. My game engine runs on all the above platforms and 99.9% of my code is shared across all of them.

Also, these days many, many developers simply use an existing game engine and only bother with the high level code specific to their game. Mundane stuff like the low level rendering, Audio APIs (which unlike OpenGL ES, differ quite a bit from one platform to another), physics, etc, is ground that's been treaded several thousand times nowadays, and most game developers leave that stuff to the experts in the various fields to handle the nitty gritty. Optimization of those routines is usually where the "expert" part comes into play.

I work with a game designer / artist who implements all the high level game stuff in Lua, and my engine takes care of all the aforementioned "boring" stuff, freeing him up to actually develop games, and not worry about crap like polygon tessellation algorithms and tons of other very boring stuff that would just be a waste of his time.

Re:C#? (1)

ncmusic (31531) | about 7 months ago | (#47285737)

You mean high level like http://unity3d.com/unity [unity3d.com] ?

Take a free class (0)

Anonymous Coward | about 7 months ago | (#47285615)

Like this one coursera [coursera.org] or you could check into one of the many free game engines like these: develop-online [develop-online.net]

Re:Take a free class (4, Informative)

UnknownSoldier (67820) | about 7 months ago | (#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.

Swift! (0)

Anonymous Coward | about 7 months ago | (#47285617)

If your going to learn a proprietary language from scratch to program games you might as well learn Swift. Your game will perform better and be playable on more devices. Cocoa/iOS have great APIs for what your trying to do.

Re:Swift! (0)

Anonymous Coward | about 7 months ago | (#47286163)

You might as well try to learn English too while you're at it.

Re: Swift! (0)

Anonymous Coward | about 7 months ago | (#47286411)

Someone made a typo! Now I too can make a "witty" comment on the internet!

Play with Unity3D (1)

sideslash (1865434) | about 7 months ago | (#47285623)

You start out saying that you have no real programming experience, but at the end say that you feel like you have a good foundation to build on. I think that is a contradiction. Serious game development benefits tremendously from a deep knowledge of computer science, and you are likely to struggle to accomplish much without a solid foundation in programming.

With that said, I suggest you download Unity3D and play around with it. You can do a lot purely visually, and knock yourself out with as much C# scripting as you feel like doing. In my opinion, it's both a low barrier to entry and a great option for you to quickly put together something much more than the OpenGL/DirectX equivalent of Hello World.

Disclosure: I am currently developing a cross platform MonoGame based game written in C#.

Re:Play with Unity3D (3, Informative)

Anonymous Coward | about 7 months ago | (#47285719)

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.

Re:Play with Unity3D (3, Insightful)

Shaterri (253660) | about 7 months ago | (#47286027)

To reinforce this: Building your own engine is a great way to fall into a trap that you won't escape for years if not decades. If you're interested in building a game, then you should build a game, and use the toolchain that lets you get to your game as quickly as possible. Right now that's a race between Unity and Unreal Engine 4, and while neither one has perfect support, I'd say the userbase for Unity is sufficiently deep that it's a better starting point. Don't worry, you'll still get plenty of opportunity to code (and to learn C# - another reason to go with Unity over UE4, if that's the language you really want), but there'll be enough that you don't have to code that you can focus on the fundamentals of building your game.

C#? (0)

Just Brew It! (636086) | about 7 months ago | (#47285637)

While C# may get you ahead in the business world, IMO you really need to go with something more OS-agnostic unless you're OK with limiting yourself to MS platforms. C++ (or Java... maybe) and OpenGL are the way to go IMO.

Re:C#? (1)

Anonymous Coward | about 7 months ago | (#47286391)

lol, are you kidding me? C# runs on all major desktop, mobile and console platforms. And so does unity and it's tightly integrated with c#

Do you even endofunctor bro? (5, Funny)

Anonymous Coward | about 7 months ago | (#47285641)

Forget C#. Start with Haskell and get a PHD in category theory and applied mathematics. Then study GHC internals for several years in order to figure out how to make Haskell fast enough for anything non trivial. Only approach game development once you have a solid understanding of GHC internals, endofunctors, lenses, monoids, monads, comonads, cofree, cofree comands, synergistic cold fusion, rankntypes, multi parameter typeclasses, string theory, functional dependencies, synthesized kinetic energy, generalized new type deriving, existential quantification, existential crisis, scoped type variables, GADTs, the space time continuum and have solved the halting problem. Also reimplement the entire standard library because the current one is terrible and horribly inefficient.

Either that or pick up any of the few dozen C++, C# or Python game development books and start reading.

Re:Do you even endofunctor bro? (1)

Darinbob (1142669) | about 7 months ago | (#47285995)

I wondered a bit recently about "game programming" and what that really means. This morning on a radio show about maker fairs, one person said her young daughter was on a one or two week game programming camp. It really dawned on me that game programming just does not mean what I think it means. But guess is that the kids must be using pre-build gaming platforms and then scripting on top of it. Similar for the weekend hackathons, they can not possibly be writing a game from scratch, they don't have time to optimize any code, it takes at least a weekend to learn a new API even if it's at a high level. I wonder if people are getting an overly simplified view of what game programming really means, or worse, that programming itself is something easy (and which doesn't require extensive training and education).

(and scientists have never actually been able to detect a monoid in a laboratory setting)

C# MMO (1, Informative)

Anonymous Coward | about 7 months ago | (#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/

Re:C# MMO (1)

freeqaz (1626503) | about 7 months ago | (#47285717)

This is me on my actual account. To follow up, for cross-platform support you have Xamarin's tools which I've used in the past. Really depends on your priorities.

Teach yourself (1)

michael_rendier (2601249) | about 7 months ago | (#47285671)

you have your game...what's the first thing you're gonna need to program? (I needed a GUI for a project of mine...teaching myself python...started there) Ask google how to accomplish this. You may end up spending time in and around the stack exchange sites...and as each 'challenge' arises, you dig around and find out how to write it yourself, and in the process, slowly teach yourself c# (or any other language for that matter)...the important thing you already have, is familiarity with object oriented programming...the rest is just syntax. You're likely to get better results that way. Also as you spend your time sifting through answers on google, you'll likely come across peoples suggestions for reading or teaching etc...good school sites, sites bent on game creation and language of your choice...

Choose another language (4, Interesting)

richardtallent (309050) | about 7 months ago | (#47285695)

I love C#. I program in it every day. It's plenty fast, and it's a great language.

However, there are two reasons I would suggest looking to another language.

First, the hottest market for gaming right now is mobile. While it's possible to compile C# for iPhone or Android using Xamarin (along with Windows and OS X), it's not exactly a native experience.

Second, C# (like O-C, C++, etc.) is a general programming language -- it's not in any way specific to the domain of game programming. So, while it's *possible* to design complex games in any modern language, you're probably going to spend *way* too much time dealing with silly stuff like tracking graphics resources and animation loops and simulated physics. You'll have a higher chance of success if you use a language and platform that is more game-specific out of the box.

I would suggest looking into Swift -- it'll give you access to the lucrative iOS market, it's C-like, and it has features that are game-specific. Sure, it's a new language it doesn't compile to Android, but by all accounts it looks like a great language with first-class support for gaming, so you can focus less on infrastructure code and more on the game.

Another option would be HTML5. Depending what sort of game you're looking to build, Javascript and HTML5 may be just the ticket, and there are a number of libraries that can abstract away browser differences and assist with the plumbing needed to make a game run.

Re:Choose another language (1)

Anonymous Coward | about 7 months ago | (#47285795)

I would suggest looking into Swift

You're either trolling or you're retarded. Which is it?

Re:Choose another language (0)

Anonymous Coward | about 7 months ago | (#47286055)

You're either a Microsoft shill or an Android fanboy. Which is it?

XNA (1)

ZeroSerenity (923363) | about 7 months ago | (#47285709)

Might be depreciated but it's tailor made for C#. Go look it up.

Re:XNA (1)

Anonymous Coward | about 7 months ago | (#47286319)

But first, you go look up "deprecated" and "depreciated" in the dictionary.

Start with the engine (2, Interesting)

Anonymous Coward | about 7 months ago | (#47285757)

Pick an engine you want to use first, then pick a language to learn that is used by that engine. Very few games now are written purely in a native language with no supporting engine, so pick a modern game engine that will do a lot of the hard, low level work for you. Then, learn the language that is used for interacting with the desired engine. For example, if you wanted to use the Unity engine, then you would basic learn C#. If you wanted to use CryENGINE, then you would learn C++ and Lua scripting. If you wanted to use the Unreal4 engine, then you would learn blueprint visual scripting and C++.

Once you know the engine and language you need to use, then pick up a book, take a course, etc... There are lots of ways to learn a language, but the most important thing is to practice, especially in the environment and engine that you plan to use. Each of the engines have extensive documentation on how to program for their engine and interact with the game assets.

Patterns (4, Informative)

CODiNE (27417) | about 7 months ago | (#47285767)

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.

Re:Patterns (1)

mistshadow (35753) | about 7 months ago | (#47285999)

I would also recommend this; well-written introduction, and talks a lot about the systems-issues that come up in games programming as well.

There is no such thing as "Learn Game Programming" (1)

goruka (1721094) | about 7 months ago | (#47285777)

The best way is to make games first, then see what language do you need later. Most games do not even need something such as C# and what might seem as " more powerful" can also be seem as "more wasted time doing something more complex than needed".

Re:There is no such thing as "Learn Game Programmi (1)

Darinbob (1142669) | about 7 months ago | (#47286045)

Then what are they built in? I've been wondering this because of a lot of stories and anecdotes about quickly built games, hackathons, etc. Is there some sort of "game builder" software that everyone uses, an update of RPGmaker that's actually useful, or...? Having been programming for 30+ years, I haven't seen any programming that is as easy as these hackathons or makerfaires seem to imply it is.

Re:There is no such thing as "Learn Game Programmi (3, Informative)

St.Creed (853824) | about 7 months ago | (#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.

Don't focus on C#, you want game dev methodologies (0)

Anonymous Coward | about 7 months ago | (#47285799)

(Currently a CS undergrad with a deep love of games. Highly inexperienced, but I hope you'll find something useful here)

I understand some of the problems with wanting to make your own game. That you've chosen a language is a big first step. I can only assume you've decided not to go with a game engine like Unity3d and you have your reasons for that.

So I'd suggest this old book that I really like, it's called The Black Art of 3D Game Programming. http://amzn.com/1571690042 It's from 1995 but a lot of the basics are still the same. You just have to take it as a mini-primer. There's plenty of good information there if you're willing to dig through it.

There's a lot of other books that will get you going with a basic understanding of what the game engine is going to need. Basically, you need to handle graphics, sound, events, user interface and probably networking.

How you build those is really up to you.

There's a book I have heard good things about but I never have the money or opportunity to look at it: Game Coding Complete http://amzn.com/1133776574

I suggest trying that. Don't worry if the code in it isn't written in C#. If you pick up a little C or C++, translating it to anything (java, javascript, python, or c#) is really trivial.

Good luck!

Unreal 4 (5, Insightful)

alteveer (979070) | about 7 months ago | (#47285841)

My advice, as a professional game developer, is "don't write code unless you need to."

If you must write C# you should take a look at Unity, but honestly you would be remiss if you overlooked Unreal 4. It is the newest version of the Unreal Engine, and it includes most of the most important features of a game; behavior trees, navigation, user interface, physically-based rendering, animation state machines, multiplayer replication, etc. You can do most of what you want to in Blueprint (a visual scripting language), and if you really need to, you can edit the source code (the license is a full-source license) and make what enhancements you need in C++.

Writing most of this shit from scratch will take you years, just get down to the actual MAKING of the game, and use someone else's engine. The terms are fair ($20/mo, 5% gross revenue for PC platforms and mobile), and the engine is extremely well curated.

Re:Unreal 4 (1)

alteveer (979070) | about 7 months ago | (#47286271)

P.S. anonymous reader: you don't know what you are getting yourself into. I wish you luck, but honestly unless the exercise is academic, at least use Monogame (http://www.monogame.net/) if not a real, fully integrated, third-party engine. Seriously, then you will actually get to do game programming and game design.

Keep dreaming but don't give up the day job! (0)

mtthwbrnd (1608651) | about 7 months ago | (#47285879)

Let's get this straight. You have no programming experience and you want to make games. Well, I am a fat 42 year old without a drivers licence but I would like to become an F1 driver. We can all dream, but I am not going to post a question in F1 Magazine asking for advice on how to get signed up by a team.

These days games are made by production companies. They have huge resources and budgets. This is a good thing. It means that the games are better than you would get from one guy sitting at home. No matter what language you use, you are never going to come up with a competitor to Gran Turismo or GTA et al. by yourself. Whole teams work on these projects for years. Even Jon Skeet could not do this.

Re:Keep dreaming but don't give up the day job! (0)

Anonymous Coward | about 7 months ago | (#47286041)

These days games are made by production companies.

And that's why, these days, most games suck.

Re:Keep dreaming but don't give up the day job! (0)

Anonymous Coward | about 7 months ago | (#47286083)

There's still a place for the bedroom programmer, though the chance of making a living from it now is slight.

Re:Keep dreaming but don't give up the day job! (1)

St.Creed (853824) | about 7 months ago | (#47286179)

The maker of Flappy Bird would like to disagree. So would Vlambeer Studio. And a whole host of small indy gamestudios.

You have to pay $$ to use C# in a game. (-1, Troll)

goruka (1721094) | about 7 months ago | (#47285893)

Everyone is getting into C# because of Unity, but this is actually a trap. If you want to make a C# game and publish it on mobile without restrictions you have to pay. The only portable C# implementation that works on mobile (besides Windows Phone) is Mono. Their class library is LGPL, which is in a grey area, Xamarin says:

"Typical examples of commercial licensees include device manufacturers embedding Mono in hardware where the user is not able to independently upgrade the Mono virtual machine from the source code"

This rules out Android and iOS. Unity has a free version but also has restrictions:

Unity Free, which include the free platform add-on products, may not be licensed or used by a commercial entity with annual gross revenues (based on prior fiscal year) in excess of US$100,000, or by an educational, academic, non-profit or government entity with a total annual budget for the entire entity (based on prior fiscal year) in excess of US$100,000.

So, again, make sure you are doing your research well, because you might end up in an unexpected situation.

Re:You have to pay $$ to use C# in a game. (4, Informative)

paulpach (798828) | about 7 months ago | (#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 :).

You Already Know It (1)

Jaime2 (824950) | about 7 months ago | (#47286051)

I think it's interesting that you know Visual Basic, but want to get into C#. My first question would be "Why?". Both run on the same framework and both are equally capable. All you're doing is learning new syntax to do things you already know how to do. After that question is the comment "You pretty much already know C#". Sure, it's a different language from VB, but that's the easy part. It uses the same tools and libraries, so you know 95% of it already.

Re:You Already Know It (0)

Anonymous Coward | about 7 months ago | (#47286331)

Visual Basic != VB.Net ...

Re:You Already Know It (2)

Jaime2 (824950) | about 7 months ago | (#47286401)

Visual Basic went to .Net five versions ago. It was acceptable to take VB to mean classic VB in 2003, but in 2014, you have to say so if you mean the old stuff. The VB6 development environment doesn't even run on any supported operating system. VBA is still around, but it's always been incorrect to refer to VBA as VB.

Get the best book. (0)

DMJC (682799) | about 7 months ago | (#47286071)

Get howto program Linux games, and get a copy of the OpenGL spec. That's about all you need. It tells you howto setup the engine for proper operation. Swap out the 2D renderer from the book with a 3D renderer you write yourself. Simple enough.

This retarded idea again (0)

Anonymous Coward | about 7 months ago | (#47286121)

Making your own game isn't kid stuff. You've got to be prepared to take on a professional mindset when you are using professional tools, otherwise your efforts will be hurt (the whole affair will be a waste of life, you'll build false confidence by using the wrong skills, etc.)

Here's a clue: programming language does not matter at all. The purpose of learning your first programming language is not to know the language, but to gain competency in expressing your thoughts in computer-interpretable written language through practicing writing in this language. All the major programming languages are the same exact thing, C, made with different ideas about what makes pleasant syntax and what 'extra features' are needed for modern code-writing. They all decide on pretty much the same thing.

That being said, if you really want to be pro, you'll do all the work you can in C++. All the languages are basically the same, but C++ is slightly better in several ways.
C++ will always be the best text-based interpreted programming language. It's lean, mean and everyone uses it. Java is proprietary bullshit, a dinovampire that should have had a stake through its heart 20 years ago. C# is the same thing but younger and from Microsoft. C is a dead language, the only use is writing for old hardware. Lisp and all the other gimmicky languages should never have been created. Python is trash. Fuck everyone who uses that shit.

C#? (-1)

Anonymous Coward | about 7 months ago | (#47286165)

Screw C#. Learn C++ like a man, or if thats too "hard" for you, use something like Unreal Engine and let someone smarter than you do the heavy lifting.

Learn something else (2, Insightful)

gweihir (88907) | about 7 months ago | (#47286173)

Unless you want to be locked in to MS? Learn, any of the things that also work on iOS and Android and you may actually end up with an useful skill.

Motivation? (1)

mike260 (224212) | about 7 months ago | (#47286209)

The fact that you're not already coding and Ruby couldn't hold your interest makes me wonder exactly what you want to do and why.

If you plan to learn to code mainly as a necessary step towards creating your dream RTS then I hate to piss on your fireworks, but you're wasting your time. It's just way too much dang work and frustration for something you don't find interesting and exciting in and of itself.

If I got the wrong idea and you do find coding interesting, forget about the RTS for a while and just worry about getting good at the basics.

C++ C# (0)

Anonymous Coward | about 7 months ago | (#47286251)

I've messed around with various languages. Save yourself the time and trouble and go with C++. You will undoubtedly run into road blocks with C#. C++ is the king!

Build a simple first game ! (5, Interesting)

eulernet (1132389) | about 7 months ago | (#47286309)

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

I'm sorry, but your long list of "I did this and that" means only that you are a gamer with a few artistic skills, it has absolutely no value for game programming !

During my 18 years of game programming, I met a lot of people that had "wonderful" ideas (it's funny how everybody has a dream game), but no skill to realize them.
They always boasted about the fact that their idea was great, but their project never got released.

Writing a game requires the following skills:
1) technical skill: coding
2) art skill: graphics/animation and sound/music
3) gameplay skill: making the game enjoyable
4) story telling: making a coherent game's universe
In my life, I never met a single person with all of these skills, at a decent level.
The most talented ones had only 2 skills.

Firstly, before coding your dream game, try to write a very simple game. It will show you where you'll need help.
If you are a beginner, you won't be able to code Starcraft.
Try something related to your project, so you can increase your knowledge.

Secondly, since most of the CPU power is spent on display and AI, you'll need to learn:
1) how to optimize the display.
Since the whole screen needs to be redrawn very frequently, you have to learn techniques to render fast.
There are tons of techniques in 2D and 3D.
2) AI algorithms, most notably path-finding algorithms if you want to program a RTS.

Thirdly, try to build a prototype in one month.
If you are able to build it in one month, you'll probably be able to work on your project during several months.
It will also show that you don't lose yourself on details (non-professionals tend to waste their time on small details, thus the final goal disappears).
If you are unable to build it in one month, it means that your project is not well defined, probably too ambitious or completely unrealizable.

Fourthly, I would recommend to build a motivated team around your game.
This is a virtuous circle: when your motivation will decrease, they'll encourage you and when they'll get demotivated, you'll encourage them.
Nowadays, I believe that it's impossible to write a game alone, unless your game is very simple.
Find people who believe in your project and who may help you.

You may be wasting time... (0)

Anonymous Coward | about 7 months ago | (#47286313)

By not using an engine, and writing it from scratch you may be wasting time you'd otherwise be spending on actual game content.

If you want to actually make a game, rather than learn some language you should check out ready-made engines, for example http://springrts.com/wiki/About or any of the dozens RTS engines out there.

wrong (1)

slashmydots (2189826) | about 7 months ago | (#47286357)

Don't learn C# for game programming. None of the major engines use it. Learn C++
That's directly from one of the game designers of Ghosts.

Some options (1)

mjzemek (1925430) | about 7 months ago | (#47286385)

I once spent ~6 months making an RTS in C# and it was quite hard, but I had the basics - shooting tanks, pathfinding, economy, 3d maps. I did it in XNA with the help of Riemers tutorials [riemers.net] .

These days, monogame is now 'the C# way' of writing games. As a bonus you get multiple device support, but the the thing that is good for you is it's very like XNA, which until recently was the best choice, so all of the XNA tutorials still have relevance for you.

Unless you are making a simple game, C# is not going to cut it. If you are making C&C1, then it will be ok, but if you plan to make Supreme Commander then you will need C++ for performance reasons. Still, you could get it up to a certain level with C#.

I am a (perhaps obsessively) massive fan of the RTS Supreme Commander Forged Alliance and play daily on FaForever.com. In my mind the game is a technical marvel and recently I have come to understand how it is built, which may interest you. All of the hardcore processing is done in C++ (physics, pathfinding, 3D) and all of the game logic (eco, unit definitions, is a building finished, what can a unit do, ui) is done in LUA, which is like javascript. All of the LUA files are included in the game so you can see how they do things, but you can also edit it and change it. In fact you can rip all of the content out of the game and replace it with your own models, sounds, bitmaps, units, logic and behaviors. I think this could be interesting for you because you could actually implement your entire game now using their engine (it's called the moho engine) which would get your game up and running instantly (without having to spend 1 month just to get pathfinding working). You could never sell it this way, but in terms or rapid prototyping it's a great idea.

I'm not sure if you've thought about it but you will be a) building a game engine and b) building a game that uses it. The first step involves crazy headaches and frankly, a level of programming that most developers never achieve. Why not skip it?

unity3D (0)

Anonymous Coward | about 7 months ago | (#47286441)

Do Not try to write your own engine. look for an engine with favorable licensing terms, good features, and a scripting language you are comfortable with.

unity3D is written in optimized C and has scripting hooks in mono C#, plenty of options and plugins.

Want to learn how to make a game? Just do it. (2)

Mystiq (101361) | about 7 months ago | (#47286449)

I started by working with the Quake 3 engine and seeing what I could do to it. I wound up modifying the guns by adding new firing modes, modifying how the camera a little and learned how to add effects to the game.

Then I messed around with the trigger editor in Starcraft.

Then I messed around with the trigger editor in Warcraft 3 and made a lot more complex things, including implementing the character progression system from a single game from a popular Japanese RPG series -- which shall remain nameless -- in a tower defense map. (It was an awesome-bad project.)

What did I find? This taught me the basics of game programming as well as a lot of about algorithms. It made me a better programmer. Then I made some Starcraft 2 maps, one of which was a port of a Warcraft 3 map. Then I said fuck this, and took the RPG I started in Warcraft 3, moved to Starcraft 2, and I now have a 2D RPG game engine written from scratch for PC that is well beyond the progress of either of the maps it came from. I would argue you don't learn to program games in a language. You just learn the paradigms used to make a game work, and then apply that to a language. You want to learn? Do it. Books may help if you get stuck along the way, but do yourself a favor and stick to libraries if they exist. No one wants to draw their own fonts or write a PNG loader.

Although yes, you may learn some more about the language you're using along the way. I learned a lot about C++. Try to stick with learning to do things The Right Way (tm) and you will surprise yourself with what you learn. For the record, I wrote my own game engine because I wanted to learn how to do that. I sometimes wonder if I should have used a ready-made engine but the learning experience is massive, although I don't recommend it for everyone. I am quite insane.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?