4 ms·
From what I've heard and experienced, you need at least the following knowledge to create a good game engine: - Understanding of modern CPUs / GPUs and the cap
by lasagnaphil 8y ago
From what I've heard and experienced, you need at least the following knowledge to create a good game engine:
- Understanding of modern CPUs / GPUs and the capabilities/shortcomings they have
- Understanding the behaviors and quirks of the OS
- Familiarity with multicore programming
- Skillful memory management (such as making your data structures less prone to cache invalidations)
- Mastery of a low-level language (C++, Rust, whatever)
- Familiarity with build systems (CMake, SCons, etc, ... or sometimes you might have to roll your own)
Already I could see the number of contributors who would know all this stuff being pretty low. (I've dabbled a bit in graphics and made a simple OpenGL scene graph renderer and a fluid simulator, but I still don't feel like I'm competent enough...)
An engine is comprised of multiple components (Graphics, Sound, Physics, etc...). So you wouldn't need to know all of it, but contributors would need to have a clear grasp on at least one. So for each component, you would need...
- Entity System: You need a universal way to handle game entities. Implementing it efficiently requires a good knowledge of computer systems, because you need to think carefully about how you store data in the memory.
- Job System: You need a system to execute various tasks (rendering, physics, game logic, ...) simultaneously on multiple processors, so that a single game frame can finish in less than 16 milliseconds. Implementing this would require some knowledge in concurrency as well as OS concepts.
- Resource Management: You need a way to store and keep track of the game's various data stored in files, such as images, models, sounds, game objects and their parameters, settings, etc. You need to implement efficient serialization and compression for this.
- Graphics: Mastery of a graphics API (OpenGL, DirectX, Vulkan), and understanding its various patterns and shortcomings. You also need knowledge in how rendering works (which also requires some math), and nowadays a PBRT renderer (https://www.pbrt.org/ https://www.pbrt.org/) is basically a minimum requirement for modern 3D game engines.
- Physics: Lots of math and physics (Linear Algebra, Differential equations, Mechanics, etc.), and also optimization skills like assembly and SIMD (speed is critical in this area!). Fortunately many people just use already-built middleware such as Havok or Bullet..
- Sound: This is actually the most neglected part in game engine development, and it is hard to find good resources on this.
I think the people who would have the knowledge to build a game engine would be already busy working on other stuff, such as working for an AAA gamedev company (which sometimes does a lot of crunch, so they might not have enough time for open-source stuff), or a proprietary game engine company like Unity or Unreal. But I still see some hope around the edges. From what I've seen, Handmade Hero (https://handmadehero.org/ https://handmadehero.org/, which is a livestream of making a game engine from scratch, accompanied with various education materials) is the most impressive. It tries to teach those skills needed to make a game engine to interested programmers, which I think is a crucial first step in encouraging open-source gamedev.
- AHTERIX5000 8y ago...and you need tools and editors to make the content for the engine in proper format. That is the "boring part" OSS projects usually lack since writing renderers and job systems is much more fun than fighting with inconsistencies in scene formats or writing custom importers.
- dkersten 8y agoCreating a high quality game engine is by no means an easy task, but you don’t need each contributor to know all of these things and you can use existing libraries for a lot of them. A lot of the things you mention have good quality MIT-licensed (or similarly liberal license) libraries you can use to save time. Its still going to be hard, but its not thaaaaat inaccessible. Some examples: for entitiy systems, EnTT is amazing. For a job system you’ve got stuff like cpp-taskflow, for physics there’s bullet, for graphics there’s bgfx or full blown renderers. Sure, these won’t solve all of your needs, but they’re a good starting point that frees you from having to do a lot of stuff yourself.