I have a few great ideas I want to implement alongside another career path. Where's the best place to start learning how to build an engine?
I'm going to college soon and am probably going to major in organic synthesis. I've always had a vested interest in game development, though, and I have a few ideas for things like multiplayer survival sandbox games with properly balanced persistent progression that I'd love to start making a reality.
I know Unity is the standard place to start out for this, but the performance is awful. If the new path traced global illumination mods for Minecraft can run decently on a GTX 1060 then I'd much prefer to build an engine from scratch with path tracing and near infinite object rendering etc. I've seen a lot of demos for planet-scale voxel based games that render the whole world at once and ray-traced stuff that runs perfectly well on lower end hardware, with engines that people have made themselves.
What classes should I take to get enough of a foundation to start building my own engine?
About this post
- Posted
- Archived
- Score
- 0 · 100% up
- Kind
- Text
- ID
- bavfva
17 comments
I don't want to knock your enthusiasm but don't you think a large number of developers have been involved in designing and implementing unity, it probably is good as it gets (obviously the commercial systems like unreal engine give you abit more but they have take countless years to develop) . Unless you come up with a completely novel approach to designing your engine, you won't achieve your goal.
The skill in game development is to limit what you see as quickly as possible, the less you render the more performent the game.
Unity is good, but it has a lot of overhead that I might not necessarily need and it doesn't have any decent implementation of more modern techniques like path-traced lighting. There are lighting engines written specifically for path tracing that run exponentially better than just cranking up the settings on Unity, for example, and there are more than a few "planet-scale" voxel renderers that display way more detail than a Unity game like Rust with better performance, without employing workarounds like billboards that bring up additional issues with Unity's server-side rendering.
I'd sure like to see that...
Oh geez.
Let me start by saying that building an engine from scratch is something really only done by devs with years of experience behind them. Engines like Unity3D and Unreal are developed by hundreds if not thousands of people with the ability to run on many different kinds of hardware. While building your own engine would probably be more optimized for your game (if you knew what you were doing) Unity3D can work just as well with the proper knowledge. I should know. I once made an entirely 3D mobile game that ran just fine on Unity. Yea it didn't look super amazing but considering the hardware was an 8 year old phone It ran pretty well.
TL,DR. Unity can do what you want. You just have to know how to get it there.
But you asked what you need to learn how to make an engine. Well. I'm not going to collage so I can't help you much with classes there. But there are plenty of videos on youtube that can help you get started. Mastering a code language should be among your top priorities though. I would recommend C as it's one of the more simple ones to learn and a great base to learn C++ from.
Good luck figuring this stuff out. Make sure to work hard and work a lot. Do whatever you have to do to keep your motivation and productivity up otherwise you will never get anywhere. Procrastination will be your worst enemy. Far worse then any bad teacher or annoying engine.
I mean I’m not an expert, but you are right that free Unity cannot be optimized the way a custom engine is that is optimized for a specific game.
But if you pay for Unity, you can get a license that gives you access to the source code, which gives you complete control over the optimization process. I know you said you’re younger, but as mentioned by others, building an engine from scratch is an immense undertaking. I would suggest at the very least prototyping in free Unity first, and worry about optimization after you prototype for a while.
As far as I know, even full studios that write their own engines can still prototype in Unity before committing to implementing an engine.
Hey! I've made my own game engine with a pal in 3 months using c and different libraries.
It's awesome to feel you control everything and have a deep knowledge of all the layers there is. You can literally change anything withing the game and with the engine and you learn a shit ton on the process.
If you aim to become an engine dev, increase your programming skills or just simply want to know how games work in a lower level, be my guest!
If you want it for createing a game, hell no. Everything takes x5 time to implement, you need to also fix other issues that has nothing to do with the game along the way. You don't realize how many little things unity offers until they take it away from you.
If you want to do it with c/c++ I can give you some good recommendations on libraries you can use. Some are used by Blizzard and naughty dog so they are legit good ones and throw some words so you can check what all this is about on google.
Good luck and happy coding!
Thank you! This is by far the best reply. The main reason I want to build an engine is to have more objects in screen space and hopefully some performance friendly path traced lighting. I am eager to get a prototype done though, so it seems like Unity is the best option for the time being.
I'm still very interested in making an engine though. What are some of the libraries you recommend? Do you know of any specifically for rendering lots of objects/trees etc without using billboards, or performance friendly physics libraries?
Okay, here we go.
--> MathGeolib: This library is used to calculate "simple" geometry math. I'm not good at math, don't judge me.
--> PCG: Good random number generator for creating UUID
--> SDL: To handle the assertions and help with OpenGL initialization. This is a standart, like open gl.
--> mmgr: Memory Allocation & Leak Detection if you want clean code and no mem leaks. Great for optimization but will only tell you what is wrong and which lines. You will have to learn how to fix it. But if you want your engine to be optimal, this is it.
--> STL: containers(vector,array,...). C++ bois. Not the best optimal data structure, but does the trick and you can get really good results either way.
--> ImGui: UI interface. We also used the docking branch. This made the interface for the engine 100 times faster. Docking was sponsored by blizzard!
--> DevIL: For Texture and dds rendering for the models. Great documentation out there. You can pretty much copy paste and you will have textures! amazing!
--> Assimp: For reading data from the .fbx format. This is the bread and butter from an engine. Good importaion of .fbx is key. This will let you iterate through a node list and grab all the vertex with their positions. Then with opengl send them to the cpu(hopefully) and render them. Later you can draw those vertex using those positions and opengl. Keep in mind you will need shaders later on so you can send those vertex to the GPU instead since it's way faster and optimal. Every engine works with shaders. We didn't had time to implement it :(.
--> OpenGL: For the render of 3D models and textures. Stay the fuck away from DirectX. Microsoft is literally paying devs to use it but every single one will recommend opengl. It's so much easier to work with.
--> Dirent: For iterating thought the files of the working directory. You don't need this since I've heard win has a library that serves the same purposes. I just wanted file iterators really fast and this is the first thing I found that was easy to implement.
--> ThomasThelen: For Creating a ConvexHull for the Physics bodies of the meshes.
--> BulletPysics: For creating "realistic" physics. Rigid bodies and colliders. This is the thing I was most interested in when building my engine. I like physics. But I end up wasting more time "debbuging" than actually getting shit done. I had a lot of fun tho. Don't regret anything.
Here is the github we used for creating the engine. https://github.com/BooLAW/3DEngine18 It's completely free. Feel free to check it out for learning purposes! Although it lacks documentation and it can be a little bit challenging to understand how it works (if not impossible) there is a video which show what can do at the time. https://www.youtube.com/watch?v=fJ9t72Y9DaE&feature=youtu.be
I've got to echo some.of the other voices in here to some degree in that optimization should not be your first priority. I haven't personally built a game engine, but I have built non-game related software frameworks for high performance computing (we're talking supercomputer level efficiency here). When we develop anything, it starts out as a prototype of an idea. That's the important part. Even if you think your idea is fantastic, you won't know until you have a working, low poly, minimal asset prototype working. Not only will this give you an idea of how good your idea is, it will allow you to iterate on it, and figure out the best way to organize the code itself (you will refactor multiple times before you get a sense of how things should work).
Unity is a fantastic tool for rapid prototyping and figuring out if your idea is even worth pursuing. Plus, it has tons of tools for learning game development and foe programming in general. It's a fantastic place to start and I wouldn't be so quick to turn up my nose at it.
Best of luck.
You're absolutely right, I'm going to spend the summer prototyping something in Unity before I go balls to the wall and try to make a game engine in C. Thank you for the good input. A lot of people seemed to think that Unity was better optimized than something custom made, but you're right that that shouldn't be my first priority to begin with.
That's awesome, and a fantastic use of your summer!
If you're new to programming games in particular, I highly recommend this reference: http://gameprogrammingpatterns.com/ It's totally free, and does a great job of toeing the balance between being technical and easy to read.
Deleted before we saved it.