How To Start Game Programming With C++

Started by
10 comments, last by Isvar Arthur 7 years, 9 months ago

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

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.

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.

I would start by installing SFML and going through their tutorials.

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.

If you want to start off with game programming in c++ you realy should use SDL or SFML as they provide ways to do simple graphics, handle input and even do sounds.

If you want to get into graphics programming straight ahead you should take a look into opengl or directX just do a search on the internet for it there should be plenty of tutorials. You could also start of with vulcan/dx12 straight ahead but as it's way more lowlevel it is realy hard to lern without some understanding of core priciples so the diving into might spread way more than you'd expect.

If you don't realy care about the "how it works behind the scenes" and just want to make a game take a look at engines like unity or udk and see if they provide what you are looking for.

I don't know about the industries requirements though and it heavily depends on what would be your field of work as there is plenty different. Don't take it personally but i don'T think the: "I'm straight from university and looked into gamedev for a few months now" will get you any job. I'd reccomend you do it as a hobby first get some knowledge and build some demos to show of your skills. I wish you the best luck anyways.

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.

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

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.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

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

This topic is closed to new replies.

Advertisement