First, an introduction
What is a programming language?
Programming languages are a way to write a set of instructions which your computer can follow. However, you can't just type the code in a text file, and expect the computer to run and understand your commands. Most languages used for heavy-duty games these days are what are called compiled languages, meaning that in order for the computer to understand the code you've just written, you have to get a program, called a compiler to turn your text into binary commands, that the computer can understand. Essentially, everything on your computer was written in one programming language or another. Windows was written mainly in C, an early compiled language, with some of the more low-level functions coded in ASM (which is essentially hand-written binary). Most games these days are written in C++, C# or Java. (Games that don't need to be so fast are also written in Visual Basic)
What is C++?
C++ is a programming language, revered as the mother of all compiled languages (this is figurative. It's not
actually the first compiled language, it's just viewed as the one that's best for game programming), and looked at as the perfect language for writing games, though this is now changing, as C# rises in popularity. I'm not going to go into that, since I don't know C#, and this tutorial is about C++.
IDE Installation
And here's the link to a C(++) compiler, along with a nice IDE (a nice text editor with a bunch of functions added into it) :
http://prdownloads.sourceforge.net/d....9.2_setup.exe
(Some people say that Dev-C++ isn't that great an IDE, and they prefer the MSVC++, and I know that it's compiler does a better job of optimizing, and it has a better debugger, I'm just so damn used to Dev-C++, that's why I'm reccomending it. Check out the MSVC++)
Okay. That's pretty easy to install, you just double-click the exe, and follow through with the installation. Don't worry about any specifics that pop up. Just install as much as you can. Once it's installed, run it.
Coding
Now, if you're looking to write games, I'm afraid it's going to be a while before you can do that. You have to learn the basics of the language and whole bunch of other stuff before you can go on to write your perfect dream MMORPG. This is not exaclty a task for the faint of heart. To write an MMORPG, you need to master a graphics library, a networking library, a windowing library, or several wrappers which encompass one or more of those libraries.
However, this is not to say you can't write simple games like tic-tac-toe relatively fast. But you still need to know the basics. So, with that in mind, let's get started with coding.
Inside Dev-C++, go to
File --> New --> Project
Click console application, then click okay. Save the file where you want to save it, by default, it's in the Dev-Cpp folder, but you can save it anywhere.
Once that's done, you can start coding.
The place I learned to code from was:
http://www.cprogramming.com/tutorial/lesson1.html
That should get you started. You should be able to put stuff out into a command prompt after the first lesson. While that might not sound like much, it's a great step forward. Read through the tutorials on the cprogramming site. By the time you get to the... oh, I don't know, the inheritance tutorial, and you can do all the other stuff pretty much off the top of your head, you should be ready for the next step (which was in my case, Win32 programming, though it varies depending on what you want to do, or who you ask).
Anywho, if you can master the tutorials on that site, you'll be one step closer to writing your very own graphical game. And remember, even if you can't see how an aspect of the tutorial could possibly relate to gaming, trust me, it probably does. Just stick with it.
If you have any questions, just post here, and I'll be glad to answer to the best of my ability.
Important
I cannot stress enough that if you want to make a 3D RPG,
MATH is required. Yes, math. I know. We all hate it. Math is stupid. It's never used, like, anywhere. Unfortunately this is like the one field where it's necessary. If you want to make a 3D or even 2D RPG, you should know the following:
- Basic Trigonometry
- Shape and Patterns of all the Basic Functions (x,sinx, absx, x^2, x^3, etc..)
- Vectors
- Basic Algebra
- Matrix Math (3D Only)
Don't worry if you don't know some of these, just follow the link to the math site at the bottom of this post and it has a bunch of tutorials regarding the subjects.
Useful Links:
C++ Language Tutorials:
http://www.cprogramming.com/
Very Nice Win32 API Tutorial by TheForger:
http://www.winprog.org/tutorial/
Totally complete OpenGL tutorials, explaining all the basics behind the API :
http://nehe.gamedev.net/
SDL Library, and Tutorial Index:
http://www.libsdl.org/index.php
Networking Tutorials (on windows):
http://www.madwizard.org/view.php?pa...tents&lang=cpp
Math Tutorials:
http://www.math.com/
Oh, and here's a nice tip from Elegy:
Quote:
Originally Posted by Elegy
That's why I have also tooken up a habit to put a comment ( // or /* *\ - you will read about these in the first tutorial in the given link by Eriond) at the very end of my "Hello World" Project, to summarize what I have learned so far. I found this is a much easier way to go over what I have learned, instead of manually searching through the tutorials about it. I also noticed that the tutorial uses several different words that *may* throw some people off and confuse them.. if you don't understand a meaning, keep reading. You will eventually find out what it means or what it is used for.
|