Quote:
|
Originally Posted by Zephir
I am learning to program at home. I have a few compilers. After reading your whole thread on this subject, I have a question. I want to learn c++. What I am doing is learning Python first, then I will deal with C++ after I have some basic knoweledge of programming in some easier form. The question is: I would like to create games from Python with graphics and sound and all. Then move into C++. What is required as far as programs needed and steps taken in reaching this goal? Meaning. I would like to program a game, lets say MMORPG. Also the graphics, sprites, maps monsters and so forth. 3d or 2d. What is needed as far as all that goes? Game engines? Can that be programmed? With this information I will pretty much know how I can go about learning how to do all this. Time is all I have. Thanks 
|
If you want to get into games programming, then you need to learn the basics first. That is, learn the syntax of your language, such as how to declare variables and functions/procedures, use library (or built in, depending on language) functions, and that sort of thing. Don't worry if all of this stuff is done using plain text; that is fine. What you should learn here is basic console I/O (printing stuff on the screen, and getting simple input from the keyboard), file I/O (in some languages, like C and C++, it's virtually the same as console I/O), and some techniques and concepts.
Then, you need to figure out how to do a few things using your environment (compiler and OS) of choice. You'll need to figure out how to a) get user input in whatever form (mouse, keyboard, and joystick/gamepad being popular ones), b) draw stuff on the screen (this may be as simple as drawing pixels and lines to blitting images to texture mapping; I suggest you stick to the simple stuff at first), and c) implementing some sort of timing.
Once you've got this knowledge, you should be able to write a simple single-player game. The key point here is simple; try something like Tetris or a 2D top-view scrolling game (the latter isn't as simple as it might seem). Once you have done that, you will be able to tackle something more complex. Try making it two-player (at the same computer, using different keys and/or input devices). From this, you will (hopefully) learn about creating state objects to represent each player. This has two benefits: first, you can save/restore the states to implement saving/loading of games, and second, you will gain scalability by being able to instantiate more of these objects.
If you want any kind of multiplayer game that uses two or more computers, you'll also need to learn sockets programming so the machines can talk to one another.
Try to keep your code as generic as possible, especially if using an object-oriented language. Don't make a 'monster' class, and then duplicate all of this into a 'friendly NPC' class. Rather, make a 'creature' class, putting all the common characteristics there, and then derive other types from it. The 'creature' class might even be derived from a 'sprite' class, with other subclasses representing inanimate objects, projectiles, and the like.
Don't hard-code things in unless you have a valid reason to do so, and even then, try to use symbolic constants; NUM_PLAYERS makes much more sense than 2, and it's much easier to change the constant definition rather than change every occurence of 2 that refers to the number of players without accidentally changing any occurences that refer to something else.
Game programming is one of the most complex types of programming there is, so you will have to work at it for a while. Don't expect to create something grand right away; if you make the attempt, it will only discourage you when you fail. Start small and build from there.