Ask HN: How to approach making a 3D Game Engine?
I'm slowly reading books, improving my general programming skills in the process (I'm a CS & Math student also working as a developer of educational games in JavaScript using a proprietary engine), but it feels like when I exhaust the general-purpose books aimed at turning me into an all-round better developer (Clean Code, Pragmatic Programmer and Effective C++ are ones that currently have my attention) - I'm left with a giant body of information relevant to the task at hand and no knowledge of where to start.
I want to mess with all the nitty-gritty details, and learn how to write neat, performant and extensible code. Do the math. Do it all.
But I have no focus. All I know is that I want to delve into OpenGL and C++, but I don't really have a clear picture of what should be done with them. What are the basics of engine development that I should start with?
I only have tidbits of information gathered from here and there, but nothing is formed in my brain and it's a bit frustrating.
I'm scared that if I just start with no clear direction, I'm going to end up throwing away lots of code and become discouraged.
Would love to hear your thoughts. Thank you.
13 comments
[ 2.8 ms ] story [ 29.3 ms ] threadHowever I did consider starting out small and making different projects that may accrue into something bigger later on. I feel like my inability to make these decisions really goes to show how lacking in direction I am right now..
In short, to inform and develop a sense of direction.
The transition from 2D to 3D is pretty daunting, though. I do know a thing or two about using a 2D engine (assuming they don't differ that much in fundamental ways) just by working where I do.
Do you think I should stick with 2D engines before going on to develop 3D applications?
http://unity3d.com/learn/tutorials/projects/survival-shooter
Crank out the code for OGRE 3D, Minko, Irrlicht, Torque 3D, and Maratis 3D. Heck, even looking at the code for a 3D game like WakeBreaker (demo game for PowerVR) can give you a lot of insight needed to do what you want to do.
Code reading is a very powerful way to make progress with your goals - and so too, is it good for you to be contributing to these projects wherever you can. I'd suggest a program of discovery whereby you go through these engines in multiple passes - get them all installed/set up, run the demo's, order them by complexity and how much personal effort you feel it takes to gain insight into how they work, and then do another pass from top to bottom on your list, adding features if you can, and so on. In a matter of 4 - 6 weeks of discovery, you can learn a great deal - and may even contribute valuable features/bug fixes too. All too often these engines are fantastic but lack some trimming around the edges - test cases, documentation, sample models, demo games, etc. You can gain a lot of experience by filling in these holes in other peoples' projects, and within a few months you should gain enough of an understanding - if you're serious about it - to venture on your own. But you may find that the existing engines give you what you want anyway .. a way to learn the subject and understand the field productively.
Good luck!
(And in case you're interested in game engines in general - I'm particular enamoured by MOAI, which is 2D game engine albeit built on a core 3D engine - it can do 3D as well, so maybe you want to have a look and see if your interest in the subject can help push MOAI into more 3D-specific territory too..)
At the end of the day I feel like I really want to understand how these engines work, and I felt like the best way to understand that is to create one myself - but I'm not dead-set on that method.