Public Group

# Looking for some guidance.

This topic is 1848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey everyone.

As you can probably tell, being on this website and all, I have an interest in becoming a game developer. A while back I messed around in game maker and I loved it, I've done that on and off for probably around 4 years, but I haven't got much to show for it. Recently, I started to take this seriously, and wanted to take my interests further. So I decided to learn a new language. After looking up some stuff about lots of languages, I decided I will learn as much as I can off all of them, but the language that I want to invest my time in primarily is C++, from the looks of it and what people have said, it seems to be the most widely used in professional game development, but also one of the most difficult. Now I have made a "Hello World" program (One of the many variants I have seen, as there were multiple tutorials that explained how to do the same thing in different ways) but I wish to progress but have no idea how to go about it. Usually when I try to learn something, I set myself up with a project and do that, instead of just going over things, so I was wondering if there was a good way I can do this with C++, preferably a game to make, maybe a text based game, seems like a logical thing to do, instead of aiming for an mmo But alas, my knowledge on the matter is limited, and I never really got far enough into game maker to know how to replicate the ideas onto this new language, that is why I have come to this community, I hope you can help me with this problem I am having. So thank you, and sorry for making you read all that.

Peace.

EDIT: Also, I'm not very knowledgeable on the extension things either, like libraries and such, so if someone could explain what they do that would be nice. Thank you.

Edited by OZLK

##### Share on other sites

You could check out www.cplusplus.com for some tutorials and to use as a reference.

As for a "Hello World!" program, I believe the C++ way of doing it would be this:

#include <iostream>

int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}


This uses the streams that C++ uses instead of the functions like printf that C uses, but is still usable in C++.

##### Share on other sites

Well, a library can be a source for custom coding, editors and other tools included with the coding, and then your work is compiled into an executable application running within your game and often in synchronization with other ones.  Things such as scene graphs, clocks and "triggers", or mission scripting like in combat games can be used to tie the varies libraries together.  Eventually you need to decide the core construct which will run your game.  Many have one but some have several working together.  The tremendous advantage of most game engines is that the editors and other tools to create this basic game construct is proven and provided for you to use for coding.  Instead of you having to write a mission editor or data base, for example, these are often provided or recommended to you in already existing libraries.

An alternative is to write code which depends on an interpreter and often this is easier for the beginner to grasp.  In this case then you definitely should work with an already existing system of game engine, because writing the interpreter is beyond the ability of inexperienced coders.

It is a good strategy for any and all aspiring game developers to get some experience with text and algorithm coding of simple programs before entering the jungle of game development.

Choose a game engine or development environment first, use the primary language of that system, work with making simple programs for a while, then expand into game development after a few months of fundamentals.

Without the editors, special tools, and coding of the libraries done for you already, it is a very tall order and much limiting to do it all yourself. Much time is saved in going the prescribed way of a game development environment.

##### Share on other sites

@Dragonsoulj I had actually used that way of coding it before, it didn't work and I had to look up another way to do it, I did it this way

#include <iostream>
#include <conio.h>

using namespace std;
void main(){
cout << "Hello World!" << endl;
_getch();
}


And that seems to work, I am using Visual Studio 2012 if that makes any difference

And 3Ddreamer, I'm sorry, but I only kinda got half of that, you were talking a bit too advanced for me, I guess I'm more noobish than I thought. But as for trying to learn, as I stated in my post I learn best with a project, do you know a good tutorial on creating a program or game that I can follow?

##### Share on other sites

@Dragonsoulj I had actually used that way of coding it before, it didn't work and I had to look up another way to do it, I did it this way

When you did this, do you get any errors or did nothing show up? Since this is a console application, it would close immediately afterwards, unless you opened up the command line and then ran your application. You would be able to read the results then.

Your

using namespace std;
line removes the need to put "std::" before "cout" and "endl".

Instead of "_getch();" you could still use streams:

char c;
cin >> c;

This waits for a keyboard response and then proceeds to finish the application. Since your main function is defined as "void" you don't need the "return 0" line.

##### Share on other sites

Well it opened up, and displayed the text, but then immediately closed. But the one that I did was able to be ran without closing. I tried that second code you put there after my Hello World line, but it just made me be able to type in the window, it didn't close it, unless I pressed enter, with the "conio.h" line. Other than that I couldn't close it, even with "return 0;", this was all with "int" by the way, but as soon as I changed it to "void", with the "char c" etc and without "conio.h" (with no "_getch();" either) it was open until I pressed enter.

##### Share on other sites

I do it like this:

#include <iostream>
using namespace std;

int main()
{

cout << "Hello world!" << endl;

//cin.sync();//that's for later - when you have input in your program
//and you need to clear the buffer after using a cin>>
cin.ignore();
return 0;
}

Edited by lightxbulb

##### Share on other sites

And 3Ddreamer, I'm sorry, but I only kinda got half of that, you were talking a bit too advanced for me, I guess I'm more noobish than I thought. But as for trying to learn, as I stated in my post I learn best with a project, do you know a good tutorial on creating a program or game that I can follow?

Choose a game engine which matches best your goals and the game concept.  Use the main, native language of that game engine. Look for online tutorials for making simple data base, text display application, simple text editor (copy and paste, backspace, delete - all very simple common keyboard operated commands), index application especially with links to other folders, files, or opening applications, image file display program-just for diplay, and other useful applications in data processing.  The things learned with these will be used by all progressive game developers eventually.  None of this will be a waste of time but actually save a ton of time.

OZLK, I do not want to hurt your feelings but you really need to pick key words and use search engines.  Next, get involved with online communities in the language and game engine of your choice.

Sorry, but few shortcuts:  Research is the intellectual backbone of game development, so enjoy and get used to research.   I will give you a hint:  Some fine resources and tutorials are right here at gamedev!

Awhhh... okay, I'll give you another nugget:  YouTube is surprisingly helpful if you are careful to see if the coder doing the tutorial has experience.

##### Share on other sites

Ok, thank you. Yeah, I was probably being a bit selfish before, I kinda half expected for all the answers to just come to me, but I want to do this so I will be more adamant about it now. Any tutorials that you may have seen that you recommend, I've seen loads of them, but if you know one that is better than most then feel free to let me know.

##### Share on other sites

You can make a story game, like they used to have on the first computers. By this I mean something like "You enter a cold dungeon and a goblin appears before you. Press S to swing your sword, press T to talk and press R to run away"

You don't need too many skills to do this with console C++ .... all you need is if and while loops, and cin and cout (and some imagination).

• 10
• 10
• 9
• 48
• 12
• ### Forum Statistics

• Total Topics
631388
• Total Posts
2999715
×