Real World Application of C++

Started by
16 comments, last by Neobomb 14 years, 1 month ago
Quote:Original post by way2lazy2care
WorldsFinest_159.jpg

Why would you want to start in 3d when you are trying to learn the language? That's a really rough way to go.

I really would recommend doing something not real time then moving up (unless you've made games in another language already).

I'm sure everyone would love to jump in and make a 3D game, but it's just not the best way to go about it. You'll waste so much time trying to apply simple concepts to a really complex situation before you truly understand the simple concepts. The lack of knowledge compounds and can make errors extremely hard to find down the road.

It's much easier to learn and understand the simple concepts then apply what you understand to the things you don't understand.

That's completely aside from the fact that even going to 2D from 3D can illustrate the same concepts, but with many many fewer problems and complexities by a couple orders of magnitude.


I'm not exactly learning the language. I have already been using C++ for about a year now, and I have been making text based games using the concepts that I learned through other books. I feel I have come to a halt with it though and I want to now learn how to make those text games in to real games, 2D or 3D. But before I just bought a random 3D programming book or something I wanted to know if anyone would recommend one that they have read and know is good.

Really 2D or 3D doesn't matter to me right now, which ever is simplest to learn I would probably go with that. The main thing is doing something with grafix rather than just text.

Advertisement
Quote:Original post by Neobomb
Quote:Original post by way2lazy2care
WorldsFinest_159.jpg

Why would you want to start in 3d when you are trying to learn the language? That's a really rough way to go.

I really would recommend doing something not real time then moving up (unless you've made games in another language already).

I'm sure everyone would love to jump in and make a 3D game, but it's just not the best way to go about it. You'll waste so much time trying to apply simple concepts to a really complex situation before you truly understand the simple concepts. The lack of knowledge compounds and can make errors extremely hard to find down the road.

It's much easier to learn and understand the simple concepts then apply what you understand to the things you don't understand.

That's completely aside from the fact that even going to 2D from 3D can illustrate the same concepts, but with many many fewer problems and complexities by a couple orders of magnitude.


I'm not exactly learning the language. I have already been using C++ for about a year now, and I have been making text based games using the concepts that I learned through other books. I feel I have come to a halt with it though and I want to now learn how to make those text games in to real games, 2D or 3D. But before I just bought a random 3D programming book or something I wanted to know if anyone would recommend one that they have read and know is good.

Really 2D or 3D doesn't matter to me right now, which ever is simplest to learn I would probably go with that. The main thing is doing something with grafix rather than just text.


roger. I would do 2D. The math involved is just a lot simpler. For the most part the math is really similar in concept, but the amount of operations and the complexity of the operations are a lot simpler in 2D and you'll still get a lot of the basics that will transfer over to 3D.

That said, I've only done 2D in java, flash, and C# so I'm no help with C++ 2D libraries :-/. If you watch a couple of the basic 2D video tutorials on XNA it will tell you most of the concepts you'll need regardless of language though.
You should take a look at the allegro library and any tutorials related to it. It's a great way IMO to begin any kind of graphical game programming.

http://www.allegro.cc/
I would try google:ing for some online tutorial on a 2d graphics library for c/c++.

These are two I picked at random while google:ing for SDL tutorials.

http://www.lazyfoo.net/SDL_tutorials/index.php

http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/index

SDL is a commonly used 2d graphics library, ported to almost any platform you can think of.
the biggest problem with jumping from text based to graphics is the lack of an easy path, i personally use sfml, but in order to understand it you need to understand event based programming, have a good handling of pointers and object inheritance, from there sfml will work fine.

the book i started out on was an old teach your self c++ in 24hrs book (i started something like 12 years ago) and then game programming all in one. it started out in console then moved to direct draw, and finally direct3d 7 and all the other components of it like direct input and sound

there is a new edition of the game programming all in one that may have what you are looking for



0))))))>|FritzMar>
Quote:Original post by Neobomb
Quote:Original post by way2lazy2care
WorldsFinest_159.jpg

Why would you want to start in 3d when you are trying to learn the language? That's a really rough way to go.

I really would recommend doing something not real time then moving up (unless you've made games in another language already).

I'm sure everyone would love to jump in and make a 3D game, but it's just not the best way to go about it. You'll waste so much time trying to apply simple concepts to a really complex situation before you truly understand the simple concepts. The lack of knowledge compounds and can make errors extremely hard to find down the road.

It's much easier to learn and understand the simple concepts then apply what you understand to the things you don't understand.

That's completely aside from the fact that even going to 2D from 3D can illustrate the same concepts, but with many many fewer problems and complexities by a couple orders of magnitude.


I'm not exactly learning the language. I have already been using C++ for about a year now, and I have been making text based games using the concepts that I learned through other books. I feel I have come to a halt with it though and I want to now learn how to make those text games in to real games, 2D or 3D. But before I just bought a random 3D programming book or something I wanted to know if anyone would recommend one that they have read and know is good.

Really 2D or 3D doesn't matter to me right now, which ever is simplest to learn I would probably go with that. The main thing is doing something with grafix rather than just text.

Sounds like you want to have a look at this book then:
Data Structures for Game Programmers by Ron Penton
It's the best book I've ever come across that clearly shows, using plenty of examples, why you would bitvector, array, stack, queue, linked lists, classes, etc using C++ and 2D graphics using SDL.
If you look at the table of contents there are even some sections labeled "Tying it all together" that blatantly show how it all fits together.
Most other books I've come across seem to either assume that a lot of the idioms and patterns using in making a game, like using a stack for a game menu for example, is something you've already come across on your own or self-evident.


[Edited by - daviangel on March 15, 2010 7:50:38 PM]
[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
Quote:
I'm not trying to make a huge game or anything just yet, I just want to learn C++ through 3D (or any kind of grafix orientated) programming. So instead of learning to make a blackjack game that is just letters representing cards, I want to have the actual cards represented via on screen grafix.


Well heres the only issue with that. Thoes text based games have all the elements that graphic games have at the core programming level. The idea is that your learning how your chosen language actually works and learning the very basics that all games need from the language side. After you have some udnerstanding of thoes, THEN move on a learn a graphics API (Such as Allegro/SDL for 2d, and DirectX/OpenGL for 3d). In my experience (I am a begginer myself), trying to start out learning the basics of C++ while also learning a graphics API is a bad idea because most learning resources for thoes APIs mentioned above assume you know the C++ basics.

Peronally I tried jumping strait to SDL when I only had a very very basic C++ understanding, and while I was able to read tutorials and do them fine... once I tried to do things on my own I sank like a stone, and ended up starting over complealy. If you really really want to skip ahead to 3D give it a try... but the odds of success are slim, and it will likely take you more time then if you just work your way there.

Quote:That's what I was asking, if anyone could recommend a book, or online tutorial or anything that explains C++ as it would pertain to 3D programming (or something to that effect). I just have a hard time understanding things for instance, pointers... I learned how to make them, I learned they point to the memory location, but what I didn't learn how to use a pointer within a game, or why you would need a pointer.


I personally don't know any tutorials or books that explain the C++ basics while teaching 3D programming... and the reason is they are two different things. Learning DirectX for example, is something you should only do when you have a solid understanding of all the core C++ concepts and have actually applyed them.

For example, you don't know why you would use pointers? Thats very understandable. Pointers are probably one of the hardest parts of C++ to learn, and can be a real pain... but to get into 2D or 3D programming you really need to understand why you need them, and how to use them. When you go to learn an API, I haven't really seen any learning resources for DirectX/SDL/Allegro that sit down and explain Pointers (or any other C++ concepts for the matter) in the middle of teaching you the API as well.

Quote:
I feel like all the books I read are just teaching theory and not application.

Were there any books that helped you when you first started you would recommend?


A good book is Beggining C++ Through Game Programming. Its going to be all console text apps that you seem to hate. But again, you need to learn how C++ works before you start learning a graphics API. Just because a game is text based, doesn't make it less of a game. For example, I just finished writeing a texted based RPG as a console app. It has everything a fully graphic game would have at the programming level... it just doesn't have graphics other then letters.

Personally I also like The Game Institutes online classes. I know some people will say you can find the same learning info on the net... but its nice to have it in one structured area, writen by professionals. The first course will just be more text apps that apply what you learn. The second course is mostly Win32 programming, which involves grapics and the final project is a 2D airhockey game thats kinda nifty. After that there courses move on to DirectX and 3D programming. If thats where you really want to end up... you should really look into it.

Take what I say with a grain of salt because Im a begginer myself whos currently working my way throuhg 2d, and dabbling in DirectX... but I was in your boat at one time, and learned the hard way there are no short cuts, and if you ever want to be a game programmer you need to learn to program correctly, and not cut corners.
Thanks to everyone for all the advise and replies! I will checkout the books and sites you all recommended, thanks again!

This topic is closed to new replies.

Advertisement