Which basics do you need to know

Started by
6 comments, last by Nypyren 9 years, 7 months ago

Hello Community,

I'm already a few months bizzy learning c++ to start game programming in the future.

I only wanted to know for sometime, which c++ basics are required to start making games.

I couldn't find an answer to that after some research, so i decided to just ask it here.

So for short my question is: Which basics of c++ programming do i need to know to start game programming?

(I don't know, if i ask to much with this, but i would really love it, if someone could setup a list of the things?)

Thanks everyone.

Advertisement

You couldn't find an answer to that question because the question is so broad. For the simplest of games like "guess a number", you need to understand variables, receiving input, displaying output, looping, and branching. For something like a Pong clone, you wouldn't need much more than that, you're just working with graphics instead of text. Receiving input becomes reading the mouse position instead of reading the number they input. Things like functions will help (once you understand them) but "technically" aren't necessary.

But in short, all of the fundamental features of a language are needed for anything with complexity: variables, data types, data structures, looping, branching, functions, data structures, mathematical operators, and boolean logic. Once you begin to understand those building blocks, anything is possible. And at that point, you'll probably want to look into design paradigms like Object Oriented Programming, or Component Entity System.

I recommend just jumping in with game programming tutorials. Just be prepared to go back to basic tutorials that cover if/else statements when necessary. You might have an easier time starting out with something like C# and Mono Game or Unity. (I'm sure there are C++ options available too, but lately I've been recommending new developers go with C#) You'll be able to get something showing on the screen very quickly. Making a ship move around on the screen is much more motivating than guessing the correct number. And motivation will likely be your biggest hurdle early on. Here's a link to one of my motivation responses: http://www.gamedev.net/topic/657143-staying-motivated-while-learning-advice-needed/?view=findpost&p=5156722

Or you can go with a game builder application like GameMaker Studio or RPG Maker and make games without ANY* programming knowledge.

* - Programming knowledge will GREATLY help.

EckTech Games - Games and Unity Assets I'm working on
Still Flying - My GameDev journal
The Shilwulf Dynasty - Campaign notes for my Rogue Trader RPG

It looks like SFML is a good choice for C++ as well. On the first page of the For Beginners forum, there's a post labeled C++ Starter.

http://www.gamedev.net/topic/660735-c-starter/

- Eck

EckTech Games - Games and Unity Assets I'm working on
Still Flying - My GameDev journal
The Shilwulf Dynasty - Campaign notes for my Rogue Trader RPG

As "Eck" said, this is a very vague question. The vague answer is that you need all of them (hence why they are the basics). Not only do you need know them, you also need to be comfortable using them.

With this being said, game programming in C++ involves heavy use of classes, functions, control statements, data types, and especially pointers.

EDIT: You "can" get by using certain methods, such as only using "if" and "else," and not using templates, however anything classified as a "basic" is generally used extensively.

"The code you write when you learn a new language is shit.
You either already know that and you are wise, or you don’t realize it for many years and you are an idiot. Either way, your learning code is objectively shit." - L. Spiro

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

"The 'friend' relationship in c++ is the tightest coupling you can give two objects. Friends can reach out and touch your privates." - frob

Thanks everyone,

When i read my post back, while thinking of what you guys said, i understand that it is vague for other people,

so sorry for that.

Basically what i mean't is: Which basic aspects of the c++ language, such as functions, statements, classes, etc.

are required to start making small games (like pong at the beginning and then all the way up to something 3D)

and which aren't required, but will be very handy to know.

For example: Maybe you can say that knowing about and how to use classes is required, but something like polyformism isn't (I saw this in another topic)

I hope this might be less vague and possible to answer,

Dalphin

I think you're looking at it the wrong way. There are no "basic things that I should know to make a game", you can make a Pong clone with or without classes, without or without some control loops (I can't remember the last time I used the do-while loop, you can use while loops instead of for loops, if/else instead of switches, etc), with functions or with all the code inside the main block, with ascii graphics in the console or with real graphics in a window, etc, etc, etc. A coworker onces showed me a bomberman clone he did with ascii graphics inside the console.

You will learn what you need to make a game making games. Start simple, do the things the way you can using the things that you know, and learn from the experience, you won't make a polished game on your first (or second, or third, or ...) attempt so it makes no sense to search for the basic things, no "basics" list will be enough.

If you know about classes then you're trying to do OOP, so you should learn polymorfism and inheritance at some point. When you're ready to learn about it start a new project (a game or other kind of app) and learn them while writing the code.

Thanks everyone,

When i read my post back, while thinking of what you guys said, i understand that it is vague for other people,

so sorry for that.

Basically what i mean't is: Which basic aspects of the c++ language, such as functions, statements, classes, etc.

are required to start making small games (like pong at the beginning and then all the way up to something 3D)

and which aren't required, but will be very handy to know.

For example: Maybe you can say that knowing about and how to use classes is required, but something like polyformism isn't (I saw this in another topic)

I hope this might be less vague and possible to answer,

Dalphin

C++ isn't the only language (or even best language) you can make games in. Everything you learn about programming is another tool you get to put in your tool belt which you can later use to better solve the programming problems you'll face during any programming project (doesn't have to be games!).

Think of it like building a house. You are a carpenter. At the most basic level, you can stack boards on top of each other (like a log cabin) to build a very crude, rudimentary house. If you learn how to use a hammer and nails, you can build a slightly less crude house. Maybe, if you learn how to do "framing", you can build together a house which is much more structurally sound and uses less wood. But, all you have is a hammer and nails, so you're a bit limited by the tools you can use. You can build a better house if you can learn how to use a saw to cut wood into smaller pieces. This would let you build something that actually looks something like a shack, though you still won't be able to build anything much more complicated. Perhaps, you eventually learn how to pour concrete and discover how to build a foundation for your house building projects. This makes your houses more stable. Maybe you also learn something about load bearing walls and this lets you build a house with multiple stories. You find that it takes a lot of trial and error to build the houses, so rather than starting to slap some wood together, you decide to spend a bit of time drawing up blueprints for what you're going to build. After all, it's a lot more efficient to make your errors in your blueprints and correct them than to tear down a bit of construction. The more skills, techniques, and tools you have at your disposal, the better and faster you can build something.

The same principles apply to programming. You are just barely learning how to use a hammer and nails for making games. At best, you can build a very crude game like pong, but you're telling us that you don't want to learn how to use the tools and techniques of the trade. By avoiding learning how to use tools/techniques which will greatly help you, you are severely limiting your capabilities. You're essentially saying, "I don't want to learn how to use a saw! Instead, when I need to cut a board in half, I will use my teeth and chew it in half by biting out teeny slivers of wood." How silly, right? Learning the fundamentals of control structures, loops, functions and variables is the very foundation of programming. Learning how to assemble these core primitives into classes is 100% essential to building any sort of game with any complexity. Polymorphism is a great and valuable tool to have at your disposal, even if you're not going to use it all the time. It's there if you need it! Never avoid learning something new because its hard or new.

The other great big tool you'll be using every day during the programming of games is mathematics. It too is a super duper valuable and useful tool. Getting better at math is getting better at making games. Don't limit yourself and your capabilities by trying to get by without learning how to use a valuable tool.

You're essentially saying, "I don't want to learn how to use a saw! Instead, when I need to cut a board in half, I will use my teeth and chew it in half by biting out teeny slivers of wood."


QFE! Learn what everything in the language can be used for, even if you don't feel comfortable using it just yet. As you write code, you will start thinking "this is kind of tedious, surely there is a better way", and there almost always is - in the parts of the language you haven't used yet.

(Slightly off topic: The ultimate form of chewing boards in half with your teeth: http://en.wikipedia.org/wiki/One_instruction_set_computer )

This topic is closed to new replies.

Advertisement