I'm tryig to learn C# programming with the aim of creating games, but boy is it a struggle.
I think the stumbling block for most people (and I include myself in this group) whose primary interest in programming is games related, is that a large conceptual leap is required between document-based programming and real-time programming - and there simply isn't any sufficient discussion or tutorials explaining the fundamentals of the concept to ease the transition.
The basic problem is anyone who starts out learning a language like C# pretty much finds themself with nothing but books teaching the language from the perspective of programming forms, event-handlers, interacting with controls and basically looking at exercises and code samples stuck in the traditional non-real-time event-driven realm. For some reason it seems all programming language books for beginners insist on taking this tack.
Then when you realise that in order to create games you suddenly need to change your mindset completely beyond the event-driven paradigm, you find yourself in some kind of conceptual limbo land because there's scant discussion and tutorials on the concepts behind how real-time game code frameworks should be strucutred and how they work. Quite odd considering the framework is the very foundation of your project.
What's needed are good beginner books and online tutorials that as well as teaching you about the language of say C# itself, do so by also focusing on exerices that relate specifically to game programming. When talking about arrays for example, why not form the discussion around the subject of a player character's inventory of items Or how arrays can describe a simple tile-based map structure
It's not a huge leap to assume that anyone interested in games programming has played lots of computer games. Pairing up a technical discussion of what might be alien terms (in this case arrays, structures etc) with something the reader is very familiar with from their gaming sessions, (player inventories and game maps) will surely be grasped that much faster by the reader. More so than by simply throwing exercises based on deathly dull bank accounts and customer lists, which would only interest accountants and salesmen :)
Surely it's not impossible for book authors that aim to teach beginners about a language to come up with game programming related samples and exercises
To date I haven't found ANY game programming book that accomplishes this. All game related programming books I've been exposed to appear to approach the topic from the viewpoint that you are already quite familiar with your chosen programming language, gained no doubt through having to endure the document-based application programming books to get to this stage. Even then, every game programming book I've seen goes on to completely fail to adequately address the fundamental concepts of making the transition from document-based application programming to a real-time program code and framework.
More beginner/intermediate level coverage of this transition from moving from the basic Windows Program project template code to custom-written real-time frameworks created from a blank project template is sorely needed I hope some budding author, and website tutorial series writers, out there can see the need for a radical, fully games related alternative to the standard Beginners Guide to <insert fave language here> books.
Microsoft is doing a sterling job of highlighting how much fun game programming can be with the release of the Express editions of Visual Studio languages, as well as the XNA Game Studio Express technology. But even the programming articles on its Coding4Fun website suffer from the issues I've mentioned above when explaining general programming and game programming conceps. There are just too many gaps.
- Seef

Learning a programming language AND game programming concepts simultaneously a pipe dream?
bxchan
WalangAlam
Well who said programming games should be something easy to do :) , it needs lots of handwork, reading, learning, and much more key issues as Ambition and intelligent to do it.
I think you have to learn the language then move to how implement games in that language, other wise you will need HUGES books to explain it, maybe you need to search more because there is many programming books for game beginners, at some point those books expect reader to be familiar with basic concepts then they start with the real deal, i started personally with C++ (and still stuck with it !!) but the concept is almost the same for all languages, here is some good books & reference that will help you:
· Microsoft C# Programming for the Absolute Beginner By Andi Harris.
Also there is many websites the offers great deal of tutorials:
Again start reading basic concepts then move to game programming books it will not be hard to map between concept & the real-life programming, And we ready here for you anytime to answer any Questions you want :)
Good luck.
cool_shezz
The code he is using is Beta 1. I believe in one of his posts on the site or his personal blog he talks about taking a break to look over Beta 2. And yes OnStarting() is one of the things that the XNA team moved. To see some of the changes you can look over at http://blogs.msdn.com/xna/. This is only a partial list from what I know. I am still on the look out for a good tutorial for Beta 2, but since it just came out I doubt we will see one any time this week or next.
I did read that xnaresources.com have updated their Tile Engine tutorials have been updated for Beta 2. However, if you are learning C# at the same time and have no programming experience, I do not recommend trying those because they assume you know C# already. I know that the Beta 1 tutorials over there were good and compiled correctly, but I have not tried the Beta 2 upgrades.
piers7
Stick in their, I was a beginner to (err guess i still am). the two books that ive used the most so far is Tom Millers second book, "Beginning 3d Game Programming", and Microsofts visual c# step by step.
In my opinion the hardest thing about starting out is you always want to make something amazing right away, and this is insanely difficult. I puttered around for about two years without really accomplishing anything, but about a month ago I just dove into it, spent a lot of time combing these forums, and now I have a good engine that I wrote from scratch, and am working hard on adding more features to it.
mohsen bolhassani
Gee THAT IS REALLY HARD! Sort of like Life!
TRY THIS LINK http://www.samspublishing.com/articles/article.asp p=98831&seqNum=2&rl=1
Not sure it is C# but has alot of 'stuff' to get started.. I like it because it gives the basic thoughts without alot of 'fluff'. A place to start..
neogortex
This'll probably not be what you're wanting to hear, but it is something I've observed of beginners to games/multimedia development - people bite off more than they can chew. I see it a lot over on GDNet's "For Beginners" forum - so I'm not criticising you guys
Learning programming specifically in the context of gaming is a double-edged sword. As you correctly pointed out, having a context (e.g. "inventories <=> arrays") helps with the understanding, but equally you can end up only understanding programming in the context in which you learn it. This becomes more and more of a problem as you progress beyond the first few steps - people find they have to go back and re-learn things they thought they understood. Or worse, they don't realise they don't understand concepts and thus end up writing fugly code that doesn't work very well...
I'd personally advise people to learn programming first and then apply it to a specific context.
You can still use the context of games if you want - I spent a couple of days learning the C# language entirely via writing "guess the number", "tic-tac-toe" and other puzzle games in a console window. No graphics, no sound, no original gameplay - but I had lots of opportunity to experiment with the language constructs/syntax and the BCL/framework without introducing too many new technologies. Then again, I was not learning how to write the games - from a conceptual point of view I know how to write those sorts of things already (I've done it enough times over the years) - I was learning the implementation detail in a new language. Learn one thing at a time approach.
I originally learnt programming via Visual Basic 4 (which, by comparison to C/C++, is probably not far off .NET and C#) and I happily made games for several years using nothing but the equivalent of "Windows Forms". I slowly added on new concepts (the day I learn how to use BitBlt() instead of PaintPicture() was a special day
), replaced existing stuff with bigger/better stuff as and when I understood it. It was very much a gradual process.
It took me, I think, 3 years to get into DirectX (mostly DirectDraw) and another year after than to get into Direct3D.
I also had the advantage that a lot of games back then were still 2D and it was before the big-budget hollywood style titles we're so used to now. If I looked at a commercial game it was much closer (although still way beyond my abilities) to what I was doing. I can easily see many beginners in 2006/7 looking at XBox360 titles with amazing graphics and physics and thinking "can't be that hard, can it " - so they buy a book on C++ and their very first ever program is getting a triangle to spin around using Direct3D!
I don't mean to be negative and to destroy any dreams or aspirations you have - just to offer a counter-point to this discussion and maybe to illustrate that learning this stuff is a gradual process. I know plenty of people who recently graduated from a 3 or 4 year university course in software development that aren't amazing programmers - they still find it hard.
I always remember a quote from an AP over on GameDev.Net - "So, you jumped from CCalc to Q3. I think you missed a few steps there"
Cheers,
Jack
rdionne
Well I am just starting out in C# and games as well. I have been doing VB.NET and VB for many years now and I have found that the hardest thing is really finding a way to take that basic knowledge and turn it into what you want only because your not really sure exactly how it works. The gap that is really there is usually bridged by that one explanation that someone gives that turns on that light bulb in your head.
My suggestion would be to keep at it with books, but the best thing I have found is to find someone that is just above your level and talk with them and work with them on a project. For a game, start with something small like hangman or tic-tac-toe. My first game was a version of Hangman, built for my son, that helps him expand his vocabulary. Nothing fancy really. It is a Windows Form that uses textboxes, labels and a picturebox. I used XML for the word list and even allowed for new words to be added if you had the password (this was to keep him from entering his own words).
As many of said on this forumn and others, people that want to start making games want to start making the next Half Life or next big Sim game. Start with what you have learned so far, winforms, and create a game from that. Work in some DirectX on something like an animation or sound. Then take your form and make it into a full screen mode version of your game.
I found that for collision detection Tetris is great. You could just use a simple bounding box collision detection for some pieces of the game, but what happens when you come across the T or L blocks
I do believe that there is plenty of room out there for authors to make learning game development simpler as well, but I would not hold my breath for that to happen.
Nfrf
Yep, I can understand that.
I'm happy with just the simple results I've gotten so far and I know that simply reading a book isn't the end all. When I was programming with Blitz3D, it took me 2 years just to get to the point of using their system correctly.
Richard
Richard Karner
Did that too, for some reason it seemed the easiest way. The project is still on an old forum I visit from time to time.

As far as game development goes, I think tbh the easiest path is to first learn how to make a game to begin with.
There are a huge number of game basics out there which hide most of the complicated stuff from view to allow you to concentrate 100% on getting something down to paper; so to speak.
BlitzBasic3D, DarkBasic, PureBasic, etc.. are very good languages for this.
In fact I would highly recommend PureBasic, because it starts you off with a basic syntax which is simple to grasp but is structured much like C is. So you can expand you coding abilities as you understand the concepts. As DirectX is directly available to use, you can then expand on replacing the functionality you have already at your fingertips with the lessons you learn from the DirectX tutorials.
Each step of the way, is a step and not a leap. Giving you time to learn each aspect as you need to, not as you want to.
I also agree with Jack that too many new developers, comming from indi backgrounds or wanting to get started fresh generally open up their language of choice and decide they'll make the next Half-Life 2. Everything needs to be learnt and practised so you understand what you've taken in. It's no good knowing the DirectX api inside out, if you have no idea what does what.
Games themselves are always an expansion on knowledge and experience. Try to develop simple things that can put in to play what you've learnt with everything you read. That is the whole point in learning it, so you understand it and can then use it.
pradeep prabhu83
feby
Good points and thanks for the links. I'm slowly gathering a good set of resources to visit to try and get the information I'm looking for thanks to these forums.
However, I'm finding that my understanding of how to set up a real-time game loop in C# is still hazy because of gaps between learning the basics of a language via traditional books that focus on document-based applications, then trying to fill in those gaps when suddenly finding that I need to abandon the kind of event-driven program framework I've been exposed to while learning the language.
Maybe it's all due to the nature of the .NET framework itself. I dabbled with C++ about 6 weeks back before deciding to switch to C# and I hit a similar situation with transitioning from working with document-based apps to understanding how game loop code is structured. Luckily, a book called Tricks of the Windows Game Programming Gurus covered the very issue I was struggling with. It basically explained how you set up your program framework using a functions called PeekMessage that allowed you to create a game loop that ran continuously until a Windows Message arrived, it dealt with the message, then went straight back to the game loop. I'm no expert on Windows oddities or C++ and yet the description of the real-time game loop in that book was clear enough for me to grasp.
For some reason I'm failing to find sufficiently clear information for overcoming the similar situation in C#. This lack of information for beginners to transition from document-based application code they are largely exposed to while learning about the language, to real-time concepts when their interests turn to game programming that is oddly hard to track down online and in books.
I did manage to find a blog on Tom Miller's (Managed DirectX engineer) website that discusses the issues surrounding a real-time game loop in managed code, but unlike the clear C++ explanation I found in the book mentoned above, the various authors who discussed the solutions do not summarise or expand on things to make the concepts clear to anyone but experienced C# coders.
Game programming need not mean complex graphics and pipelines and texture management routines so I'm not sure why books would need to be huge to adequately cover the topics. Basing themsleves on simple games like a Tetris or Space Invaders subject would be ideal. You needn't even bother with standard graphics for a simplistic Space Invaders game, you could simply use character graphics and a print command. Graphics complexities come later but at least you would be learning about a language and its constructs while also learning about the more fundamental game programming concepts like collision detection and simple animation. It just seems to be something no one is interested in when writing programming books for beginners. Surely it's a simple matter of replacing exercises about bank accounts and replacing them with game related topics
Maybe no one is bothering to put effort into sufficiently-sized game programming books these days due to market forces. Maybe authors are just not willing to put the effort in, or maybe the publishers are to blame for giving programming book authors a bad deal when it comes to writing suitably comprehensive books. Too many so-called programming books these days do not fully cover the topics properly. One exception is the Wrox series of books, which seem to be the kind of size that all programming books should aspire too. A pity they are full of the bank account type programming examples that I simply can't relate to in my quest to learn about game programming ;)
I'm also beginning to realise that most books purporting to be Beginner Guides to programming games using Language X, do not necessarily mean they are suitable for people who are also actually beginners to language X itself. In these cases I guess the authors of, say, a beginner C# Game Programming book view their target audience as an intermediate C# general programmer
I'd love to see a game book the size of say, Petzold's Programming Windows or the aforemtnioned Tricks of the Windows Game Programming Gurus that is focused on C# game programming. Maybe it's still early days for C# games programming and everyone is still atached to their beloved C++ and do not see .NET managed code as suitable for games. I'm far to inexperienced at this stage to know the answer to that :)
If anyone has any more suggestions on good game programming books and website links, I'd appreciate a heads up - Google is indeed my friend but you still need to weed out the wheat from the chaff so-to-speak.
Thanks.
- Seef
I
Kevin Hoffman
I'm a beginner with both C# and DirectX. I'm trying to learn how to implement them to program games as well.
There are two or three good places to look on the web for basic, 'How To', tutorials. I found two books that are useful to me:
Managed DirectX Kick Start: Graphics and Game Programming, by Tom Miller
Essential C# 2.0, by Mark Michaelis
They'll give you the foundation you need, in my opinion. Although Miller's book needs some careful reading to reduce any errors if you write the code directly from the book. It works, just need to carefully read the text.
Richard