background

Diamond Engine

C++/C# Game Engine



All about Diamond Engine

Diamond Engine is a lightweight 3D (and future 2D) game development engine. This engine was developed as part of a college assignment. The engine supports almost every editor feature that you could expect from a game development engine, but the most relevant feature is the added support to interpret and work with C# code on a component-based GameObject system.

The C# implementation was mainly focused on making it as fast and reliable as possible. This implementation uses the mono runtime working with JIT to execute C# code at runtime. With this implementation and the app-domain system, it is also possible to recompile code at runtime to make the iteration time as fast as possible.

Apart from the performance and reliable dynamic memory management, the engine is also focused on being visually attractive to the users. Also, new features are being added to make the engine able to generate bigger and better games.


About me

Hi, I'm Mayk. I'm the only developer involved in the "Diamond Engine" project and I've been working on it since early 2020.

I've been coding and making "games" since I was 14 and when I saw a chance to start developing my engine I tried my best to do something I could be proud of. My first contact with the Game Development word was thanks to the Unity Engine, and I always wanted to know how it was made.

Working on Diamond Engine was and still is, the better way for me to learn new things, and I enjoy 3D math and coding so it was perfect. I think this engine reflects what I'm capable of as in 2020, and I plan to get better.

Here's my LinkedIn page if you are interested in some of my other work.

linkedin-image

All my other projects can be found in my GitHub page or in this portfolio display.

portfolio-image

Core Sub-Systems

There are more sub-systems to talk about, but those are the most relevant ones.


C# Sub-System

As mentioned above, Diamond Engine has a C#/Mono implementation, making it perfect for faster code iterations.

This implementation makes heavy use of extern methods to send and receive data from C++ and C#, which are connected.

One of the biggest performance optimizations was achieved by sending C++ pointers to the C# objects as UINT64 values, and then, when we need to retrieve some data from C++ to use on C#, we just have to send and cast that pointer UINT64 to C++ and then send the data that we need to C#.

As trivial as this may sound, this small detail reduced considerably the C++/C# communication time, which also made Update times a lot faster.

A simple exception handling system was also added. The display fields are saved and serialized and will auto-fill on scene loading. Mono also generates 0 memory leaks and creates almost no increment on memory usage, even when spawning new objects.

Scripts created via the Assets window will be automatically added to the Visual Studio solution. This also allows the user to iterate faster with the hot-reloading system.

On the left gif we can see a script being modified via Visual Studio and how it hot-reloads when we focus back on the engine. Also how the variables are changed in the inspector.

Also, on the right gif we can see a script being created from the engine and how it hot-reloads to add itself to the solution. We can also see the simulation in action.


Workflow video


Licence

AGPL-3.0 License

Diamond Engine, lightweight 3D game engine software.
Copyright (C) 2020 Miquel Suau Gonzalez.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://github.com/MayKoder/Diamond-Engine/blob/master/LICENSE.

Contact:

Page designed and created with HTML, CSS and JS by Miquel Suau Gonzàlez

©2020 Miquel Suau Gonzàlez (@MayKoder)
All Rights Reserved.