Duality - an easy and fast engine for igrostroy under Windows (Ext.)
Greetings, reader.
This publication will focus on a promising and fairly young game engine that has undeservedly remained in the shadow of such giants as Unity or Unreal Engine.
The developers are an association of enthusiasts led by Adam's Lair.
As the official website tells us: “Duality is a modular 2D game engine that comes with its own editor. It is easily extensible, written in C # and uses OpenGL to display graphics. ”Duality uses a popular component-oriented architecture to write logic. We wrote a component, attached it to a game object, and everything works, completely saving the programmer from routine. Another advantage is the support for plugins, which anyone can create and connect to their projects.
“Classic,” you say, and you will be right. Duality is no worse than other tools, it also takes care of resource management, provides input-output subsystems, graphics, audio and physics simulation. If you add the convenient editor Dualitor to this, you can get an excellent environment for developing indie games.
I think you want to see how it all looks.
Editor. Simple but functional. It shows the familiar Scene View, Project View, Inspector and Camera View. Below is a hidden log panel.
And this is an example of code for a component that controls the movement of a spaceship.
I don’t know about you, but I am pleasantly surprised by the simplicity of this framework. By the way, an indicator of the success of the engine are the games made on it. Since it is used by small teams, the games are not released at the AAA level either. So there’s nothing to brag about yet. On this site you can watch ready-made games .
I also know of one serious project that is currently under development and posted on Steam, but it’s better to write about it another time.
Cross-platform engine is one of its weaknesses. Only Windows family of OS is fully supported, the rest are either supported by third-party developers or not supported at all. There is also no built-in implementation of UI, but since Duality is a modular engine, there are plugins that eliminate this drawback.
The next major drawback will be the network API problem. At the moment, there is no plug-in or kernel module that would implement multiplayer features.
And the main reason why the engine loses to competitors is the small community. There are too few people who are developing this good tool.
In conclusion of this brief review, I want to say that there are many other game engines that may not be inferior to this one and this is good. Of course, I do not urge you to give up everything that you already use, but I present to your attention a quality project. If you are a lone developer or a small team looking for something simple and powerful enough, try Duality.
Official site.
This publication will focus on a promising and fairly young game engine that has undeservedly remained in the shadow of such giants as Unity or Unreal Engine.
The developers are an association of enthusiasts led by Adam's Lair.
As the official website tells us: “Duality is a modular 2D game engine that comes with its own editor. It is easily extensible, written in C # and uses OpenGL to display graphics. ”Duality uses a popular component-oriented architecture to write logic. We wrote a component, attached it to a game object, and everything works, completely saving the programmer from routine. Another advantage is the support for plugins, which anyone can create and connect to their projects.
“Classic,” you say, and you will be right. Duality is no worse than other tools, it also takes care of resource management, provides input-output subsystems, graphics, audio and physics simulation. If you add the convenient editor Dualitor to this, you can get an excellent environment for developing indie games.
So why do I need Duality when there are more extensive solutions like Unity?
- Free of charge (MIT License). You are not required to pay, publish your source code and perform other actions that restrict your creativity. Duality sources are also available on GitHub.
- Lightness. The editor weighs ~ 100 mb, a fully working game weighs ~ 7 mb.
- Performance. In the latest at the moment version v3, a large-scale optimization of the engine has been done. In the tests performed for the estimated workload, the rendering time in the worst case did not exceed 6 ms, and garbage collection was carried out about five times per minute.
- Simplicity. If you are familiar with the same Unity or Unreal Engine, then you can master Duality without any problems. The API is well-documented and provides convenient interfaces so that the programmer is not distracted by low-level operations.
- Community. It may not be counted by thousands of users, but it contains dedicated developers who personally help newcomers to learn the engine. Very friendly and timely. In addition, various tutorials have been created and a forum has been opened that contains a large amount of useful information.
Maybe it's worth a try
I think you want to see how it all looks.
Editor. Simple but functional. It shows the familiar Scene View, Project View, Inspector and Camera View. Below is a hidden log panel.
Dualitor

And this is an example of code for a component that controls the movement of a spaceship.
The code
using Duality;
using Duality.Components.Physics;
using Duality.Input;
namespace Duality_
{
[RequiredComponent(typeof(RigidBody))]
public class Player : Component, ICmpUpdatable
{
public void OnUpdate()
{
RigidBody rb = GameObj.GetComponent();
if (DualityApp.Keyboard[Key.Left]) rb.ApplyLocalForce(-0.001f * rb.Inertia);
else if (DualityApp.Keyboard[Key.Right]) rb.ApplyLocalForce(0.001f * rb.Inertia);
else rb.AngularVelocity -= rb.AngularVelocity * Time.TimeMult * 0.1f;
if (DualityApp.Keyboard[Key.Up]) rb.ApplyLocalForce(Vector2.UnitY * rb.Mass * -0.2f);
else if (DualityApp.Keyboard[Key.Down]) rb.ApplyLocalForce(Vector2.UnitY * rb.Mass * 0.2f);
}
}
}
I don’t know about you, but I am pleasantly surprised by the simplicity of this framework. By the way, an indicator of the success of the engine are the games made on it. Since it is used by small teams, the games are not released at the AAA level either. So there’s nothing to brag about yet. On this site you can watch ready-made games .
I also know of one serious project that is currently under development and posted on Steam, but it’s better to write about it another time.
What you should not expect from Duality
Cross-platform engine is one of its weaknesses. Only Windows family of OS is fully supported, the rest are either supported by third-party developers or not supported at all. There is also no built-in implementation of UI, but since Duality is a modular engine, there are plugins that eliminate this drawback.
The next major drawback will be the network API problem. At the moment, there is no plug-in or kernel module that would implement multiplayer features.
And the main reason why the engine loses to competitors is the small community. There are too few people who are developing this good tool.
Key features of the engine:
- 2D physics based on Farseer Physics Engine. Among the built-in components there is a functional Rigidbody, which covers the basic requirements for physical objects.
- 2D animation using the AnimSpriteRenderer component. Together with a simple user input system, you can easily animate any character.
- Support for vertex and fragment shaders. If this is not enough, then you can implement your own component for rendering.
- Prefabs, including nested ones, so there will be no problems with the procurement of game objects.
- Convenient content manager. Links to resources are automatically maintained and easily used in code.
- TileMaps were created as a separate plugin, but they make excellent use of the engine's features for maximum performance.
- Editor extensibility. You can add your own functionality to the editor, write commands and plugins that will be needed specifically for your tasks.
In conclusion of this brief review, I want to say that there are many other game engines that may not be inferior to this one and this is good. Of course, I do not urge you to give up everything that you already use, but I present to your attention a quality project. If you are a lone developer or a small team looking for something simple and powerful enough, try Duality.
Official site.