Sign in to follow this  

Where do I start? (C++)

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I've recently learned the basics of C++. I'd like to start making a game, but I just don't know where to start. I'd like to make a 2d game for a learning experience, but I don't know where to start. Should I use an engine? Should I make it myself? There's so much stuff I don't know. If anyone could help me by giving me a shove in the right direction, or giving me a list of stuff I need to know, It'd be helpful. Thanks.

Edited by overki11

Share this post


Link to post
Share on other sites

The FAQ is a great place to start:

http://www.gamedev.net/page/reference/faq.php/_/for-beginners-r1

 

It steers you away from C++ as a first choice, but it's your decision. If you go the C++ route, GutenTag has some good suggestions.

 

If you're ready to start programming games, also take a look at this article. It tells you which games to write and why:

http://www.gamedev.net/page/resources/_/technical/game-programming/your-first-step-to-game-development-starts-here-r2976

 

If you have absolutely no idea how to even start coding something like Pong, then you'll want to spend a little more time learning the language of your choice and start searching for tutorials on whichever libraries or engines you plan to use.

 

Welcome to the forums, and good luck!

- Eck

Share this post


Link to post
Share on other sites

I recommend you to focus on the object-oriented side of the language and make basic text-based games. You can try to create a RPG or something which involves a lot of abstractions, build an inventory, a quest system, leveling system and that kind of stuff. You will see that in your first game you will repeat yourself many times, think of better ways to optimize your program. After you've mastered object-oriented programming, dig into OpenGL, watch tutorials on YouTube. To get a good understanding of OpenGL, you need the basics of linear algebra (vectors, matrix, transformations, translations). 

 

Also, read this book in the meantime. 

Share this post


Link to post
Share on other sites

Well it really depends on what your goals are. Use some gamemaker tool if you really just wanna make a game.

 

Now if you're dead set in programming it thats fine, but dont go overboard, start with something simple, my first was tick tack toe, i learned a lot more than i figured i wouldve, the code was really shit but im proud of it still. for a first game definently don't do an rpg, most people seem to recommend pong as a good starting point and id second that.

 

Going off of the subject of being dead set on coding c++ is a monster, and is gonna make your brain hurt a lot, of course when i was in your boat i didn't listen to people either so that ill leave up to you. Should you choose c++ id say SDL or SFML as were previously mentioned are decent choices, im personally a fan of SFML, i found the API pretty easy to use for a beginner, their websites tutorials are pretty on point, though not too lengthy. SDL has some amazing tutorials from what ive heard.

 

All these choices really come down to what you want out of your game making experience. Good luck!

Share this post


Link to post
Share on other sites

cplusplus.com got me on track for using C++, I would recommend against starting with a 2d game initially. At least until you have a good grasp of the language.

 

If you're hellbent on doing so however, I would point you to any of the three major C++ libraries for game making.

 

SDL2

SFML

Allegro

 

Again, I wouldn't try a game until you're comfortable with writing basic C++ code without looking at tutorials or documentation

 

I disagree with not trying a game until he knows basic C++.

 

If you want to make a game just dive and do it. Be prepared to fail, making games is hard and you'll go through many iterations but making a game is very rewarding. You'll learn alot about C/C++ along the way. I think that writing anything else to just learn some C++, beyond basic guess a number etc, will ultimately bore you because you won't be working on what you actually want to be working on.

 

Get stuck in, find a few good websites like this one, ask lots of questions, read lots of articles and you'll be there in no time.

Share this post


Link to post
Share on other sites

If you want to do a 2D game (be warned, making a game isn't a child's play, and a 2D game is not the easiest task), you most definitively want to use SDL or a similar library. There are a few alternatives... but SDL is good, there's no reason why you couldn't/shouldn't use that one.

 

If you are a beginner who only just learned some C++, you will (almost certainly) fail -- utterly and miserably -- trying to create a window, handling input, and drawing a couple of sprites, let alone load an image from disk. Chances are that you will be demotivated afterwards. While interfacing with the operating system and reading/decoding a file format is not really all that hard once you grok it, it's tedious and unrewarding, and what you have to do is not always something that is immediately obvious to a beginner.

 

A library like SDL will abstract all that ugly stuff away and allows you to do the task by calling a few well-documented functions. This not only saves you a lot of time and allows you to get something done (that's important for morale!), but it's also a lot more fun overall.

 

You will find that making a program that works correctly (doesn't crash, doesn't leak, behaves as intended) is already enough of a challenge for a beginner. Dive into the ugly low-level stuff once you are a bit more comfortable with programming in general.

Share this post


Link to post
Share on other sites

Are you more interested in making a game or learning to program games?  It also might be helpful to express what your short and long term goals are.  If you have a dream game you'd like to work on sometime "relatively" soon (even in small pieces) my suggestion is you start getting familiar with the unreal engine (just doing simple things like loading a mesh,displaying it and playing an animation) since it uses C++ and something called blueprints.  If not (or perhaps at the same time) a simple pong or breakout game using SFML and c++ would be wise to get some experience implementing the things that are taken care for you in unreal and the basic things involved in game programming like a game loop and timing.  I haven't looked at unreal so I don't know if things like pathfinding are built in or not but in terms of things you should look into are pathfinding, collision detection, timing, input handling and others.  Here a page that has some pathfinding and other resources: http://www-cs-students.stanford.edu/~amitp/gameprog.html  Good Luck.

Share this post


Link to post
Share on other sites

If you want to make a 2D game you could always try Construct 2. It's event based and you don't have to write difficult code. I'm not going to rain on your parade, and don't know your education, so I'll use my own as an example. I've had the same dream, but writing code is really hard. For me I dropped out of high-school, eventually here only a couple of years ago got my g.e.d, but have also learned more math due to my new interests than I ever did in school. I've been programming for many years, and crashed many projects. I have to say I'm STILL not smart enough to code in ANY heavy language. No game is coming out of me in C++, COCOS 2D, or the such. I've just accepted I'm not smart enough. You gotta know tan, cos, sin, and a bunch of linear algebra, how to plot and pick lines.. and on top of that, all the nasty code those engines and languages require... The people who make the awesome games you play, aren't just smart, some of them are rocket scientists, literally. The people who put Quake on the market, also launched Spaceship One...

 

Now if you're a wiz at math, this wont hinder you, but 16 years later, and I'll still crash any major project in a difficult language....

 

Enter MMF2/Construct 2. These two engines are awesome for people like me. Just plot events, and make some cool stuff, and the math and programming knowledge I learned along the way helps a lot...

 

If you only want to make a game, then check those out. I am NOT knocking your programming though. If you're smart and love it, go for it... but let me tell ya, if you can't make a strong, well built class in c++, you're nowhere near ready for a 2D game. Just keep learning though, that's what I do, cuz really, writing code is fun tongue.png

 

Still I would check out one of the mentioned if you are like me and not adept to heavy mathematics, my fav in construct... You mentioned not knowing where to start with coding though. Don't get too caught up in the battle. Just know what platforms you want to target and pick the language/framework/engine that's at-least in the top 3. There are literally 100's to thousands of frameworks out there... basically a hammer is a hammer. They all pound nails. Just pick the one you feel best suits you.. The one with the prettiest code to you, and give it a go.

Edited by JeremyB

Share this post


Link to post
Share on other sites

Before rushing off and putting together a C++ 2D game, make a text-based game first. You'll thank us for it in the long run.

 

On the other hand, that doesnt stop you from making a 2D game whilst you do that.  On the side, you could use Unity - or my personal favourite - GameMaker.  GM is actually fun to use and very capable. I'd recommend checking out AM2R to see what one can achieve with the program.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this