Saturday, January 12, 2019

software engineering - What should a game engine do?



I'd like to improve my skills/try something new and I'd like to start with 3D. I have read Starting programming in 3D with C++ but I have question about engines:



  • What should engine do? I know it is abstraction layer above 3D API (i.e. OpenGL or DirectX) but what should it exactly do?



Answer




You're right in saying that a game engine is abstracting away from the low level graphics APIs, but a fully fledged game engine does a lot more.


Game engines are intended to make everything with regards to game development easier. They do each have their own unique features, but generally they provide easy abstraction layers for graphics, audio, input, scene management, collision detection, maths and general useful utilities. Some provide wrappers and plugins for physics APIs and some even have some AI support (mostly limited to FSMs, pathfinding and - the current trend - behaviour trees). A lot of them support, and pride themselves, on cross-platform functionality.


A game engine's purpose is to make it easier for the user to create a game, without having to deal with the small annoyances in creating a game from scratch or having to install a whole bunch of libraries and writing your own wrappers for them to suit your game.


There are a lot of engines out there, but beware of the difference between a graphics engine and a games engine (For example, Unity would be a games engine, whereas Ogre would be a graphics engine).


I've got two books on the subject, but they provide a good overview on the subject:




  • 3D Game Engine Architecture by David H Eberly





  • Game Coding Complete by Mike McShaffry




They're not too in depth as you would need several books on each component to get the depth of knowledge you'd need to create a full, professional game engine, but they explain the concepts very well, I think.


If you're starting out game dev, don't make an engine. I refer you to the following page: http://geometrian.com/programming/tutorials/write-games-not-engines/


Engines are a tricky thing to get right. If you write a load of games, you'll find you have a lot of reusable code after a while which you can use to make your own personal engine to help you out. And having a lot of (complete) games under your belt is a lot more impressive than a single engine.


Hope that helps.


Ray


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...