C++ basic tutorials
by Makumba Makumbre · in Technical Issues · 09/28/2008 (8:59 pm) · 24 replies
Hi, I am searching this site (TDN as well) for several days and can not find very basic tutorial on how to create basic "hello world' application in c++. I have book "Game Programmers Guide for Torque", but it turned out that this is only scripters guide (i dont know why this guy considers sdcrepters to be a programmer).
Are there any tutorials?
Is there any comprehensive book, tutorials for c++ programmers? I saw engine documentation at my friend's office and it is only confusing classes list (and very badly documented as well), not even a hint how to create engine instance, what parameters parse etc.
Are there any tutorials?
Is there any comprehensive book, tutorials for c++ programmers? I saw engine documentation at my friend's office and it is only confusing classes list (and very badly documented as well), not even a hint how to create engine instance, what parameters parse etc.
About the author
#2
The learning curve for a commercial grade game engine is steep. The last time you posted a similar question, was less than 3 days ago. If you've hit the wall already and are feeling frustrated, you can probably start asking specific questions.
Examples:
"What is the entry hook function to launch a Torque game?"
"What Console Objects need to be instantiated to get a Torque game to run?"
"Is there a 'main loop' that must run in script?"
If we start getting those questions, I can start pointing you to tutorials and resources that fit your exact need.
Now, as far as the C++ aspect of things...you don't appear to own license so I can't get into the specifics of the C++ components.
09/28/2008 (10:23 pm)
You cannot apply "Hello World" to Torque Technology. Not in the way you are thinking. As I mentioned before, there is no official tutorial on how to start from absolute scratch with just the executable and DLLs yet. If you just take the time to look through the available docs and other resources found on this site, you will start to find your answers.The learning curve for a commercial grade game engine is steep. The last time you posted a similar question, was less than 3 days ago. If you've hit the wall already and are feeling frustrated, you can probably start asking specific questions.
Examples:
"What is the entry hook function to launch a Torque game?"
"What Console Objects need to be instantiated to get a Torque game to run?"
"Is there a 'main loop' that must run in script?"
If we start getting those questions, I can start pointing you to tutorials and resources that fit your exact need.
Now, as far as the C++ aspect of things...you don't appear to own license so I can't get into the specifics of the C++ components.
#3
Yes, I know that learning commercial grade engine is not an easy task, but I never even met an engine that has not "hello world" tutorial. Yes, I have seen some engines (free mainly) with abominable documentation - Ca3D, for exalmple, but commercial?
And even I find out how to create device and make some basic steps, how I can manage to use this engine in the future, with such bad documentation? Or every time i have questions come here and ask for help? Functions are undocumented, in most cases, they even do not have parameters list desribed appropriately. So what if one is not going to made script-based game?
I have tried some other commercial (at similar price) engines, such as C4, Leadwerks, and they have fine documentation, even video tutorials. And how, in god's sake one can learn something from a terrible mess - doxigen genareted class list?
Yes, it is interesting to look into source, but it must not be necessary for good commercial engine.
Now I have two alternatives - either waste months learning torque sorce and reinventing the wheel, or licence one of above mentioned engines.
09/28/2008 (11:10 pm)
Hi Michael,Yes, I know that learning commercial grade engine is not an easy task, but I never even met an engine that has not "hello world" tutorial. Yes, I have seen some engines (free mainly) with abominable documentation - Ca3D, for exalmple, but commercial?
And even I find out how to create device and make some basic steps, how I can manage to use this engine in the future, with such bad documentation? Or every time i have questions come here and ask for help? Functions are undocumented, in most cases, they even do not have parameters list desribed appropriately. So what if one is not going to made script-based game?
I have tried some other commercial (at similar price) engines, such as C4, Leadwerks, and they have fine documentation, even video tutorials. And how, in god's sake one can learn something from a terrible mess - doxigen genareted class list?
Yes, it is interesting to look into source, but it must not be necessary for good commercial engine.
Now I have two alternatives - either waste months learning torque sorce and reinventing the wheel, or licence one of above mentioned engines.
#4
However, if you are just learning the engine I think there is ample documentation to get started:
Main Landing Page
TGE Landing Page
TGE Official Documentation
TGB Landing Page
TGB Official Documentation
TGEA Landing Page
TGEA Official Documentation
TorqueX Landing Page
TorqueX Official Documentation
Artist Landing Page
Older docs
If what you need is not found in those links, then I'd like if you could post some quick feedback in the official doc threads:
Official TGE Documentation Feedback Thread
Official TGEA Documentation Feedback Thread
09/29/2008 (8:31 am)
The documentation still needs some work. I am happy at the progress from the old docs to what we have now. The landing pages and official docs are receiving updates and new content on a frequent basis. If you do not believe you have enough documentation to develop a game, then I can't argue with your skill or opinion.However, if you are just learning the engine I think there is ample documentation to get started:
Main Landing Page
TGE Landing Page
TGE Official Documentation
TGB Landing Page
TGB Official Documentation
TGEA Landing Page
TGEA Official Documentation
TorqueX Landing Page
TorqueX Official Documentation
Artist Landing Page
Older docs
If what you need is not found in those links, then I'd like if you could post some quick feedback in the official doc threads:
Official TGE Documentation Feedback Thread
Official TGEA Documentation Feedback Thread
#5
Michael has pointed you to some great documentation pages, but until you purchase an engine license, any C++ help will be relatively useless for you since you will not be able to make even the most minor C++ changes to the engine.
09/29/2008 (8:46 am)
To use the engine source, you must purchase it. To use the demo, you will be working with TorqueScript. Torque is a very large C++ codebase, and I would recommend taking a good long time to sort through how the pieces work with each other once you purchase a license. You can always look at other engines that you note, though I can't say most have much better documentation. The documentation styles are different, and some are very nice in terms of the Adobe generation of ActionScripters who are used to a certain presentation of documentation.Michael has pointed you to some great documentation pages, but until you purchase an engine license, any C++ help will be relatively useless for you since you will not be able to make even the most minor C++ changes to the engine.
#6
I may be totally wrong, but it seems that GG made this engine for scripters only. There are 3 books about Torque engine (different versions) and they are all for scripters, no convenience documentation or book for C++ programmers. I am not bashing anybody and not discussing matters that are not my concern, such as GG marketing politics, but as it seems to me it will be very hard to sell this engine to C++ developers. What I need from engine? - I need it make easier my work, not harder. Yes,I know that torque has very good features, but it is handy if one is able to use them without searching header files. Good engine must not only have alot of features, but those features must be well documented. Without it developer is forced to explore source code written by someone else - a work that is not much easier, than write this code by himself. It may be appropriate for free engines - they are free, gift in other words, but when company purchases commercial engine (even rather cheap) it espects to be able start game development, if not immediately, at least in several weeks. Having only a class list, without proper documentation it is impossible.
I think at the moment Torque badly laks c++ documentation and may be used only after at least 3 or 4 months of deep explorations of source. I hope, this will change in time (creation of TDN is very good initiative) and then it's good features may be used by C++ programmers too.
09/29/2008 (10:24 am)
I know that full c++ documentation is awailable for customers only. That is why, I came to my fiend's (they are developing some game in Torque script) and just had a glance at c++ documentation. Why I had doubts? I must admit, several years ago I was considering purchase of Torque engine, but decided not to do it - all because lack of C++ documentation and this time I went and saw what licensees get with engine. Must say very little - only badly documented, doxygen generated class list.I may be totally wrong, but it seems that GG made this engine for scripters only. There are 3 books about Torque engine (different versions) and they are all for scripters, no convenience documentation or book for C++ programmers. I am not bashing anybody and not discussing matters that are not my concern, such as GG marketing politics, but as it seems to me it will be very hard to sell this engine to C++ developers. What I need from engine? - I need it make easier my work, not harder. Yes,I know that torque has very good features, but it is handy if one is able to use them without searching header files. Good engine must not only have alot of features, but those features must be well documented. Without it developer is forced to explore source code written by someone else - a work that is not much easier, than write this code by himself. It may be appropriate for free engines - they are free, gift in other words, but when company purchases commercial engine (even rather cheap) it espects to be able start game development, if not immediately, at least in several weeks. Having only a class list, without proper documentation it is impossible.
I think at the moment Torque badly laks c++ documentation and may be used only after at least 3 or 4 months of deep explorations of source. I hope, this will change in time (creation of TDN is very good initiative) and then it's good features may be used by C++ programmers too.
#7
In due time there will be an even balance between script, C++, and GUI documentation. I'm addressing each issue by what is most desired by the community. C++ is on the lower end of that.
*Note - I can't think of an engine that takes less than 2 months to be come proficient with. Have any links to ones that do? I could always use outside reference when creating our docs.
09/29/2008 (10:31 am)
C++ Reference documentation is on my agenda, but it is currently not the most desired feature from the community. They want more Console documentation, which means writing more doxygen tags and creating a specific section in the docs for explaining ConsoleFunctions, ConsoleMethods, and Console variables....all of which gets used mostly in script.In due time there will be an even balance between script, C++, and GUI documentation. I'm addressing each issue by what is most desired by the community. C++ is on the lower end of that.
*Note - I can't think of an engine that takes less than 2 months to be come proficient with. Have any links to ones that do? I could always use outside reference when creating our docs.
#8
09/29/2008 (10:47 am)
The latest book by Edward F. Maurina covers Torque C++ exclusively.
#9
It sounds like Torque is not for you. I probably wouldn't recommend Irrlicht, C4, or the id Tech's, either from your comments about how you feel engines should be designed. Maybe an API-ish engine like PowerRender or TrueVision is more what you were looking for? There are a lot of engines out there. Just find the right one for you, whether it's Torque or not.
09/29/2008 (10:48 am)
A proficient C++ programmer with experience with large codebases should feel right at home with Torque, C4, TrueVision3D, Irrlicht, id Tech x, Unreal, or Source...as long as they sit down and learn the engine in question. And every one of those engines, regardless of their documentation or design strategies, will take a good chunk of time to get up to speed with. Some are API's to engine functionality, others complete engines, all with warts and halos.It sounds like Torque is not for you. I probably wouldn't recommend Irrlicht, C4, or the id Tech's, either from your comments about how you feel engines should be designed. Maybe an API-ish engine like PowerRender or TrueVision is more what you were looking for? There are a lot of engines out there. Just find the right one for you, whether it's Torque or not.
#10
On the other hand, I am searching for code examples - mainly common tasks - just to see how easy to use engine is.
I am afraid if I dedicate this time to learning TGEA, I simply will not meet agenda. At this time, probably we will choose something easier, but hope at the start of another project TGEA will be very well documented. Even, may be GG publishes some book for C++ programmers. Who knows.
Anyway, I wish you all the best and thanks for your help.
09/29/2008 (10:49 am)
Yes, Michael, I agree that it takes about 2 months to familiarize oneself with good quality engine and experiment with it. That is why I have starded my search now - we are planning to start our project in 3 or 4 months and at this time i must be profficient with choosen engine, enough to lead programmers team and teach them most common examples of engine usage (about 2, max 3 weeks).On the other hand, I am searching for code examples - mainly common tasks - just to see how easy to use engine is.
I am afraid if I dedicate this time to learning TGEA, I simply will not meet agenda. At this time, probably we will choose something easier, but hope at the start of another project TGEA will be very well documented. Even, may be GG publishes some book for C++ programmers. Who knows.
Anyway, I wish you all the best and thanks for your help.
#11
09/29/2008 (10:51 am)
E. Maurina's book covers C++? I have read it and it is about scripting only.
#12
09/29/2008 (10:56 am)
As you mentioned it - I have used Irrlicht for a free project and never had any problem with it. It is best open source engine and well documented - enough to make applications with it.
#13
09/29/2008 (11:10 am)
The code itself is the documentation. No need for a manual.
#14
So, end-user documentation is important to have and I will continue to work on new content.
09/29/2008 (11:11 am)
@silentMike - Wellllll, I wouldn't go that far. I do stick to my mantra (Read. Read Code. Code). That first step requires reading available documentation and resources. After that, one would read the C++ code and samples. yada yadaSo, end-user documentation is important to have and I will continue to work on new content.
#16
09/29/2008 (12:05 pm)
Thanks James, I will look at this book.
#17
C++
That is for the basics of C++ that you will use in every program.
OpenGL
OpenGL (Open Graphics Library) is the most commonly used 2d and 3d graphics library, and it supports Mac and Linux.
DirectX
DirectX is used less than OpenGL, mostly because OpenGL has Mac and Linux support, but it is the same thing as OpenGL. It also includes sound, which could help.
OpenAL
OpenAL (Open Audio Library) is not used to make sound, but rather to position the sound in 3d space.
Ogg
Vorbis
I have no idea what these are, but they are used in Torque, so they must be important!
The rest of these I have no idea what they are. Although, they are also included with Torque, so they might be special. And these are on the Mac, so I don't know what's on the windows one:
Cocoa
Carbon
Accelerate
AGL
ApplicationServices
CoreFoundation/CoreServices
DrawSprocket
You are lucky I went out of my way to find these all for you.
09/29/2008 (1:28 pm)
He wants to learn C++ coding... So here are some great tutorials:C++
That is for the basics of C++ that you will use in every program.
OpenGL
OpenGL (Open Graphics Library) is the most commonly used 2d and 3d graphics library, and it supports Mac and Linux.
DirectX
DirectX is used less than OpenGL, mostly because OpenGL has Mac and Linux support, but it is the same thing as OpenGL. It also includes sound, which could help.
OpenAL
OpenAL (Open Audio Library) is not used to make sound, but rather to position the sound in 3d space.
Ogg
Vorbis
I have no idea what these are, but they are used in Torque, so they must be important!
The rest of these I have no idea what they are. Although, they are also included with Torque, so they might be special. And these are on the Mac, so I don't know what's on the windows one:
Cocoa
Carbon
Accelerate
AGL
ApplicationServices
CoreFoundation/CoreServices
DrawSprocket
You are lucky I went out of my way to find these all for you.
#18
09/29/2008 (1:36 pm)
Also, I would suggest that before you learn how to use a game engine. That you learn how the game engine works, and what each aspect does. If you don't want to do that, then I suggest you try to code your own engine.
#19
09/29/2008 (1:48 pm)
Coming from a self taught environment I just dive in and figure out how things work. Start small, make simple changes/additions, and then figure out why it doesn't work (if it doesn't). Learn how it all fits together and soon you'll be writing your own additions or manipulating the code in ways the designers never imagined.
#20
The only thing I want - learn engine's API - how to use it, how create device instance, load mesh from a file, from memory and such things. The way you suggested - to learn how the game engine works - is reinventing the wheel. The only reason for learning engine source i can imagine - somebody is going hardly modify this code (add some functionality, for example), or to correct some bugs in the engine source. Otherwise, learning engine's inner mechanics would be very interesting and didactic, but at the same time - unnecessary and tedious work. It may be interesting for hobbist, the person who learns the basics of 3d programming, but not for practitioner - if you allow me to say that - i.e. the person intended create game, not engine modifications. And there is concept in nowadays programming, called data encapsulation - hiding unnecessary data. Check it. :)
09/29/2008 (5:08 pm)
Thanks Tyler, but I know C++ programming - I used Gamebryo, Trinigy Vision, Irrlicht and some other engines. We didn't modified Gamebryo code hovewer (as Bethesda did with TES), because we did not need to create own construction kit and let end user modify game.The only thing I want - learn engine's API - how to use it, how create device instance, load mesh from a file, from memory and such things. The way you suggested - to learn how the game engine works - is reinventing the wheel. The only reason for learning engine source i can imagine - somebody is going hardly modify this code (add some functionality, for example), or to correct some bugs in the engine source. Otherwise, learning engine's inner mechanics would be very interesting and didactic, but at the same time - unnecessary and tedious work. It may be interesting for hobbist, the person who learns the basics of 3d programming, but not for practitioner - if you allow me to say that - i.e. the person intended create game, not engine modifications. And there is concept in nowadays programming, called data encapsulation - hiding unnecessary data. Check it. :)
Makumba Makumbre