164 points · by guerrilla · 5y ago · 116 comments
And I'm working on my second: http://ahoy.rupy.se
Right now I'm struggling with the fact that I'm not allowed to redistribute cl.exe compiler (I tried real hard: https://developercommunity.visualstudio.com/t/allow-redistri...) so people have to download the whole VS package and extract the necessary files (takes about 2 hours) to get automatic integrated recompile and hotdeploy in my engine.
So I'm looking at going full tinycc and dropping VS all together on Windows. But then seen how they are deprecating my pretty new and probably good forever Skylake on Windows 11 I'm thinking it's over and I should just switch to Jetson Nano but then I'm owned by Nvidia... (Raspberry 4 driver has HALF_FLOAT issues still and well Broadcom... + CPU/GPU balance is off) so I'm kinda loosing hope for humanity at this point!
Risc-V is not progressing hard and fast enough to make it in time!
Edit: Zig, Go, Rust and WASM are not solutions, they are fragmentations. Only C(+) on client and JavaSE (VM and GC) on server makes sense. (Gotta burn that karma somehow right?)
For instance here is Zig as Python package to provide a simple cross-compilation solution for other Python packages that need to build native DLLs:
I'm glad the author learned some things and enjoyed it. Writing your own game engine is a good exercise and I highly recommend it.
But this feels very much like a breakdown of one specific rudimentary engine disguised as an overview of game engines in general.
The biggest thing that bothered me is that there is a huge portion of the engine missing here. He mentions physics, graphics, math (which I see more as a set of helper libraries, not an engine component), but nothing really about game logic, audio, or input.
Every engine I've worked with (or written) has had a lot of its architecture dedicated to these. He does mention entities but nothing about them. I'm a graphics programmer myself but even so this seems the most central system to me. It drives everything that happens. What do the objects represent, how do they behave, how do they interact beyond bouncing off each other.
Without these systems your game engine is nothing but a silent physics simulation without any player input.
Calling the math library a 'math engine' more than bothered me, it is just plain wrong. It's just a few data type classes/structs and the associated templates and code to manipulate them. For an OpenGL game engine #include "glm.h" is going to do pretty much everything you would want in a battle-tested way.
There is so much in here that is inaccurate, misleading and just plain wrong: "To render a pixel on a screen you need to communicate with the GPU. To do so, you need a medium. This medium is called OpenGL." What about WebGL, Vulkan, DX, Metal? What is a medium?
"Scenegraphs are generic trees and they provide a fast way to traverse game entities. You may want to use C++ vector containers instead. This is all right. The problem is that they are too slow to traverse. Thus, if you can, use scenegraphs instead." How is a vector too slow to traverse? If I want to traverse linearly it is pretty much the fastest container. How is the scenography ordered? Is it ordered by an object/transform hierarchy, is it ordered for rendering speed, is it ordered by locality for culling/streaming, all of these?
Why is he inventing terms like the 'engine loop' where most people use 'game loop'?
And yeah, so many missing systems. Even the description of the physics 'engine' misses collision detection.
So great that the author learnt about game engines, but dangerous for them to then present such an incomplete article with such an air of authority.
As someone who's worked with OpenGL since ~ 20 years (and professionally for the last 12 years) I can ascertain that in fact nobody ever gets OpenGL to work right across different platforms. Everybody just puts in enough workarounds and #ifdefs s.t. it appears that it's "write once, run anywhere", where in reality what you write for one set of hardware will almost certainly fail on another (the definition of "fail" here is pretty broad: crashes, weird slowdowns that don't make any sense, memory leaks in the driver, outright non-compliance with the standard, etc..).
The reason is that most vendor's OpenGL implementations are broken in one way or another, particularly on mobile. Vendors treat their drivers like another box to check s.t. they can claim OpenGL compatibility but in reality it's what makes or brakes real world performance (web browsers, games, 2d graphics, etc..). It's astonishing.
>Math Engine >Rendering Engine >Physics Engine
Why do people keep repeating this? A game engine is a monstrous piece of software from which the renderer or the physics is just a tiny part.
Ogre is not a game engine. Unreal, Unity, CryEngine, Frosbite are game engines.
Even implementing a quality renderer is quite an undertaking. Knowing some OpenGL and some basic math is far from being enough. You have to know the graphic pipeline, the GPUs, the CPUs by heart. And be up to date with new techniques employed in graphics, where new things are being discovered daily. You have to read last papers published by Nvidia, AMD and Intel.
I saw many people dabbling with graphics that "built" game engines, when in reality they implemented some toy renderers.
I would be cautious about someone who hardly knows OpenGL teaching others about game engines.
It is like someone learns a few Javascript keywords and starts teaching others compilers.
Including the editor tools and asset pipeline into the term "game engine" has only really become fashionable after Unity became so incredible popular, from that moment on, Unity and 'game engine' became synomymous and everybody else (including Unreal) copied the Unity workflow model. Most of the team works in the integrated editor tool in Unity most of the time, thus the editor tool has become synonymous with "engine" but it is actually the "factory line". But this integrated game development model isn't the only possible model just because it has become so popular.
It's just as well possible to create a mainly "programmer driven" game engine where tools are only used to provide the asset data, but the actual game is fully built in code (IMHO it would be much less confusing if the term 'engine' would only be used for the runtime parts that actually 'drive' the game).
Simple 2D games don't need all the runtime components that a triple-A game needs, yet a game engine for 2D games is just as much a game engine as an engine used for triple-A games.
For things like audio and asset loading, you can get really far building on top of a library like SDL2 or GLFW as a cross-platform system interface, and using some single-header libraries for things like loading models or playing audio samples. There are also great physics libraries out there like Chipmunk or Bullet which neatly encapsulate most of the "hard stuff" in building a game engine.
For something like a 2D platformer for example, it's perfectly reasonable and easier than ever for a solo developer to take on building a small custom engine.
Load("Asset.png");
That wasn't so hard
What you're talking about is a particular type of game engine: a tool with integrated editor, AAA 3D renderer, and which is general-puropose enough to support many different types of games built on top of it. That's a very very narrow way to define game engines, and imo it creates the wrong impression that games are this infinitely complex medium which it takes hundreds of people to work on at the most basic level.
I think the author's definition is also too narrow, but it's perfectly valid to get into game engine development through small toy engines which are built from the ground up by one person.
Maybe it is also worth noting, that there is a difference between a AAA monstrous game engine - and a simple one for casual browser games and the like?
So there might be even value in an article from a beginner covering only the basics?
(but I do agree, that the teaching was in a style overly confident not warranted)
You do not always need a sophisticated assets loading mechanism nor AI modules. Or you need them in a different way, than what the engine provides (mostly my experience).
My point is, "game engine" is not a static universal concept.
Not every game needs a physic engine, for example, nor even assets(I think there are engines for text only rpgs)
(A point where the article is indeed poor)
Is Box2D not a "real" physics engine but a toy physics engine because it's not simulating physics in 3 dimensions?
Games are games and there are a multitude of categories and multiple different dimensions how to judge any particular game or its engine. Saying that something is not a real game engine because it doesn't meet some random narrowly defined criteria is pointless.
If an indie author finishes a game on their own steam, without using a popular decades-old engine, I want to hear how they've focused their perspective to make it work.
(this is the engine the author made: https://github.com/untoldengine/UntoldEngine)
For example, you need exactly none of the things you just described you make Flappy Birds.
Hell, insisting that a game engine isn't a "real" engine unless it can render 3D graphics on a GPU ignores such a huge swatch of games it's hard to know where to even start.
Yet there also exists a sea of inexperienced programmers jumping straight into "engine dev". They have none of the critical production experience which drives quality engines. This flood of enthusistic yet unprepared engineers causes a bipartite population. With the majority of public articles or YouTube presentations coming from those least prepared to speak with knowledge.
If you want to become a game engine dev your first step should be joining a studio as a gameplay programmer. No one wants to use an engine written by someone who does not know how to make games.
A metaverse engine server (probably a whole farm of services) is somewhat like a MMO game server, except that it may have to deal with other similar servers. Possibly untrusted servers run by others, if you allow portals or teleporting or adjacent regions run by different grids. Hard problem. Improbable tried to build such a thing, as Spatial OS, but the end result was really expensive to run and all the games that used it went broke.
Both Tim Sweeney and John Carmack see many unsolved problems in this area. If this "metaverse" stuff survives the hype and the scams and turns out to be important, there's plenty of hard work ahead in this area.
Plenty of engine companies and studios will hire juniors and mid-level engineers into engine teams. And it’s been that way for a long time. And whilst the engine will preferably be made whilst developing actual games using it you don’t need everyone on the team to have been a gameplay programmer. There’s almost too much specialisation required these days and a lot of engine engineers aren’t interested in or good enough at game design to do gameplay roles. What it does need is active feedback from game teams building serious projects.
I’d agree though if you want stability and much less chance of crunch pick a company with a stable income. Engine companies are good for this but there are plenty of others.
I agree with your points on a renderer is not an engine, though.
Even playing sounds and music at the right time will likely trip most people up
And the AI(algorithms) is also a considerable part of the engine? Or does each game develops everything related to the AI from scratch?
For a more code centric resource I would say you could check out the YouTube videos by The Cherno (former EA engine dev).
Rudimentary documentation, but the wiki[2] does a good job of breaking down how each component fits in, including MPC/NPC components, Game Screens, Areas, Animations, Texture Atlases, Sound, Collisions, Physics, etc, all of this using Entity-Component, Factory design patterns.
[1]: https://github.com/UQdeco2800/2021-ext-studio-2
[2]: https://github.com/UQdeco2800/2021-ext-studio-2/wiki/Getting...
Compare with a far more detailed Figure 1.15 [0] from “Game Engine Architecture”.
While it's perfectly valid to use one of the big engines, it's fine even for an indie dev to build their own engine on top of frameworks like MonoGame by e.g. implementing a simple ECS or other components they want to use in their dev workflow. Not every game is a AAA game in need of a cutting edge graphics pipeline.
Some of the most accomplished indie developers wrote their own engines from scratch or used low level frameworks to build them.
I am all for writing your own engine as a learning experience. Most programmers I have worked with have done so.
I am all for sharing your learning experiences in a blog post. A lot of really good blogs do this while being really honest with where they struggled and what they learned. See https://jvns.ca/ for a prime example.
My problem with this post is that it's a post by someone very inexperienced presenting a very shallow and narrow view of what a game engine is in a surprisingly authoritative tone.
If the article would have been "I made my first basic game engine, here's how it's structured" I would have felt differently about it. But this is presented as "this is how a game engine works" and it does not present an accurate image of that.
How exactly is he supposed to change his "tone" so you're less insulted by his "authority"? You do realize that English is clearly not his primary language.
I'm beyond vexed by the number of people slamming the author for his ego, while themselves posting ego-laden responses.
My advice would be not to try to make THE game engine. Making a game with its own engine usually works out OK, if team has expertise, of course.
Like Unity or Unreal, don't try to replicate those, creating generic 3D engine for every game. You don't need to. But it is easy to make 2.5D game with its own engine which would absolutely reck "big guys" in performance and simplicity of use.
Often you'll have a scene graph and an ECS. The scenegraph consists of the entities. Otherwise it can get difficult to do a lot of world scale processing like loading in segments etc..
When I worked in AAA we would get periodical reminders not to mute the game when playing. People still did.
I was actually searching for a good open-source audio library to use, and found out that my options aren't that good. SoLoud is a pain in the ass to install and integrate into an existing codebase, and OpenAL doesn't have any good implementations available (either proprietary or LGPL). I'm now just using a simple single-header audio library in cute_headers (https://github.com/RandyGaul/cute_headers/blob/master/cute_s...), but will probably switch to MiniAudio once the high-level API is finished (https://github.com/mackron/miniaudio/issues/196)
Partially I blame the focus that game marketing and game journalism puts on the quality of the game visuals. If your game's PR media package doesn't have good screenshots, you can pack up and go home. Maybe, the reason for that is that historically, games were marketed by getting articles about them placed in game journals and they could only present images. This has carried over to some extent to the web (screenshots are easier to make and easier on the server bandwidth than gameplay videos).
Engine programmers are even more susceptible to this natural bias because there is a vanishingly small part of engine development that needs aural feedback. It always amazes me how many engine projects have fancy renderers but can’t do more than play one shot sound effects.
This audio bias extends into web video as well. The vast majority of videos get played without any audio.
In (most) engines, however, there are more assumptions baked in, and most things can be accomplished by configuration alone. Writing code is mostly an escape hatch or is required just in few places, instead of being the only way of interfacing with the engine. (Of course that doesn't apply for every engine).
I think a good comparison in the web world would be Hasura. It can do similar things that Rails also does (provide APIs), but in a more limited way, and code is not strictly necessary unless you're doing something that's not standard.