我推荐两本书，但只适合C++开发，并且不是入门书。这两本书就是《Effective C++》和《More Effective C++》。如果你不懂C++，这两本书就太高端了，所以你不必觉得“我需要这两本书才能制作游戏”。
开发游戏时，我使用Visual Studio， 但我也同样擅长使用Eclipse、Code Warrior、XCode、Notepad和编译器。就像选择一种编程语言，其实你使用什么软件并不重要。我习惯使用Visual Studio，但我并不使用它强大的函数功能，我只是用它组织、编译和调试我的源代码文件。很多编辑器都有这些功能。
How do I get started programming games???
by Tommy Refenes
The following blog was, unless otherwise noted, independently written by a member of Gamasutra’s game development community. The thoughts and opinions expressed here are not necessarily those of Gamasutra or its parent company.
Want to write your own blog post on Gamasutra? It’s easy! Click here to get started. Your post could be featured on Gamasutra’s home page, right alongside our award-winning articles and news stories.
I remember maybe 5 years ago I emailed a M.I.T. professor after seeing her on a PBS special talking about AI. I poured my brain into an email to her about my theories on AI development, how machines can be programmed to recognize environments, how emotions can be learned through experience,etc. I spent a good 4 hours writing the email because I felt a connection to this professor’s work. It was an exciting email to write because it was something I was very interested in and I wanted to reach out and talk to someone about it. There was so much hope while I was writing it that maybe I would get a response back and I would have someone to talk to about this kind of stuff, maybe get me started on the path to creating advanced machine AI. Sadly, I never heard back from her…I don’t even know if she read the email.
Lately, because of Indie Game: The Movie and Super Meat Boy, I get several emails/twitter mentions/formspring questions a day from people wanting advice. Most of the emails are from younger fans and are requesting advice ranging from “What language do I use” to “How do I get my game on Xbox”. I read every email but I don’t always respond because it would take a good part of my day, not to mention there is little variation between emails.
I legitimately feel bad when I don’t respond because these are people that are just reaching out and want someone to shed some light game development. They are doing the same thing I did with that M.I.T. professor so many years ago. They are interested in what I do and want to know how to do it, they want to be a part of game development in some way. Well, I want to help but don’t have the time, knowledge, or desire to be a teacher …so here we are. This is an FAQ for anyone who wants some advice in some way from me about making games.
Where do I start on my dream game idea?
Where do I start is the most common type of question I get. I feel like starting is the biggest hurdle for a lot of people because they don’t realize that everything, even the crazy AAA game you see out there,started out as nothing and built upon itself until it became what it was destined to be. When your dream game is sitting in your head and you take that first step towards creating it, it can be very overwhelming to go from a state of imagination to implementation. For someone who has never made a game, something as simple as making a character move can be something that just seem like a huge impossible hurtle and can quickly become a huge discouraging defeat. It doesn’t have to be like this, the key is to start small.
Super Meat Boy started off as a quad with the image of Meat Boy on it. Mew-Genics started out as a black square that moved back and forth on the screen. Goo! started out as circles with smiley faces on them. “Game 2” started out as a vectorized image of the character in “Game 2”. Everything starts out at the very most basic level and builds up from there.
It’s very important to take things one step at a time. If you approach your dream game all at once, chances are you will get frustrated and overwhelmed. If you approach the same dream game one little step at a time, your chances of realizing your vision are exponentially higher.
Breaking your game down into small pieces forces you to analyze and evaluate your ideas on a deeper level. This is essential because you always want to be open to changes, you never want to set yourself into a path that you feel you can in no way deviate from. Deviation from the plan can yield the most interesting parts of a game. It’s a more organic way of developing because you are thinking within the game system and are applying new ideas to ideas that have already formed.
So, try your best to break down your ideas in to small chunks that can be accomplished easily within your current skillset. It’s easier to see progress that way, you don’t get frustrated as easily, and you can come back to your work later and easily pick up where you left off. Remember that there is no time limit on when you have to get your game out (if you are starting out like that, you are in for a rough time). Learn at your own pace and build your projects like you build Legos…one piece at a time.
For a more detailed example, let me go through how SMB started. Once I had that quad with the MeatBoy image on it, I hooked up input so I could move it back and forth. After I played with that a little bit I made it so that when I pressed a button my Meat Boy quad would jump, then I worked on stopping him when he landed on a platform, then I worked on stopping him when it he a wall, then I made him stick to walls, then when he stuck to a wall and I hit a button he would wall jump, then if he hit a greensquare he died and so on and so on until the last line of gameplay code was written and Super Meat Boy was complete.
No task is too small, no amount of progress is too little. What is important is that you do not get frustrated and you continue to work on your game.
What programming language do you recommend?
This is the second most common question I get and to be honest I don’t like this question because it is a question I cannot answer. I always try to answer the question with “whatever language you feel the most comfortable with”. I don’t think this answers people’s questions effectively because I feel people are looking for a definite answer or they are just starting out and do not feel comfortable with any language. I’m going to try to elaborate on my answer to maybe help people understand how to choose a language that is best for them or help them understand that using what they are comfortable with is the best way to start out.
If you are looking for advice on what programming language to start with you don’t need to concern yourself with “Will Flash run on iOS” or “Does Xbox run Java” or “Does XNA run on Mac”. Your foreseeable end game at the starting point is realizing a game, not releasing it or selling it. These questions are important when worrying about shipping a game, but shipping a game is way easier than realizing a game. You can worry about shipping your game later.
Find a language that clicks with you and start coding. In the beginning it is important to have as much instant gratification as possible. You want to be able to get something on the screen quick and build from there. You want to be able to edit what you create and add on to it easily. Instant gratification is key to staying motivated when starting out, you probably don’t want to be learning a new language while making your game. If you try to learn a new language while creating your game, chances are you will spend weeks reading and have nothing to show for it except knowledge that you have not yet been able to apply to your game. That can be pretty discouraging.
Stick to what you know, or go the easiest most comfortable route possible to acquiring skills to start work on your game. So if you know a little Flash, use Flash, if you use C++, use C++, if you only use Java, then use Java. There is no such thing as “the official game development language”. ALWAYS remember that. Minecraft is written in Java, Super Meat Boy is written in C++, Farmville is written in Flash, some other game people play is written in HTML 5, some other game people play was made on Index cards. The point is: It doesn’t matter. Find a way you can make your game comfortably, and make it with that.
Don’t take that as me discouraging you from learning new languages and working outside of your comfort zone. Once you get the ball rolling, you will want to reach out of your comfort zone and learn new things if you want to grow as a game developer. Worry about growing later, in the meantime get your base established and start coding.
If you don’t know any languge and are looking for a place to start, I would recommend Flash, Game Maker, Unity or something similar. All those programs make it very easy to get something on the screen quickly and with a very small learning curve. You don’t want to start out with something like C++ if you have no experience with any other programming language and are anxious to start creating your game.
What books or tutorials do you recommend?
There are two books I recommend but they are only for C++ development and they are not beginner books at all. They are Effective C++ and More Effective C++. These are more advanced C++ books so if you don’t know C++, do not be like “Oh I need those to make games”. You don’t.
Other than those two, I haven’t read any other books. The way I learn is by reading SDK documentation. It’s not very typical, but it’s how I learn.
I do recommend going on line and looking up tutorials for things. The internet is full of example programs, tutorials like NeHe, etc. There are no tutorials that I recommend, mainly because I haven’t gone through any but I do know the resources online are abundant and varying. I’m sure with a little help from Google you can find exactly what you need.
I DO NOT recommend copying and pasting from tutorials to make your game. You aren’t learning anything that way, you are just copying. That goes double for open source programs. They are fine to look at, study, and reference, but they are not a means of making the game for you. You will not become a good and effective programmer by copying and pasting source code into your game unless you fully understand it. Do not cheat yourself this way, take the extra time and understand something before you use it.
What software did you use to create the game?
I feel when this question is asked, its being asked by people that assume there is a magical tool that makes games for you. Fact of the matter is there are tools that do a bunch of the engine stuff for you. If you aren’t interested in learning a programming language for the purposes of building a game engine look at something like Unity or UDK. They take the heavy lifting away from you and allow you to just create a game. There is a cost to this though. You are limited by the system presented to you with those tools. These tools are full of features that are well built, stable, and amazing, but sometimes they will not do what you want.
Personally I don’t like limitations and I really enjoy having my hands deep in the development so I avoid these tools and build my games from code I’ve written over the years. That’s not to say Super Meat Boy couldn’t exist in something like Unity. It could to an extent. Due to the limitations though it would not be the same game, it would not control the same, and it would not look the same. The essence would be there, but the game as we know it would not be. It’s up to you though. Again, it’s what you are comfortable with. Amazing games are made with UDK, Unity and the like…and amazing games are made without them.
I use Visual Studio for development, but I could just as easily use Eclipse, Code Warrior, XCode, or Notepad and a compiler. Just like selecting a programming language, it doesn’t matter what you use. Visual Studio is what I am used to. I don’t use any of the crazy functions built into it, I use it as a way to organize my source code files, compile, and debug. Tons of editors do this.
For art and animation, Ed uses Flash. I wrote an exporter for the animations in Flash because it was easier than writing tools for Edmund, and…again…Edmund is the most comfortable in Flash…so why fight it! Writing that tool meant learning JSFL and working in Flash, but it was what worked best for Ed and me for Super Meat Boy. You don’t need my animation exporter to make your game. One day I will offer these tools to developers, but this won’t happen for a long time so don’t wait for them.
How do you stay motivated to finish what you start?
There is no secret to staying motivated and there really isn’t advice I can give you to stay motivated on your project. There’s no special trick I use, or mindset, or organizational task list, or anything like that. In order for me personally to stay motivated, I have to believe in and enjoy the project I’m working on. If I don’t like what I’m working on, chances are I will not finish it.
There was a game I started a long time ago called Goo!. I worked on it for 2 years, and it went nowhere. It wasn’t my idea, it wasn’t a game I would personally want to make, and because of that I could never make it what I wanted it to be. I stopped working on the game to start on Super Meat Boy.
The time working on Goo! wasn’t wasted because I learned a lot about development, but the game was never meant to be because it wasn’t something that excited me. The only aspect of the game that did excite me was the multi-threaded physics engine and I spent almost all of my time on that. It was important for me to work on that game because it made me realize that loving the game you are working on makes it much easier to work on. It is the ultimate motivation.
When you believe in and love what you are working on, it is difficult to stop working on it. You obsess over it, you want to add to it, you want to make it better, and you really want to see it completed. Believing in what you are working on tends to shine through in the finished game. You are more likely to spend more time on extra polish, add features you think make the game better, just generally go above and beyond and really make the game yours.
How do I get my game on Steam/Xbox/PS3/WiiU/Anything else?
This is a question no one should ever be asking when they are first starting out or even if they have a game they are working on already. Your end game should be “I’m going to make a good game” not “I need to get this on XBLA”. The path to getting your games on any of these platforms is public knowledge. There is no secret email, there is no magic form you fill out, you don’t need to know anyone in the biz, nobody’s cousin works at one of these places and can get you a secret meeting, nothing like that exists.
It’s very simple to be approved for any of these platforms: all you need is a good game. That’s it. It’s a harsh reality that some people refuse to believe. I’ve seen people scapegoat everything but their game when it comes to getting approved for Steam/XBLA/whatever. A good game will gain attention and serious consideration from platform holders based on its own merits with a little help from you. Talk about your game, be excited about it and if your game is good and other people like it your enthusiasm will spread to others.
If your game is not good, you are going to have a very rough time getting it on distribution platforms. Focus on making your game the best it can be, don’t focus on what platforms you can get it on. A good game sells itself way more than exposure on a platform will ever do.
What if I finish my game and no one wants it?
If you work hard, and you think your game is the best thing ever and you still can’t get on any distribution platform don’t take that as a failure and a sign that you should stop making video games. Very few people hit a home run with their first game. SMB was the first game I ever finished, but there were a few before SMB that went nowhere.
At one point I was a few steps away from getting a Sony deal identical to fl0w and Everyday Shooter for the game I mentioned earlier, Goo!. A change in management at the last minute (literally two days before final papers were to be signed) caused the game to be cancelled and for me to never hear from Sony again. The game wasn’t good and even with the Sony deal it had a chance of never being finished and a very good chance of being a huge failure. It hurt, it stung, but it didn’t stop me.
Don’t let that kind of set back kill your dream either. People might think your baby is ugly…that’s fine though. Keep making games. Be inspired by setbacks and one day if you have the strength to push through it, chances are you will realize your dream.
Just make your game with whatever you can, start small and worry about other things later. Programming languages and software are irrelevant to creating a game so choose what you are comfortable with or what you want to learn but don’t take on too much when starting out. Make sure you make enough progress to stay motivated and keep frustration at a minimum. Love your game, talk about it, obsess over it and it’ll be hard not to work on it.（source：gamasutra）