Skip to main content
GameDev.net gamedev.net
🔒 Locked

c++ Programming Game Programming, Where do I start?

Started by Jdfskitz Jul 13, 2010 at 6:18 PM 18 replies 3.1k views
Original Post
Jdfskitz
Jdfskitz
I have been looking for a forum that wasn't full of people unwilling to help you for a while.

A few years I have been trying to find out how to code c++, possibly Java, But I prefer c++.

I understand Java is similar and in some ways slightly easier, but it does networking better.

Anyways.
I have read many books probably over 800 pages of c++ books, and none of them have helped me. all I know pretty much is

const int
int
string
I always forget how to do vectors.

c output
c input cin cout

I have pretty much given up over the last year and forgot how to do a lot. Even though I didn't learn much.

I don't even remember how to start a function :\.

My goal since the beginning was to be able to catch peoples eyes, and help them using Games, Software, or anything related. But so far the most I have done is make a word game where I forgot even this how to type a number and it prints words then gives you another choice of what to do.

I know about object orientation because that is how my mind has worked for my entire life.

All I ask, is if anyone can help. Where do I start, what books, what sites, What info do I need to tell you.

I have been looking at nehegl. But I feel I am not ready for it. OpenGL is where I want to start in game programming, and then I want to move to DirectX.

Any Suggestions?
ExcessNeo
ExcessNeo
In all honesty you don't have to remember everything when it comes down to programming it's why references are widely available with examples of how to use certain features.

Which books do you have?

Ideally you want a strong grasp of fundamentals before starting on anything involving graphics including:
pointers and references
standard library containers and algorithms
functions
classes

The great thing about standard library containers and algorithms is they possess a common interface so it is fairly easy to use a new one.

DirectX uses a lot of pointers and I would guess OpenGL also makes use of them. Once you have a fairly good grasp of the fundamentals you should make a few console games and then move onto a 2D library such as SFML or SDL which will help a lot when it comes to OpenGL as both provide things which OpenGL doesn't (input, sound, etc) and give you a nice interface to using OpenGL rather than the Win32 API.
Zakwayda
Zakwayda
A couple of ideas for you...

First of all, you don't necessarily need to be able to memorize lots of stuff in order to be able to program. There are plenty of references available, and there's no shame in looking stuff up when you need to. (The more comfortable you get with a language though, the less often you'll find yourself having to look things up.)

That said, if you're having trouble retaining the basics of C++, you might want to give some other languages and/or game development tools a try. A commonly recommended programming language for beginners (or anyone, for that matter) is Python; commonly recommended game authoring tools include Game Maker and Unity. (Of these, I'd recommend trying Game Maker first.)
NextEpisode1
NextEpisode1
Tip: Get "C++ Programming for Game Developers" each chapter has exercises related to it, when you manage to finish the first module u may say u are a decent c++ beginner. (my first post here:P )
include <iostream>#include <string>int main(){ std::cout<<"I will kill your stack"; return main();}
Jdfskitz
Jdfskitz
Thankyou all for replying without being completely negative about it :) you have no Idea how long I have been looking for a website where people are mature about stuff and not like the guy from grandmas boy
Labombadog
Labombadog
I'm a n00b myself, and glad that you posted this thread to read on it too.

I have 'some' c++ experience like yourself, but never really grasped it. Maybe we can help each other out? :)
Dunge
Dunge
It seems like you read the book only for the sake of saying you've read it, constantly forgetting last page's content as you advance.

This is not a war between c++/java, differences between the two are nearly trivial. Nearly any algorithm can be implanted in a similar way in most language out there. What's important is having a good idea of what you want to do, how to use libraries to help you do it, and how to structure your data and function calls. Then, you can code it using the language documentation/book as a reference. A lot of C++ programmers with years of experiences may still don't know the exact syntax to create a templated class without looking in the documentation.

Most C++ books just explain everything about the language from the start to finish, with examples. What it don't tell is you is everything else, from programming paradigms (Object-Oriented/Procedural) designs, mathematics, binary logic operations, stuff like that. For example, If you are lucky, it may tells you about your IDE debugger and the thing it can do, but not actually how to track down everyday life's bugs with it. I hate to say it, but having a good teacher guiding you through it can help a lot.

Unfortunately, you need to know the basics about functions calls, class/objects hierarchies, variable types, pointers and things like that before coding anything, but it's nothing impossible. A focused programmer who already know a language can easily learn how to use another (even C++) in a matters of just a few hours in one evening.

Bottom line: don't focus on your book, don't focus on the language. Simply think about what you want to achieve, and how to use programming languages to do it. With experience, and by looking at code, you will learn better ways to do things and learn proper programming habits.

That said, don't jump into programming your own game engine with complete opengl/directx gfx engine, shaders, physics, entity management, assets loading, maps and the whole package by yourself right now because that's your goal. That's not an achievable goal. You better take an existing engine like Unreal3 and modify it if that's what you want to do. On the other hand, using a library like SDL/SFML, minus the OpenglGL parts, trying to paint a simple bitmap rectangular surfaces reacting to keyboard arrows inputs on a black fullscreen background can be a nice project to start with, when you are bored of trying to understand how to overload << operators with multiple data types without even having the slightness idea yet of why you would want to do that..

Ok, I'm finished talking.
Jdfskitz
Jdfskitz
ok, thankyou :P

I have done quite a bit of learning the basics

A while ago earlier this year I was coding this http://pastebin.com/KRw2r1hA

but never finished

When I can create a game similar to Zelda Ocarina of Time is when I know that I have reached my goal. I can do modeling similar to that.


And yeah, maybe we can work together Labombadog.

Do you have a form of msn? yahoo messenger?

jdfskitz@hotmail.com
jdfskitz@yahoo.com


those are mine :P

I use my Msn more. or we could use the chatroom up there? aren't we able to join our own rooms?
Jdfskitz
Jdfskitz
>>
>>
>>
>>
>>Go to channel wecanworkitout
>>
>>on the chatroom and we can talk there if you don't have msn
jpetrie
jpetrie
...or you could just ask in #gamedev if you're going to use the IRC applet.
rmed002
rmed002
Its my observation that using low to mid level language only truly benefits you if you understand the reason for using them in the first place.

Sure, C++ compilers make neat optimizations, but there is potential for so much more. Using high level languages we lose explicit control of many things, but we usually gain more bugfree and faster to produce code.

Like Dunge previously mentioned, Java, python or pretty much anything will suffice if you want to make a game instead of an engine. ( And why not suffice for an engine to a degree as well? ).

By choosing C++, we consciously accept more responsibility and "bother" from having to do stuff like explicit memory management because in return we can manipulate memory as we please and are free to interpret data as it fits the bill at any given moment. Naturally this won't give us Carte blanche to rummage about the memory, but still, much less restrictions are enforced than with Java.


If on the other hand we have no "deeper knowledge" of the underlying system, the performance gain ( although potentially significant ) given by the compiler alone, might not be worth all the extra work and hassle resulting from the implementation process.

Kinda like Dunge already said, Java is good and makes producing graphical stuff guite a bit easier. Thanks to shared C-syntax, I consider it a nice alternative for learning stuff before C++. At least quite a bit more motivating to begin with thanks to the ability to get stuff done with less problems.
Katie
Katie
Koenig & Moo "Accelerated C++".

Basically it's an intro to C++ that doesn't spend its time faffing about teaching you a bunch of C first and then having you unlearn all that stuff and learn the C++ way of doing things.

By chapters 5&6, it's already talking about list<>, map<> and other useful data structures.


That, a book on games development and a choose a nice base library so you don't reinvent the wheel (Lots of people seem to like and recommend Unity) and you should be well away.
rip-off
rip-off
Quote:
Original post by szecs
the best way is DOING it. Reading books without actually coding is almost a waste of time


I could add this to my signature.


This.

Programming is a practical skill. The more time spent programming the better you will get. If you have a half decent book you will learn more by finishing all the exercises than you will by only reading half a dozen books of any quality.
daviangel
daviangel
Quote:
Original post by szecs
the best way is DOING it. Reading books without actually coding is almost a waste of time


I could add this to my signature.

This.
You can read a ton of books on programming but nothing hits home like actually getting out into the trenches and actually making something.
Set yourself a goal of completing a game of your own making using a graphics API.
I learned more writing and figuring out on my own how to make a simple 2D game for the iPhone than any class I've taken or any book I've read.


[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Jdfskitz
Jdfskitz
WoW! Thats a lot of comments!
I've gone through engines. I dislike the unity GameEngine, I was looking at the Unreal Engine.
I would really dislike to have to use pyhton or java first, because from what I remember, I tried using them and they were just like 1 + 1 = 2 OH THanks lol.

I want a challenge. :P And I have already read a lot on c++. Just not the most I started wanting to learn how to code software when I was about 12. Now I am 16. I have been doing Html + css for a while. But thats barely even coding.

Thank you for all of the tips!!!!!! I bet I could get it going pretty well now :).

I need to work on what they said up there.

Pointers, Functions, Classes, Etc. :P
After I get all the basic functions memorized, I need to find a good reference book. And then learn some Graphics.

I'm not sure If I should do SDL or OpenGL First. Most definitely not DirectX lol.

I Haven't been testing and making goals of games to make or w/e with a reference or anything. Which would be a great Idea come to think of it :).

Thanks Again!
Zakwayda
Zakwayda
Quote:
I would really dislike to have to use pyhton or java first, because from what I remember, I tried using them and they were just like 1 + 1 = 2 OH THanks lol.
Your impression of Python and Java as 'just like 1 + 1 = 2' is incorrect.

In their own way, Python and Java are just as 'powerful' (a rather vague word that gets thrown around somewhat indiscriminately when talking about programming languages) as C++. To really determine what can be done using a particular language, you have to dig deeper than some introductory tutorials (which, for some languages, will use examples such as '1 + 1 = 2' for fairly good reason).

Or, you could look for existing games or other projects that were programmed in the language you're interested in, just to see what others have accomplished using that language.

In any case, I wouldn't be too quick to write off languages like Python and Java.
Quote:
I want a challenge. :P
Programming and game development are challenging regardless of what tools and languages are used. If you want a challenge, pick a language (e.g. Python) and try to write a game using it. (It's true that writing the same game in C++ might be even *more* challenging, but that's not necessarily a good thing.)
Smigss
Smigss
If it's still C++ you want to learn my book reference suggestion which i still use especially on inheritance and polymorphism is "C++ For Programmers" it's a Deitel Developer Series book.
Jdfskitz
Jdfskitz
Python is simple (kinda), Java is similar to c++. :P
from what I have seen. But. well, I just really want to stick to one language. I went to learn c++, people said do Java, I do Java. People say do Python, I do Python People say do Java. And it just went in a cycle for a long time.
tufflax
tufflax
Quote:
Original post by Jdfskitz
WoW! Thats a lot of comments!
I've gone through engines. I dislike the unity GameEngine, I was looking at the Unreal Engine.
I would really dislike to have to use pyhton or java first, because from what I remember, I tried using them and they were just like 1 + 1 = 2 OH THanks lol.

I want a challenge. :P And I have already read a lot on c++. Just not the most I started wanting to learn how to code software when I was about 12. Now I am 16. I have been doing Html + css for a while. But thats barely even coding.


Well, programming is hard enough as it is, you DON'T need more challenges, trust me. Here's another vote for Python.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.