11 Replies - 1159 Views - Last Post: 26 June 2014 - 03:14 PM Rate Topic: -----

#1 qaispak  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 29-March 13

Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 06:41 PM

I have college/coursework experience in C++ programming but did not touch it for almost a year (got back into it recently).

I really want to know how a normal 3d video game is made. I know this is a broad question and after days of googling, I've found some information but really have other questions.

Apparently the best game engine out there is UDK 3 (and I don't really know what a game engine is) but whenever I see videos on youtube it looks like people are just modding or using already made maps and stuff. Where is the "making your own" game?

Apart from that, I always thought video games were coded in C++. UDK uses "unreal script". So where does the C++ come in?

After I've recapped everything I've learned (which will be up till polymerphism, inheritance classes. etc) I want to start into video game programming. So I wanna know how I should start and what it is. Really confused about all of this so would appreciate some help!

Is This A Good Question/Topic? 0
  • +

Replies To: Can someone please help me on the concept of game development in C++?

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10668
  • View blog
  • Posts: 39,615
  • Joined: 27-December 08

Re: Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 07:04 PM

Moved to Game Development. The folks over there will be able to better answer your questions.

How is your math? 3D graphics require a lot of math, including linear algebra and calculus. If you don't have a solid foundation on those, you will run into a lot of difficulties in terms of object movement, collisions, etc.
Was This Post Helpful? 0
  • +
  • -

#3 qaispak  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 29-March 13

Re: Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 07:43 PM

View Postmacosxnerd101, on 25 June 2014 - 07:04 PM, said:

Moved to Game Development. The folks over there will be able to better answer your questions.

How is your math? 3D graphics require a lot of math, including linear algebra and calculus. If you don't have a solid foundation on those, you will run into a lot of difficulties in terms of object movement, collisions, etc.


First of all, sorry for not posting in the correct place. I do apologize.

Second, I would say I am not one of those amazingly brilliant students who are just smart but I do well. I mean, so far I've taken courses till Calculus 2 in college and have scored high A grades but that's because I studied hard and it wasn't like I was just a genius at it. Have yet to take linear Algebra.
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10668
  • View blog
  • Posts: 39,615
  • Joined: 27-December 08

Re: Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 07:47 PM

I'd encourage you to start with 2D graphics, if you haven't already. Get a solid understanding of game architecture and 2D graphics programming. Work on getting your math up. Linear algebra is a big one to have under your belt before taking on 3D graphics programming. Some physics (Mechanics) couldn't hurt either.
Was This Post Helpful? 0
  • +
  • -

#5 qaispak  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 29-March 13

Re: Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 07:57 PM

View Postmacosxnerd101, on 25 June 2014 - 07:47 PM, said:

I'd encourage you to start with 2D graphics, if you haven't already. Get a solid understanding of game architecture and 2D graphics programming. Work on getting your math up. Linear algebra is a big one to have under your belt before taking on 3D graphics programming. Some physics (Mechanics) couldn't hurt either.



I thought of the same. To start something very basic. But wanted opinions of others if that was a good step or just wasting time as opposed to directly diving into a game engine and then slowly and steadily learning.

I'm also a bit confused on how exactly I'm to "start". My knowledge is restricted to and IDE and writing C++ codes. I have no experience in programming a graphical interface let alone game programming.

Whatever I do, the only thing I know is C++ programming (which also needs refreshment) and I want to have really clear concepts so would like to start somewhere comfortable.
Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10668
  • View blog
  • Posts: 39,615
  • Joined: 27-December 08

Re: Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 08:07 PM

I'm not really a C++ guy, so maybe someone can answer this better than me. However, I'm pretty sure C++ doesn't have GUI capabilities built in. I'd search for some GUI/Graphics library and go from there. You can search the forum for old threads, as we get this question quite frequently.

It is definitely a bad idea to jump in to building a game engine if you feel you are quite rusty and don't know where to look. Start with something more basic.

I will let others more knowledgeable than me take it from here. You might benefit from checking the pinned threads out as well.

Best of luck!
Was This Post Helpful? 0
  • +
  • -

#7 qaispak  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 29-March 13

Re: Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 08:16 PM

View Postmacosxnerd101, on 25 June 2014 - 08:07 PM, said:

I'm not really a C++ guy, so maybe someone can answer this better than me. However, I'm pretty sure C++ doesn't have GUI capabilities built in. I'd search for some GUI/Graphics library and go from there. You can search the forum for old threads, as we get this question quite frequently.

It is definitely a bad idea to jump in to building a game engine if you feel you are quite rusty and don't know where to look. Start with something more basic.

I will let others more knowledgeable than me take it from here. You might benefit from checking the pinned threads out as well.

Best of luck!


Okay, thank you for your reply! However, in case I mistyped something I don't want to make a game engine! I'll need to kidnap someones brain for that and will be done by the time I have grey hair! ( I think )

And along with a "from where should I start" question I also wanted to re-ask my confusion on what C++ is required for if games are made in unrealscript.

I will surely check older forum posts. Thanks :)
Was This Post Helpful? 0
  • +
  • -

#8 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3622
  • View blog
  • Posts: 11,290
  • Joined: 05-May 12

Re: Can someone please help me on the concept of game development in C++?

Posted 25 June 2014 - 09:47 PM

The "Design Goals" section of the Unreal Script Reference may help shed some light on why some parts are C++ and why other parts are in Unreal Script.

Quote

To enable rich, high level programming in terms of game objects and interactions rather than bits and pixels. Where design tradeoffs had to be made in UnrealScript, I sacrificed execution speed for development simplicity and power. After all, the low-level, performance-critical code in Unreal is written in C/C++ where the performance gain outweighs the added complexity. UnrealScript operates at a level above that, at the object and interaction level, rather than the bits and pixels level.

Was This Post Helpful? 0
  • +
  • -

#9 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 581
  • View blog
  • Posts: 1,292
  • Joined: 24-April 12

Re: Can someone please help me on the concept of game development in C++?

Posted 26 June 2014 - 01:32 PM

You have an excelent background with which to get started. Now don't get me wrong, is basically right about everything he told you. But I've never even taken calculus. So, you're ahead of me in the math department. All you really need to know is matrix algebra (part of linear algebra but I've seen it taught in high school and middle school) and vector math which I've seen taught in Trigonometry before even Calculus but which is also taught in linear algebra. You might also throw in Quaternions which is taught in... well, I don't know but probably somewhere along the way towards getting a PHD in math.

The more math you have the better, but if you know Trigonometry that's all I really know other than what I taught myself.

The one place that constantly causes problems for me is when I get deep into the physics stuff sometimes my lack of any knowledge of Calculus bites me. But most of the physics stuff I've seen can be done with algebra and a decent knowledge of programming. You have to get into a pretty deep simulation before Calculus is really a requirement. My college physics text book is 2 semesters and there's no Calculus in it anywhere. It's mostly algebra and maybe a little bit of trig for angles and that's going to get you pretty far in 3D game programming.

You just have to learn matrices, which is actually more about how specific types of matrices are used in 3D graphics which is not even something they will teach you in a math class. If you have the matrix algebra or linear algebra in school, awesome. It will make learning it easier. But even if you do, you're going to have to learn about what a View, Projection, and World matrix are and how they relate to drawing 3D graphics.

Vectors are a pretty big deal, especially when you get into HLSL or GLSL and the high end graphics. The sooner you can "get" vectors the better. They teach you most everything you need to know about vectors in trig class, whether you actually comprehended it is the question. There is a whole lot of applied vectors and Linear Algebra is the class where they really pound that into your head. But I've never taken Linear Algebra. I can recommend a good Linear Algebra book for game programmers, if you want to self study. But mainly you just need to know what was taught in those 2 or 3 weeks of trig class when they went over vectors. Unfortunately, they tend to breeze through it, the professor may not understand what he's teaching, and in shader programming and such you need to know that stuff inside and out well enough to teach it to seven year olds for a living. You have to understand it rather than just pass a test on it, because it's applied vectors. Still, you can learn it and there's not really too terribly much to it if you can manage to grasp the main concepts.

Vectors tend to scare people and they really shouldn't. They're not that bad once you get a few simple concepts.

But outside of complex physics simulations in games (which you can do a lot of 3D games without getting into realistic physics), I've never seen Calculus ever used or anything really beyond what's taught in a trig class except maybe matrix algebra.

No doubt, the more math you know the better. But don't let it keep you from getting started. If you sign up for a math class next semester, no sense in waiting half a year to get started in game programming.

C++ is also a great background to start from no matter what direction you go from there. That's probably going to help more than anything else you've got going there.

The hard way would be to use C++ with WIN32 to make Windows programs. I haven't done Linux or Mac or anything other than Windows with a few exceptions (mostly in school). But any time you're working with a graphical environment like Windows (especially one like Windows that obfuscates the hardware and lower layers) you're going to have to learn some sort of API, like the Win32 API to write programs for that environment. For Windows it's WIN32 all the way up to Windows 7 (I'm not sure where they are at for Windows 8 development).

Then because Windows takes control of the lower level and blocks you from getting to it, you need some way to get to that lower hardware layer. Specifically, you need to be able to get to the graphics card. The hard way is DirectX or OpenGL. DX is Microsoft's way that only works in Microsoft environments. OpenGL is open source I believe; regardless it works in many different environments including Windows and Linux.

Since DX and especially OpenGL are intended primarialy for graphics you may need other libraries or API's in order to do things like work with game controllers, sound, or other things involved in making an actual game.

But this is the hard way to get into game programming. It's my favorite way for me to work on game programming, but I've been at this for several years and have experience with other stuff that prepared me for working in DX with C++. I love it, but it's a rough place to get your feet wet and get started without a whole lot of help and guidance.

There are other ways to get into game programming with your C++ including SDL. You may want to look into that, although I think you need to add OpenGL to SDL in order to use it for 3D (I believe SDL is then used for things like game controller, sound, etc.).

This post has been edited by BBeck: 26 June 2014 - 03:00 PM

Was This Post Helpful? 2
  • +
  • -

#10 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 581
  • View blog
  • Posts: 1,292
  • Joined: 24-April 12

Re: Can someone please help me on the concept of game development in C++?

Posted 26 June 2014 - 02:58 PM

Had to cut that short earlier. But I was going to at least mention Unity. Unity is another game engine. It can be programmed in C#, Java, and some language that I think is basically propietary or something.

Unity is really cool for what it is, and probably worth the free download just to play with it and try it. Unity is very powerful with a whole lot of capability even in the free version. You write C# or Java scripts to customize it. Yes, it's a lot like working with a level editor for a lot of games, but it's more powerful then that. It really does have a wide range of capabilities both in 2D and 3D.

I have very mixed feelings about Unity. Personally, I stopped using Unity - at least for now. What I found was that I was falling into the trap of buying too much of the game as opposed to really getting deep into creating stuff. It's an easy trap to fall into with Unity. The danger is that you won't learn anything and that because you won't have that knowledge you will get completely stuck when you do get stuck because you won't know how to get yourself out of the situation.

I've bought a couple of cool Unity products that worked fine on their own but crashed pretty hard when I used them together. So, I had to do a deep dive into someone else's code to debug them, find out why they were no longer working, and fix it without a whole lot of help. I can't imagin a beginner doing that.

And I realized that what I enjoy about this is digging into the deep understanding of how the games work. I found myself really missing that low level control with Unity; if you're going to use Unity you have to simply accept it for what it is and use it the way it was intended to be used. You could make a whole lot of games that way, but I found that I really enjoy having greater control then that even at the expense of producing less work.

So, I went back to C++ and DX11. Then I got pulled off to work with some friends on a game project. We looked at doing this 2D game project in Unity for several weeks largely because it's very cross platform. In the end, I decided to abandon Unity for our 2D project because the GUI system in it was not able to do what I wanted it to do. So, you really have to accept Unity for what it is and work with that. We decided to go with XNA/MonoGame instead, largely because C++/DX is not cross platform compatiable and also my skill level is much higher in XNA then it is in DX. Since, I'm mentioning it XNA/MonoGame is awesome for beginners, especially those on their way to learning DX for 3D, if you can get over the fact that Microsoft is no longer supporting it and therefore the developer community around it is kind of dying. That's where I learned.

But there are many different platforms you can develop games with. WIth a C++ background it should make it easy to get into any other programming languages you want or are required. C# is especially easy for C++ people, it's just more object oriented which is a really good thing for C++ people to work on if they are not very solid with OOP. Java shouldn't be too hard for a C++ programmer.

You're really in a good place to jump in. I didn't have much more experience then you when I initially jumped into XNA and 3D game programming with XNA. That really helped me prepare for DX, where I still have a long ways to go, but have found my XNA knowledge to be invaluable there.

HLSL (Hi Level Shader Language) and GLSL (openGL Shader Language) are C like languages used to program shaders for DX and OpenGL. (And other environments. Unity uses CS I believe.) One of the reasons it's especially difficult to start with DX11 or DX10 is because you have to use HLSL for even simple projects and that's a huge learning curve for a beginner (probably requiring a lot of that vector math for even a simple Blinn Phong shader). But it's similar to C. It's learnable. The hardest part is finding someone to teach it to you. HLSL is so tightly integrated into DX that I think a deep understanding of HLSL (at least mastery) only comes when you learn how HLSL and DX work together. Is started with HLSL in XNA, but at first you kind of just follow examples more then you understand. Working in DX has deepened that understanding although I still have more to learn.

One of the biggest problems with 3D game programming is getting art assets to work with. You will probably have to build some of your own. Realistically, you're going to be working with your own art assets most of the time because you won't be able to find good assets.

Even in Unity where they have a store where they will gladly sell you $10,000 of assets, it's probably not going to be all the assets you need for a full 3D game. And they are expensive, if I didn't mention that. Being able to build your own assets, I think is mandatory. Although, that probably means building very rough excuses for art assets that serve as stand-ins until you can get a real artist to make you what you need. Of course, the better you get at the art, the more good assets you'll have.

Blender is a great freeware program for 3D modeling. It's basically digital sculpting and requires time to learn the craft. Blender does a bunch of other tasks as well, such as rigging, skinning, and annimation.

Anyway, I'll invite you to check out my website in my signature. I've got a tutorial on getting started with 3D game programming in XNA. After that it's just a bunch of simple 3D programs to teach individual concepts where I wrote comments at a ratio of probably about 6 lines of comment for every line of code. Not so much a tutorial, but rather code for people to read and learn by. You would have to learn C# to do XNA, but it's pretty easy for a C++ programmer.

But I would definately recommend jumping in head first. The water's fine.

And we're here to help if you have questions we can answer.
Was This Post Helpful? 2
  • +
  • -

#11 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3624
  • View blog
  • Posts: 12,527
  • Joined: 12-December 12

Re: Can someone please help me on the concept of game development in C++?

Posted 26 June 2014 - 03:12 PM

Quote

Had to cut that short earlier.

What?! :online2long:

BBeck gives good bang per buck ;)
Was This Post Helpful? 2
  • +
  • -

#12 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 581
  • View blog
  • Posts: 1,292
  • Joined: 24-April 12

Re: Can someone please help me on the concept of game development in C++?

Posted 26 June 2014 - 03:14 PM

Oh. Also, I might mention the days of game programming in only C++ are behind us. I like C++ ... a lot. But it is no longer a requirement that all games must be written in C++. I used to come from that school of thought because there was a time when that was true. It kept me from getting into XNA for a couple of years because I scoffed at C#... until I actually tried it. Then I never found anything I was capable of doing that C# and XNA were not capable of doing.

The fact of the matter is that on modern computers, they run so fast they can afford to waste a lot of CPU cycles without anyone really noticing. So, C++ and Assembler are no longer needed to squeeze out that last ounce of performance. For 2D work, probably almost anything will work these days.

For more demanding 3D work, most any actual 3D solution will work, even Unity which is a pretty thick layer between you and the OS let alone the hardware. It's probably using DX or OpenGL under the hood. That's about the only way to do it in Windows. But a lot of them, like SharpDX for example, may allow you to have the advantages of DX or OpenGL without learning DX or OpenGL, which is ridiculously complicated.

I mean you will really learn how 3D games work with DX, but you may be spending years just trying to figure out how to put some basic stuff on the screen rather than actually making something that remotely resembles a game. Drawing a triangle to the screen is a major accomplishment in DX. There are a lot of other options where you could get results easier.

And I don't think you're missing out on anything significant with XNA. With Unity, yes you're missing out on a lot if you really want to know what's going on and how it works, but what you miss with XNA is stuff you don't need to know until you are truely ready to begin DX. What XNA does not make you learn is stuff like "How a JPeg file works and how to parse, uncompress, and turn the data in the file into a picture". DX is ridiculously low level and does almost nothing for you. I've spent months just trying to build up a DX library of my own code just to do the most basic of stuff that you will use in every 3D project you ever work on ever. DX does nothing for you almost. So, you're going to have to teach DX mind boggling basic stuff. With XNA, or probably many other options, you can just jump straight into making an actual game.

You can jump straight in with Unity or a game engine, but you'll be learning that game engine about 20% of that time. The other 80% of the time you will be learning how to work with art assets, which is where you will spend the bulk of your time no matter what you work in. Art is a huge part of it.

Well, I better get, but let me know if you have game programming questions. I love to share what I know for whatever that's worth.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1