10 Replies - 2399 Views - Last Post: 08 December 2013 - 08:14 AM Rate Topic: -----

#1 Kingzachary  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 02-December 13

How do i make a Game Engine in C++?

Posted 05 December 2013 - 01:32 PM

Hi, so I was wondering how I can make my game engine. I've been learning some C++ for a little now and getting a good understanding and learning the basics. I just want to know if someone can post some books, websites, or other things so I can find out a basic guide for making a 3D game engine using C++.
Is This A Good Question/Topic? 0
  • +

Replies To: How do i make a Game Engine in C++?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9366
  • View blog
  • Posts: 35,187
  • Joined: 12-June 08

Re: How do i make a Game Engine in C++?

Posted 05 December 2013 - 01:33 PM

Moving to Game Development..

Have you eyeballed the pinned threads in the game dev section?
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5363
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: How do i make a Game Engine in C++?

Posted 05 December 2013 - 01:34 PM

Coming from someone that has never written a game engine, I believe those that know how to, know why they need to. So until you've used other game engines that are available, I wouldn't suggest trying to write your own. You'll need to know more than just the basics of the language.
Was This Post Helpful? 0
  • +
  • -

#4 Kingzachary  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 02-December 13

Re: How do i make a Game Engine in C++?

Posted 05 December 2013 - 03:10 PM

Yes i have looked through the pinned game development sections but haven't seen anything about game engines (maybe a link if something is there?) and also I do understand why I need a game engine and have made simple games using the Unity game engine before. Also I have made a 2D game using Java before so I understand how coding works and how stressful it can be. I am looking to see if someone here can provide some advice as to how I can make a game engine. I understand I need to know more about C++ before I jump into my game engine which i am teaching myself everyday making very simple programs with C++. If you could help me out with this i'm looking to make my 3D game engine using C++, and DirectX. Thanks for helping in advance.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9366
  • View blog
  • Posts: 35,187
  • Joined: 12-June 08

Re: How do i make a Game Engine in C++?

Posted 05 December 2013 - 03:22 PM

I am certain this was thrown around as an example of a book to read up on

http://www.amazon.co.../dp/1568814135/
Was This Post Helpful? 0
  • +
  • -

#6 Kingzachary  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 02-December 13

Re: How do i make a Game Engine in C++?

Posted 05 December 2013 - 03:38 PM

Thanks! I am considering about buying it but read a few reviews and one said that this books doesn't give much coding examples and what the code does which is what i'm aiming for. I looked around on there for some books that give coding examples with it but didn't find many and most were outdated. Not sure if the outdated part really matters but i would like so find something around the present time (not to be picky or anything). But thank you for showing me the book, really thinking about buying it just so I can fully understand how a game engine works more than what I already know and will make the best of it!
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9366
  • View blog
  • Posts: 35,187
  • Joined: 12-June 08

Re: How do i make a Game Engine in C++?

Posted 05 December 2013 - 03:44 PM

Well.. yeah.. a game engine is just a concept.

Nothing more than:

Posted Image


If you want to learn C++ then learn C++.. if you want to learn high level concepts to apply your c++ then you make a game engine. Hells bells I made a "game engine" in a VB.NET tutorial of mine. My view is there's no particular reason to lock in 'game engine learning' to a specific language, but instead assume that if the person attempting a game engine is knocking they have the wherewithal (and programming chops) to dispense with hand holding and having syntax bogging down the discussion and go straight for the concepts.



Not to mention when I put in "game engine tutorial c++" a metric ton of responses come back.

http://www.dreaminco...scratch-part-1/
http://www.gamefroms...PP-Edition.aspx
https://encrypted.go...iw=1328&bih=632
http://www.extremete...tomy-101-part-i

.. etc. At this point I am unclear what specifics you are looking for if the plain ol internet search is turning up nil for you.
Was This Post Helpful? 0
  • +
  • -

#8 mostyfriedman  Icon User is offline

  • The Algorithmi
  • member icon

Reputation: 727
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: How do i make a Game Engine in C++?

Posted 05 December 2013 - 05:39 PM

Just start by making A LOT of games, make sure your code is well organized, clean, efficient, etc. Then you take out the common stuff, put it in a project of its own, generalize it, and you'll have yourself an engine.

This post has been edited by mostyfriedman: 05 December 2013 - 05:40 PM

Was This Post Helpful? 0
  • +
  • -

#9 BBeck  Icon User is offline

  • Here to help.
  • member icon


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

Re: How do i make a Game Engine in C++?

Posted 06 December 2013 - 07:47 AM

If you find a "basic guide" to making a 3D game engine in C++, please let me know. I've been looking for it for the past decade.

Honestly, you probably need to make several 3D games from scratch before worrying about making an "engine". Although the word engine means many different things to many different people. But I assume we're talking about making Unity here, since you mentioned that and said 3D engine.

But first you'll need some way to give C++ access to all the systems it needs to access. With DirectX, you'll get access to most of those systems. With OpenGL you'll need to use additional libraries. Or maybe you can use other libraries rather than using DX or OpenGL directly.

But making a game engine is a pretty major undertaking. Making one like Unity is probably pretty close to a life time achievement. There are a mountain of things you need to know how to code unless you can find libraries to do it. For example, C++ doesn't know how to read ANY data file out there whether. Try loading a model from 3D Max or Maya; you'll not only have to write code to load the model's data, you'll also have to write code to teach it to read a .JPeg, .DDS, or other file for all the textures of the model including bump maps and so forth. You have to teach it just how to read the file itself before you can even think about what its going to do in the file.

Anyway, the first step is probably to figure out if you're using DirectX or something else. DirectX and OpenGL are both very rough to learn. Even back in the DX9 and OpenGL2 days they were tough to learn. But DX11 and OpenGL4 are so difficult that a lot of "professionals" avoid them. Game Institute, for example, still teaches DX9 which is how many years old now. Although, I think they're right: you should probably learn DX9 before trying to tackle DX11. And you should probably learn HLSL before you start with DX11 or OpenGL4.

I could recommend some books. For example, I hear Frank Luna's DirectX book is about the best on the subject. But the truth is that if you're going to try and create Unity from scratch, you probably need to go buy pretty much every book currently published that's vaguely related to the subject.

I would suggest that you start making 3D games without an engine. If you're ready to make a 3D game engine, you won't have any real questions about how to make it; you'll likely be teaching classes on it before you're ready to start doing it. What I mean by that is that you'll already be pretty much better than 99% of the game programmers out there on everything from HLSL to parsing .FBX model files.

I think a better approach would be to try making Pong in 3D and then start making other 3D games. For something like that, you don't really need an "engine". I think once you've made a dozen or so of such games in 3D you'll be in a much better place to tell yourself how to make a 3D game engine.

To get started, I would recommend spending a few years mastering a slightly easier platform such as XNA or something else where you can code matrices and study HLSL for a couple of years. You want to understand the View matrix, the projection matrix, and world matrices inside and out before even thinking about using DX11. You "could" skip this step of learning something else, but you will gain invaluable experience there.

Once you're ready to start learning DirectX. I would recommend learning DX 9 before you even think about DX11. You need to be very solid with HLSL before you begin DX11. DX9 will let you get started without HLSL, DX11 won't.

Anyway, I think the first step to making a 3D game engine is to have completed quite a few 3D games in C++. Well, actually, I think the first step is to take a step back and code quite a few 3D games in an easier platform that allows you to code your own matrices and gives you to code Blinn, Phong, and other shaders using HLSL, like XNA for example, and then write several games in C++.
Was This Post Helpful? 2
  • +
  • -

#10 Kingzachary  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 02-December 13

Re: How do i make a Game Engine in C++?

Posted 07 December 2013 - 11:58 AM

Ok well reading all of these replies is really helpful. I will head all of the advice given and use everything to the best of my ability. The main thing that I want to do with my engine is just make a terrain editor like unity's and maybe a 3d modeler or just so i can import models from Blender. I understand that this in itself is a lot of work but if theirs anything with advice on that it will be helpful. Now one point I would like to bring up is the fact that I posted a question earlier for making 3D games from scratch or making and using an engine. I got a few responses about making a engine first. I'm looking to make RPG games so I heard it will be easier to make a engine because less work will be needed for future games because I can use old code from previous games (please correct me if i'm wrong). But, I will make a few 3D games from scratch with C++ so I can understand how a 3D game works, start mastering C++, and hopefully helping with making a game engine. Thanks for all of the replies so far, and thanks in advance for replying to this one.
Was This Post Helpful? 0
  • +
  • -

#11 BBeck  Icon User is offline

  • Here to help.
  • member icon


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

Re: How do i make a Game Engine in C++?

Posted 08 December 2013 - 08:14 AM

If you're looking at making a terrain editor, I might suggest my website and blog. Neither are for C++. The blog is generic and so applies to all languages including C++. The website is currently focused on XNA, which you may not be interested in (quite frankly, there are probably other platforms out there where you could do the same thing). But you probably already have Visual Studio and C# installed. XNA 4.0 is a free download. So, I don't think it would cost you anything to look over the tutorials on my website.

You may not at all be interested in C#, but if you know C++ then you probably already can read 90% of the C# code out there even without having ever learned C#.

Anyway, I spend a lot of time on terrains and kind of the basics of getting started with a 3D world like for an RPG.

What you would do in C++ would be extremely similar. So, I think it's a good place to kind of get started and understanding what it is you need to learn.

A lot of the "tutorials" on my website are code intended to be downloaded and studied. The first tutorial does a lot of hand holding with step by step instructions, but after that, its mostly just code intended to be studied (and well commented because of that). But terrains and skyboxes aren't that different between what you would do in DX as opposed to XNA. The "Terrain Example" under examples in the tutorial section kind of puts it all together with terrain, texturing the terrain, lighting, the skybox, and such.

The blog really discusses the concepts behind making a terrain regardless of what language you're using. Anyway, you might find it helpful.

Alternately, there are several C++ tutorials out there on creating terrains and such.

This post has been edited by BBeck: 08 December 2013 - 08:19 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1