Greetings reader.
This publication will discuss a promising and fairly young game engine, which unfairly remained in the shadow of such giants as Unity or the Unreal Engine.
Developers are an association of enthusiasts under the leadership of Adam's Lair.
')
As the official website tells us: “Duality is a modular 2D gaming engine that comes with its own editor. It is easily extensible, written in C #, and uses OpenGL to display graphics. ”A popular component-oriented architecture is used to write logic in Duality. We wrote a component, attached it to the game object and everything works, completely saving the programmer from the routine. Another advantage is the support of plug-ins that anyone can create and connect to their projects.
- Classic, - you will say and you will be right. Duality is not worse than other tools, it also takes control of resources, provides input-output subsystems, graphics, audio and physics simulation. If you add the convenient Dualitor editor 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 (MIT License). You are not required to pay, publish your source code and perform other actions that limit your creativity. Duality sources are also available on GitHub.
- Lightness The editor weighs ~ 100 mb, fully working game weighs ~ 7 mb.
- Speed ​​performance In the latest at the moment version v3, a large-scale optimization of the engine has been done. In the tests performed on the expected load, the rendering time in the worst case did not exceed 6 ms, and garbage collection was performed about five times per minute.
- Simplicity. If you are familiar with the same Unity or Unreal Engine, then you can master Duality without problems. The API is well documented and provides convenient interfaces so that the programmer is not distracted by low-level operations.
- Community. Perhaps it is not in the thousands of users, but there are dedicated developers in it who personally help newcomers to master the engine. Very friendly and timely. In addition, various tutorials have been created and a forum has been opened which contains a large amount of useful information.
It might be worth a try.
I think you want to see how it all looks.
Editor. Rustic, but functional. It shows the familiar Scene View, Project View, Inspector and Camera View. Below is a hidden panel logs.
And this is a sample code for the component that controls the movement of the spacecraft.
Codeusing 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<RigidBody>(); 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 do not 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. So there is really nothing to boast about.
On this site you can see the finished games .
I also know of one serious project that is currently under development and posted on Steam, but it’s better to write about this another time.
What you shouldn’t expect from Duality
Cross-platform engine is one of its weaknesses. Only the Windows 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 the UI, but since Duality is a modular engine, there are plugins that eliminate this disadvantage.
The next major drawback is 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 a small community. Too few people who are engaged in the development of this good tool.
The main features of the engine:
- 2D physics based on the Farseer Physics Engine. Among the built-in components is the functional rigidbody that 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 vertex and fragment shaders. If this is not enough, then you can implement your own component for rendering.
- Prefabs, including nested ones, so that problems with the procurement of game objects will not arise.
- Convenient content manager. Links to resources are automatically maintained and easily used in the code.
- TileMapes were created as a separate plugin, but make great use of the engine for maximum performance.
- Extensibility Editor. You can add your own functionality to the editor, write commands and plugins that will be needed exactly 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 and this is good. Of course, I do not urge you to abandon 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.