Sign in to follow this  

Where to start with first 3D game

Recommended Posts

Hi,

 

I want to create simple 3D game but I am new in this ambit. I am just learning C++. I know basics about OOP. For modeling I am using blender. Which game engine do you recomended? And any tutorial for game programing in C++?

 

Thanks for answers and sorry for mistakes. My english is weak.

Share this post


Link to post
Share on other sites

I've also heard that UE is C++ based for its scripting and that it's built for 3D and not really 2D. Unity uses C# and Java-script rather than C++ and was built for 3D but also has quite a bit of capability for 2D games. I've used Unity. I've been meaning to learn a little Unreal Engine. These days I'm using raw C++ and OpenGL 4.5 which you may want to consider for learning purposes as well. It's a lot of work to build your own game engine, even a simple/small one. But doing it will teach you a lot about what's really going on in any commercial engine that you use afterwards.

 

The hard part with OGL is finding good lessons on how to use it. LearnOpenGL.com seems to have some really good lessons to get you started on OGL. You will want to use quite a few libraries such as GLFW (to make it cross platform but mostly to prevent you from needing to learn Win32), GLM (for math), GLEW, FreeImage (for textures), and possibly ASSIMP if you don't want to write your own model code for handling models. Quite frankly, I find linking in the libraries to be the most difficult part although I did XNA and then DX11 before this and so this isn't my first rodeo. You pretty much have to get the raw source code on these libraries and make and build them yourself if you want static linked libraries across the board. Some of them have binaries for the libraries you can use. ASSIMP reads several file export formats that Blender will export including the .Blend file. Just realize that these file formats are mostly junk. They are like 90% waste and 10% actual data that you need. All you really need out of them is the data to construct your C++ model object. Starting out, that's just the vertex buffer and index buffer.

 

OpenGL 4.5 with all the libraries you use is actually pretty easy and fairly beginner friendly although you're still doing a whole lot from scratch. It reminds me of XNA once you get a few hundred lines of base code put in place. For learning purposes, that was a great place to start because it meant you had enough foundation that you didn't have to code things like "How to read a JPEG file from binary data and turn it into an actual image".

 

I have the full Visual Studio C++ OGL project posted on my website. That's the start of a super simple game engine that is very reminiscent of XNA. There's even a video there you can watch to see what the code as is currently does without downloading the project to see if it's even something you care to download. The code uses hand coded game models. My next step after getting errors to output to an error log rather than just in the IDE is to get my model class brought over from my DX11 engine. In the DX code, I did my own custom file format from Blender by writing a Python script to export the model data from Blender. Then the C++ reads in the model code from the file and builds the C++ model object. The model class is basically serializable and will write its exact binary data to a binary file that can be used to load the data the next time because the Blender data is a human readable text file and the binary file is far more efficient. I think I even have a C# binary file reader to examine the binary files for what's in them included in the project. The project files for the DX code include everything including the Python script I used to export the raw model data from Blender. The file format supports rigid animation but not skinned animation (yet). (I assume ASSIMP supports skinned animation, which would be a big advantage there. But you need to learn rigid animation before you learn skinned animation anyway.)

 

It's on my too-do list to get all that ported over to the OGL code, if I can ever find time. If you do make use of my stuff, you'll probably want to go through my video series on my YouTube channel. The code uses a lot of matrices and vectors and so having some background in that will help tremendously. The videos should help with that.

 

Anyway, the advantage of an engine like UE is that you can "get stuff done" more quickly and you don't have to reinvent the wheel. The advantage of OGL is that you learn how wheels are made not only from wooden wheels to modern race car wheels, but you learn how to grow the trees, harvest the rubber, and smelt the steel. For a lot of people, that's probably a bit extreme. But if you want to learn to be the best wheel designer, or if you want to truly know all there is to know about wheels, OGL is the path. Even delving into OGL for a couple of years and then using an engine like UE will help you better understand what the engine is doing under the hood where you can't see.

 

You are the only one that can determine which path is the right one for you. I suggest trying both UE and raw OGL for about 6 months each and seeing which you think is best for you. And there are other paths that are good too.

Edited by BBeck

Share this post


Link to post
Share on other sites
You can't go wrong with either Unity or UE4 depending on your preferred language, Unity for C# and UE4 for C++.

However, if you aren't completely confident with C++ and only just know OOP concepts, beware of delving into UE4 source as it's like someone who's only just learned to swim deciding to swim the English channel.

UE4 does strange things to C++ with macros and templates to shoehorn in reflection for blueprints etc. I'm not saying these enhancements are bad, quite the opposite these enhance the language and make certain things easier, but unless you fully understand what they're doing under the hood, you'll be quickly up the poo river without a rowing stick.

Learn as much as you can about C++ before you start out with it in UE4 and stay in blueprints until you fully understand the engine.

Share this post


Link to post
Share on other sites

Btw OGL or Vulkan?

 

avoid vulkan.

 

It's powerful, but its powerful for the same reason assembly language can be considered "powerful" too.

 

Basically, creating a C program using opengl is like learning to drive a car whilst creating the same program utilising vulcan is like learning to extract oil from the sea bed, distill it into usable petroleum, build your car using sheet metal, put your home made petrol in it, and then learn to drive it... if it runs.

 

I'm saying Vulcan is out of the reach of the beginner and more useful for AAA developers. Stick with OpenGL if these are your two choices.

 

Personally i don't recommend either. DirectX 11 is easier to learn in my opinion, nicer documented, less reliant on non-standard extensions, and just as well supported by graphics hardware if not more so. You'll lose the ability to run your code on linux and mac, but in all honesty even in 2016 (nearly 2017) this is a small fraction of the market. You can't count iOS and Android here as they don't use full opengl, and the behavior and design of the systems differs a lot.

 

Hope this is helpful!

Share this post


Link to post
Share on other sites
Unity has a free version which displays a logo. This should be fine for you as a beginner.

UE4 is free for the first few thousand dollars of each quarter in profits, after which you owe a percentage of gross profits to epic games.

Because you're still learning and not releasing commercially this is zero dollars per quarter so it's basically free to you.

Last I heard lumberyard was free but you have to use amazon cloud services for any online content.

Cryengine still carries a small monthly fee.

Share this post


Link to post
Share on other sites

There are a lot of tutorials out there. You can check out C++ tutorials from gamecodeschool.com, cprogramming.com, or tutorialspoint.com.

 

And those were just the basics found in a general Google search. There's a lot out there, you just have to spend the time to look for it and to read reviews by others who have taken those tutorials. I'm sure with a little bit of work and effort you'll find exactly what you're looking for. 

 

Good luck though with this new game design frontier.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this