Game programming curiosity :o

Hey guys! I started programming like 5 days ago (I'm turning 15 in a month) and I wanted to work as a video game programmer, but I had a curiosity: I bought a book for c++ and I'm reading it a lot lately and self teaching myself c++. (even though I don't understand so many things because let's face it without someone that's alive to make you understand it's quite hard alone :c)
But yeah, My goal for now is to make a simple 2D game, something like Pickin Sticks or you know even pong, but I noticed that every single time I try and read tutorials and stuff, all I'm doing is copying the code they write and run the program. I don't get that PROUD feeling if you know what I mean, because it feels like I'm copying and accomplishing nothing. I try to read all the code and the explanations, but stuff like if(!variable) and int *myvariable I don't understand well. Like I know &variable assigns a variable the address where it's located in and *variable shows us the value of that address, but Idk what the (!variable) does. I've tried looking it up to no avail. Also I can't apply all of this stuff I'm looking up like pointers, I try to understand them, it seems like I do, but when I'm there trying to make a simple program either it starts fine but doesn't do what I want it to because God knows why or I can't even apply a code to what I want my program to do, like I don't even know what to do. It's like being a surgeon that knows what to do but when he's in front of a patient he doesn't know how to proceed. What am I doing wrong? Is it my lack of knowledge? Do I need more time? Is it correct to just copy what the tutorial tells me and time will help me understand and remember everything? It's so frustrating! Please help me someone. Many thanks for your ridiculous patience. (Ps. I have a book that's like 350 pages long, when I'm done with it will I have learned all of c++?)
Just learn the basics such as variables, data structures, control structures, classes, functions, and pointers(might be a few I forgot and in no particular order). Then you should look at some SFML tutorials (or another graphics library if you wish such as SDL, Allegro, or OpenGL). If you want a pong tutorial here is something to start with: http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition.aspx
What giblit said. ^^

I'm there trying to make a simple program either it starts fine but doesn't do what I want it to because God knows why


Coding can be like this, especially when you're just starting out. Keep reading. Keep asking questions. Keep trying. You will get there eventually! And it's totally worth it!

Also, don't worry about getting that proud feeling. It will come in time.

(Ps. I have a book that's like 350 pages long, when I'm done with it will I have learned all of c++?)


Oh hell no.
Oh hell no.


What do you mean? I will have to buy other books? Oh god ._.


but stuff like if(!variable) Idk what the (!variable) does.



I direct you to researching if statements and Boolean operators.
What do you mean? I will have to buy other books?

No, you just have to then use it for very long time to get better at it.
What do you mean? I will have to buy other books? Oh god ._.


He means that C++ is such a big language that 350 pages aren't enough to cover all of it. There is a book (C++ Primer) which is like 1000 pages big but it still doesn't cover the whole of the language ;). But don't let the stop you lol.

I don't get that PROUD feeling if you know what I mean, because it feels like I'm copying and accomplishing nothing.


Understanding the code is the goal. Once that is accomplished then you can make something with your knowledge. That is where the proud feeling comes in.
Ok let me clear you curiosity

You have been programming for 5 days to devop 3d/2d game it takes 2-5 years of learning C++ on a basic console interface

After you learned the basics of C++ (OOP classes control structures data types etc...)
You'll need to get a graphics libary
You have three mainstream libary choices for 2d
SFML
SDL
Allgerro

You will have to learn them off the Internet the best choice out of the three would be sfml as it more C++ orientated then C orientated like SDL which has no OOP you will have to make your own OO wrapper.

When learning any of the 3 libaries DO NOT copy and paste code if you still have to do that when your at this stage your not experienced in C++ yet
When making projects with these libaries try and start small

Projects in this order of simplicity and learning curve
Pong
Tetris
Minesweeper clone
PAC man clone
Final project
--------------
Super Mario (if you manage to make a decent Mario game you can make custom games of your choice and by the way in 2d programming you will need to be good at maths as your 15 I assume your finials with algebra and vector maths the most vital for 2d programming)
I'm learning c++ too but I've been at it for a few weeks, I use this site:
http://www.3dbuzz.com/training/view/c-plus-plus-complete

It basically has everything, the basic stuff is free but once you get more indepth with it, they want you to get a membership
To add to my top comment i would like to show you the books I would recommend

Books in this order

C++ throught game programming(ONLY if this is your first time programming with no experience else just skip this book)
Accelrated C++ (Cover the C++ standard in more detail and more advance even though its 350 pages it is equivalent to 1000 pages of detail in C++ it covers the most useful concepts)
Thinking in C++ (Covers the language in so much detail that you will be pretty mucha pro after this book
Pratices --
Scot Meyers way (Effective C++)
Herb sutter path(Exerpetional C++)
@mizfizz
is trigonometry and calculus needed for programming? I know it is if your going to be creating like your own graphics engine but would you really need to know anything more then lets say sin, cos, tan and their inverses?
Sorry for so many post but I really want to help you becuase I was just like you

The !Varibles is

If you use the standar input to ask for a value

And then you which to use the condition ! It means that if it not equal to the Varibles
So if we use the standard input and ask for a number we will write the condition !23 it's saying
Do this if the user didn't enter 23

If my horrible explanation didn't make sense do tell me
To your other question after 1 book will you learn all of C++

If I read 10000 books on C++ I will still not know all of C++ that's how ENOURMOUS C++ is

The creator Bjarne Stroustrup created C++ and he only knows 60% of C++ you don't have to know the whole language only the main features if you have any more questions feel free to reply to the post
Sorry for so many post but I really want to help you becuase I was just like you


Ty so much for all the replies, not only you but everyone! :) C++ is just intimidating, programming is intimidating. I just looked at a program someone I met online created after a month and I didn't understand anything! It was a console program and I still didn't understand anything. It makes me feel really bad at c++ even though I know in a month you can learn a lot, heck I learn something new about c++ every day. It just feels impossible sometimes... I hope I can do it, though. I've never been confident in myself sadly t.t
football52 wrote:
is trigonometry and calculus needed for programming? I know it is if your going to be creating like your own graphics engine but would you really need to know anything more then lets say sin, cos, tan and their inverses?


It really depends like you said on what type of programming you will be doing. But generally production level programming will be pretty maths intensive and it is good to have a great grounding in maths.

Though with that said we are in a Game Development thread so I will point out that YES you will need to know trig and calculus for game development. Even if you don't touch a single line of code in the graphics engine portion you will still need to know them because they come into play a lot in games.

A quick example would be knowing how to find the angle between two vectors (For example you want to turn and face the enemy so you can fire a rocket to blast him to hell). With trig this is easy all we need is the dot product and we are set.

You will get especially maths heavy when you get into AI portions of games. Stuff like using physics to do autonomous movement using steering behaviors, graph theory for path finding, behavior trees and more advanced subjects like neural nets all are greatly simplified if you have a good understanding of basics and advanced maths subjects.

So to try and give a short answer to your questions no not all aspects of programming do you necessarily need to know advanced trig and calculus to progress in programming. Though with that said it will not knowing will make it much more of a chanllenge when you do run into something that needs that knowledge. So while you don't need to know advanced maths they still definitely do help to know.

Kiddolioable wrote:
Ty so much for all the replies, not only you but everyone! :) C++ is just intimidating, programming is intimidating. I just looked at a program someone I met online created after a month and I didn't understand anything! It was a console program and I still didn't understand anything. It makes me feel really bad at c++ even though I know in a month you can learn a lot, heck I learn something new about c++ every day. It just feels impossible sometimes... I hope I can do it, though. I've never been confident in myself sadly t.t


If you truly want to learn how to program in C++ remember that it will take time. It is not something that you can learn in a week, a month or even a year.

Programming is not something that you can ever fully learn, there will always be something you don't know and something new to learn. This is what makes it so exciting and fun for so many, it gives us a chance to constantly keep evolving our skills and have fun figuring out solutions to tough problems you will most likely never see in any other profession.

I will be blunt and say that programming is not for people who don't like a challenge and don't like problem solving. Because that is exactly what programming is, figuring out how to solve problems.

But don't be discouraged by the time it takes to learn it and how tough it can get. If you stick with it and have the determination and drive you will have no problem at all. Also after a month or so it will start to get easier because you will start to get the hang of it. Anyways best of luck with your learning I'm sure you will do fine.

Also I too have a love for game development and have been programming games in C++ for awhile now, so if you have any questions or need help with anything please feel free to PM me or even just post on this forum there are plenty of us here with plenty of game programming experience.
Last edited on
The !Varibles is

If you use the standar input to ask for a value

And then you which to use the condition ! It means that if it not equal to the Varibles
So if we use the standard input and ask for a number we will write the condition !23 it's saying
Do this if the user didn't enter 23


That isn't really correct. The ! operator returns 1 if it is equal to 0 otherwise it returns 0. As in If it is true return false and if it is false return true. You are thinking of the != operator.
I am speaking from experience, I am not the best at C++ but it is the language I know the most. I had started my own game in the terminal but I can't get it done because there is some things I haven't learned yet. While the idea of a game is interesting especially for new people start small, make a calculator, or a random application that has no use but to help you remember the things you just learned. I have probably 6 programs right now 2 of which are games that I can't finish yet, 1 calculator, and the rest have no use but to help learn. I would go through the basics and the more advanced topics such as; creating more than one function, classes, variables, loops, file i/o, ect. A friendly tip do not skip around, I skipped to file i/o and while I have a working program that saves and reads the file I have not learned anything as it was a little out of my reach. It does help if you have more than one book, I myself have 2 ebooks and 1 book that is over 1000 pages. Most of my learning has been out of the 2 ebooks as I am 15 myself and have no one to teach me yet. Just keep things simple for now and don't give up because you are frustrated, if you aren't aware it will happen a lot when figuring something out
I'd like to say something. You should have actually started with a much more simple language like Python or Ruby. After that, C++ would have been easier to grasp. Thing is that C++ has some more complex things that can be hard to get at first. C++ isn't such a good idea, usually, for people who hasn't programmed before. Many tutorials will have pointers in their 2nd or 3rd chapter. This is really confusing for many beginners.

Give it your best though :). You'll eventually get it.
This site has video instruction for C. C is the language C++ was built upon, there is a lot of relevant information regarding C++ and programming in general. I recommend having a peek at this free site as I found it helpful even after going through the book "jumping into C++". And may cover in depth areas that are missed in other books. http://www.computerscienceforeveryone.com/
Topic archived. No new replies allowed.