Intro
So I (ywmaa) decided for some reason to finally start the journey of programming my own game engine.
I am quite new to engine programming, other than some patches to the Godot Engine such as
Vertex shading:
PR: https://github.com/godotengine/godot/pull/83360
Blog Post: /en/blog/update-on-my-vertex-shading-pr/
Blender import geometry nodes:
https://github.com/godotengine/godot/pull/87735
I have very little experience with programming engines.
though, I have a long experience in game development (since Jan 2020), and I actually saw a lot of videos and articles explaining game engines in theory, but I never tried programming one.
Now to the big question
WHY ?
First of all it is for me personally, I love learning what happens in the tools I use, I love to be able to tweak them, I simply love to explore & learn!
secondly, perhaps this will become yet another open source engine (since I am planning on open sourcing it eventually)
Goals
1- Cross platform (meaning windows, linux, macos, android, ios and even web)
2- can be exposed to any language (use C)
3- cross compilation (so I used zig as the build system)
4- easily package your game to all supported platforms
5- focus more on performance & new features than compatibility (Godot already fills the compatibility part)
6- self contained engine (no external libraries unless totally necessary like X11/Wayland) which also means I will do everything from scratch (UI system, platform backends, etc)
extra:
7- Blender’s geometry nodes like system (Procedural Geometry System)
8- Visual Shader system (converts to the written shaders)
9- Import blender files & convert GeoNodes/Shaders to engine’s equavilants
10- Path Tracing Renderer + Raster Renderer (path tracer will be for producing animations & sims, as I plan to use this engine for such applications, and the raster is for the game engine part of course)
Tools & Architecture
languages: C & Zig
C for most of the engine code, this allows the engine to be compiled and expose an API to any language
Zig for the Editor & Game Scripting
future: YScript for game scripting (YScript is a scripting language that I am planning to implement one day in this engine, and the editor of the engine will be able to read/write the script using Node Based Approach -Unreal’s Blueprints like- or just as a script -Godot’s GDscript like- this script will then have two modes:
1- interpreted mode, this mode will always work when working in the editor, for fast prototyping
2- compiled mode, this mode will trigger when you export your game, basically all of the YScripts will convert into zig source files and compile normally with other zig scripts.
Now for the backend: curruntly I plan to support Vulkan & WebGPU.
Vulkan is for best native performance when available on the target platform.
WebGPU to cover all of the other platforms that Vulkan doesn’t.
also I am thinking of removing Vulkan in the future if WebGPU proves enough capability for what I need in this engine.
that’s it, this is the basic principles of this engine.
Resources that helped
Kohi Series: Kohi Youtube playlist
basically I am able to work on this idea due to this series, it helped me understand a lot of parts, and currently my engine is almost just a copy of kohi except that mine has WebGPU backend & Zig Build System
I don’t plan to stay forever on kohi’s way, every time I find something that doesn’t suit me I will just deviate, but currently the series is basically a documentation for my engine, lol, it is actually the opposite.
WebGPU guide for C/C++: https://eliemichel.github.io/LearnWebGPU/
This helped me implement the WebGPU backend.
Current Status
as seen in the article’s banner, I drew a triangle!
WebGPU Triangle!
Vulkan Only clearing the screen because there is a problem with drawing in my code
The Future
as said above my main intention behind it is learning, so I don’t plan to work on it a lot or iterate fast, it will be that project that I tackle in my free time.