Jump to content
  • Advertisement
Sign in to follow this  
panda71

How To Start Game Programming With C++

This topic is 787 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

Background : I have just finished my bachelor program in university , I have studied computer engineering , I can write codes with c++ , c# and java ... i am better with c# , i have done more coding with it . recently i have decided to work on game programming ... i intend to continue this as my main career , not just doing it as a hobby .

 

Question : i am really confused , i have written very simple game like hangman with c# , my problem now is that i have no idea how to start games with little graphic , for example a simple 2d game like mario (i know it's too much for me now and i don't intend to make something like that ) . how am i suppose to draw the platform ? or assign keys to move a character through the screen and the platform ? is there any guide or book that can teach the basics with working with graphics ?

 

I'd appreciate any help

thanks  

Share this post


Link to post
Share on other sites
Advertisement
There were many way to develop a game.
A game was composite by many sub-system.
For example: Main System of Game, Characters System, Graphics System, Control System ... etc. Maybe you should try to study one of sub-system you interested.
Or, you can study Unity 3D. It is very complete game develop system.

Share this post


Link to post
Share on other sites

That depends really what your target is and how low level you would work.

 

Is your goal to write a game an learn mainly game mechanics I would advice you to find some API or Engine an build your game up on that. For 2D I'm not sure but SDL might be a good starting point. For 3D UnrealEngine or Unity both are very powerfull and "easy to use" (regarding their power) engines.

 

If your wan't to learn on the techniques behind and study how to write an engine you should lern about the differnt subsystems.

For input: Study window creation and system message handling on your prefferd OS.

For rendering: Learn about D3D (11) and OpenGL

For Physix: Learn about PhysX, Havok or something similar.

aso.

Share this post


Link to post
Share on other sites

Question : i am really confused , i have written very simple game like hangman with c# , my problem now is that i have no idea how to start games with little graphic
I don't know about c#, but with C++, you get graphics functionality by using a 3rd-party library.

 

SDL and SFML are basically plain rectangles in a window (or full screen) that you paint on, with keyboard/mouse support for getting key-press and mouse move events.

 

If you want more normal application-ish, you can use a GUI toolkit. I mostly only use Qt (although it provides more than Gui support), but there are loads of other such toolkits. Typically you end up with a 'normal' gui application, and not 'a game'.

 

Unreal or Unity for c# are full blown frameworks for making 3D games, they provide a lot more functionality. Can't tell you much about it, as I never looked at any of them.

Share this post


Link to post
Share on other sites
Have a look at my website www.MarekKnows.com there I've posted step by step video tutorials showing how to program in c++ and OpenGL to create games.

Share this post


Link to post
Share on other sites

thanks to you all guys ... they were all helpful ... i think i should do some reading before asking any other questions  :D ....

Share this post


Link to post
Share on other sites

It is good that you have all of that programming experience, though I am not sure about your skill level. No doubt, you have enough to begin simple game development.

 

I tried Java, C#, and now C++.   In the game industry, a lot of AAA games use C++ for the back end programming and some scripting language for the game itself, such as Lua, C#, Python, or combination of two.  Some make their own scripting language loosely based on an existing one.

 

The "game engine" backend programming is a full time job to create by itself, unless you have years to spend on it. Typically, teams make the game engine and other teams make the game itself, with some overlapping in some game development organizations.

 

If this is only a hobby, then do what you want to do. If this is a career choice, then I recommend the taking of one of two paths:  Build or Join a game development company  /// OR /// Go Indie Developer. 

 

More to your question>>>

Take a look at SDL.  (Simple DirectMedia Layer)  It is designed for OpenGL and C++ development, but there are libraries / bindings for many other languages and you can even use it for Direct 3D API in certain situations. SDL simplifies and streamlines development so that issues such as control devices (keyboard, mouse, controller, etc.) are much more accessible and the development is more productive. SDL is a set of libraries as a layer between your game (or other software) and the existing API in computing devices (usually OpenGL or similar).  SDL also makes development more productive for 3D or 2D rasterizing or rendering. There are libraries for open source sound, window creation (with or without borders), loading screens, and error messages. There are also plugins for some of the best debugging and other analysis tools. SDL is very good for beginning and intermediate development.  It can get complex for advanced dev, particularly in testing and debugging, but some popular games use at least part of the SDL package.

Share this post


Link to post
Share on other sites

 You must first get yourself familiar with the concept of a game loop.

These resources might be helpful:

Then, you need to know how to implement various sub-systems of the game and will have to select the libraries which you want to use for that purpose.

You can use libraries like SDL/SFML to take care about sub-systems like Graphics, Sound, Input Handling, etc.

 

Next, you will have to learn how to create a complete game architecture so that you can integrate all sub-systems properly.

Here's a great book which summarizes all this well: Game Coding Complete, Fourth Edition

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!