Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


C++ game from scratch in 3d with models


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 Sugavanas   Members   -  Reputation: 200

Like
1Likes
Like

Posted 14 February 2013 - 07:58 AM

Hello, guys, i just wonder how could i make a game from scratch in c++. I know it is easy to make tic-tac-toe and such thin, but how do you make a 3d game. Can anyone show me how ? Or i will give some models and can anyone help me by showing how to do it or is there anothher tutorial out there already ??

Ya, i know, we can use game engines, like unity ce3 or ue3, but still I just want to learn...



Sponsor:

#2 frob   Moderators   -  Reputation: 22201

Like
11Likes
Like

Posted 14 February 2013 - 08:37 AM

It is generally best to start with the basics.

Obviously you will need a good understanding of the c++ language and libraries. It is much better to learn how to use the language effectively by working on many small projects rather than jumping in to the fire with a huge project and no inkling of what you are doing.

Your knowledge of the language and system libraries will need to cover a wide range of algorithms, data structures, containers, serialization, scheduling, and so on. You will probably also want to pick up some audio libraries, user interface libraries, and so on. Just like with learning the language, it is often best to learn these on smaller projects rather than jumping in to a huge project without any prior understanding.

Next, for a 3D game you will need a solid understanding of linear algebra. That is the mathematics of 3D rendering. Usually it is taught at the college level, but some programmers are able to pick it up from web tutorials and such. Again, it is easier to understand matrix and vector manipulations, transformations, topologies, eigenvalue/vector uses, and so on, by learning them on a smaller scale before jumping in to a large scale.

Once you understand the mathematics behind it, you'll need to learn how to implement the math. Usually this takes place by writing your own 3D skinning code, animation code, motion controllers, etc., accompanied by assorted questions about why your 3D model sometimes looks like a pile of exploded triangles rather than the intended shape. It also includes learning to write shaders and particle systems and much more. Just like above, smaller projects are easier for learning.


It is NOT just a matter of a beginner opening a text editor, throwing together a bit of code, and pointing it at a collection of 3D models.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#3 Nusakan   Members   -  Reputation: 444

Like
4Likes
Like

Posted 14 February 2013 - 10:53 AM

As Frob mentioned, aside from C++ you definitely need strong understanding of some linear algebraic terms. However there are more things to cover as well. otherwise it will be just a rendering engine not a game. A game has to be interactive in order to be called a game. for that reason you need some collision detection engine. if you are brave enough to implement that yourself, then you need to learn  math behind collision detection as well.

start with something simple such as AABB vs ray, AABB vs AABB, OBB vs OBB Sphere vs Sphere and so on. You must understand the basics of matrix and vector manipulation before you dive in to collision detection though, otherwise you won't make sense of things.

 

I would recommend following books.

3D math primer for Game development(by Fletcher Dunn & Ian Perberry)

and

3D game engine Programming(by Stefan Zerbst & Oliver Duvel)



#4 BCullis   Crossbones+   -  Reputation: 1813

Like
5Likes
Like

Posted 14 February 2013 - 12:01 PM

Just to highlight a point that I think gets smoothed over in Frob's coverage (no knock to the otherwise great primer on the size of the step you're taking), the word libraries is a huge component.  DirectX (specifically Direct3D) or OpenGL will likely be necessary, as almost no one just straight-codes all the 3d functions and graphics-card interfaces necessary to do 3d graphics rendering.  All the current engines you're referencing use these for their 3d graphics.  Both libraries are still low-level enough that you'll get PLENTY of practice implementing your game-specific 3D tasks.

 

OpenGL and Direct3D have plenty of tutorial series across the web, just google them.  They all rely to some degree on the reader being comfortable in C++ already (syntax and general programming concepts for sure).


Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#5 Sugavanas   Members   -  Reputation: 200

Like
1Likes
Like

Posted 14 February 2013 - 05:25 PM

ya, i just want to see a sample project now, so i can see how they are doing it.



#6 papulko   Members   -  Reputation: 917

Like
1Likes
Like

Posted 14 February 2013 - 06:30 PM

ya, i just want to see a sample project now, so i can see how they are doing it.

 

Like Frob said, trying to grasp the whole concept at once will only result in frustration. 



#7 frob   Moderators   -  Reputation: 22201

Like
0Likes
Like

Posted 14 February 2013 - 11:07 PM

ya, i just want to see a sample project now, so i can see how they are doing it.


Finding source code isn't hard. Just seaarch github for "3d game".

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#8 Yrjö P.   Crossbones+   -  Reputation: 1412

Like
0Likes
Like

Posted 15 February 2013 - 01:03 AM

If you make a 2D game that just uses 3D graphics, the only thing that needs to be different about the engine is the rendering component.
So what you actually need is tutorials to use a graphics interface, not an entire game engine.

These tutorials read very nicely and use modern-style OpenGL. As you can see, model loading comes up at tutorial 7.
http://www.opengl-tutorial.org/

#9 Sugavanas   Members   -  Reputation: 200

Like
0Likes
Like

Posted 15 February 2013 - 01:33 AM

thanks guys



#10 Sugavanas   Members   -  Reputation: 200

Like
0Likes
Like

Posted 15 February 2013 - 06:38 AM

and also atleast give me a source for a begineers to start off

#11 BCullis   Crossbones+   -  Reputation: 1813

Like
2Likes
Like

Posted 15 February 2013 - 08:39 AM

ya, i just want to see a sample project now, so i can see how they are doing it.

Try any of the first tutorials in a series at RasterTek


Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#12 ByteTroll   Crossbones+   -  Reputation: 1464

Like
1Likes
Like

Posted 15 February 2013 - 12:17 PM

Seeing as everyone above me has already given great answers, I will just reiterate.  You need a solid grasp of your language of choice, the libraries you choose (if you choose any), paradigms, algorithms, etc.

 


and also atleast give me a source for a begineers to start off

You really need to use Google and do the research for yourself.  Regardless, this should get you started:

https://github.com/id-Software/DOOM-3-BFG

 

This is the complete source code to Id Software's Doom 3 BFG edition. This contains the entire engine and game code, but no assets.  If you are going to take a look at the Doom 3 BFG codebase, you might also find this code review helpful.

http://fabiensanglard.net/doom3/index.php

~Byte.


▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬
I see the future in 1's and 0's
▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

#13 Sugavanas   Members   -  Reputation: 200

Like
0Likes
Like

Posted 15 February 2013 - 10:57 PM

Seeing as everyone above me has already given great answers, I will just reiterate.  You need a solid grasp of your language of choice, the libraries you choose (if you choose any), paradigms, algorithms, etc.

 

 


and also atleast give me a source for a begineers to start off

You really need to use Google and do the research for yourself.  Regardless, this should get you started:

https://github.com/id-Software/DOOM-3-BFG

 

This is the complete source code to Id Software's Doom 3 BFG edition. This contains the entire engine and game code, but no assets.  If you are going to take a look at the Doom 3 BFG codebase, you might also find this code review helpful.

http://fabiensanglard.net/doom3/index.php

~Byte.


thanks, i had the doom thing before, but i didn't know how to use it, now i just got to know what was the use of it.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS