Advertisement

Tried To Learn The Hard Way

Started by July 07, 2017 03:13 AM
5 comments, last by GibbonThatCodes 7 years, 5 months ago

I am a newbie programmer trying to learn game programming. I have had minimal experience with python so i wanted to learn the basics of C++ because I've heard its the best for game programming. I then read a primer book and made a quite robust little object oriented text game (at least where text games are concerned for me.) After having no success in finding a way to learn 2d game programming with C++ I dived headfirst into learning C++ 3d game programming with books like "Introduction to 3D Game Programming With DirectX11" and "Game Coding Complete." I am having trouble taking grasp of the concepts put forth in the book like 3d and object oriented encapsulation for hierarchies for game objects and that kind of stuff.  My question is what should I read or do to understand these things better that's comprehesible and easier to get into pertaining graphics and structure. I just want to make a simple game maybe pong or something not some crazy 3d matricy vertex rendering collision physics lighting mumbo jumbo, at least not at first. Should I look more into python pygame stuff or Unity? Or is there hope for beginners in C++?

Have you considered learning a engine?

 

A tutorial on how to render a sprite with C++, will give you more info than a book on programming games.

Here is one for you: https://learnopengl.com/#!In-Practice/2D-Game/Rendering-Sprites

A book is like a large summary, it isn't focused on one part. Instead you should just learn what you need step by step.

 

A good idea is to think of what you need to do next, then to just learn that part first.

Advertisement

I'm doing the Udemy Unreal developer course and would recommend it as a good place to start, if you're happy using a 3rd party game engine.

 

C++ isn't fast by itself. It has the potential to be fast in the hands of a skilled and experienced programmer that knows how to make the computer dance. Since you don't yet have that knowledge, C++ is perhaps more a hurdle than an advantage for you.

That high speed comes at the cost of everything else, like nice error messages, memory management, and a smart programming language that tries to help you.

 

If you want to pursue in C++ anyway, it doesn't come with tons of libraries to do just anything you may want to do. They have chosen to fill that gap with 3rd-party libraries. So there are 2D libraries available on the net, such as SDL2, or Allegro (haven't looked at that in a decade or so).

There are also tutorials for such libraries, like http://lazyfoo.net/tutorials/SDL/index.php

 

The Python version of the above library is called Pygame at pygame.org . The interface to SDL is a lot simpler in that case, not to mention Python is much more beginner friendly, so you may want to go that route.

 

If you aren't interested in the nitty gritty of "crazy 3d matricy vertex rendering collision physics lighting mumbo jumbo". Take a look at game engines. Unreal might be the right choice for you since you have a C++ background, but I'd also consider Unity. Spend a weekend with both and see which one you like better. 

- Eck

 

EckTech Games - Games and Unity Assets I'm working on
Still Flying - My GameDev journal
The Shilwulf Dynasty - Campaign notes for my Rogue Trader RPG

So, remembering back to when I started to code I got into it kinda like how you seem to be, I jumped into some books - Ironically was the DX9 version of the DX11 book youre reading pretty sure based on the title.

Things do seem to get pretty confusing pretty fast when you jump straight into working on stuff like that at the books tend to introduce / use a concept and then move on a lot of the time - so a good thing is to take it slow when working through them, even re-do exercises to make sure you totally understand them etc, but C++ is a big, hefty language with a lot of things you can do wrong so it can be a slow learning process.

In terms of you mentioning struggling with like objects / hierarchies, there was something I read in a book once (cant remember which) that was pretty simple advice but really did help - Objectify everything you can, even just in day to day life - Basically, just in things you use daily try to think about how they could relate etc for example a Pen and a Pencil, they share a lot of things, could be grouped into Writing Tools etc.

But there is always hope for people who learn to code in C++, its what I encourage people to learn to code in, because its one of the least forgiving to learn so if you can master it.. you can basically code in anything ;p (trial by fire eh?)

This topic is closed to new replies.

Advertisement