Kaliningrad company HeroCraft continues to share with App2Top the story of how, despite the loss of the license for the famous Disciples brand, it was working on the game Lords of Discord.
As we already told in the previous article, the development of the game under the Disciples brand began 5 years ago. The game has come a long way before it was launched in the App Store (and is now available for open beta testing on Google Play). In this note we will talk about the software component of the project.
Engines
The Marmalade cross-platform SDK was chosen to develop the game on iOS and Android. Ogre 3D was taken as the graphics engine – it is responsible for building a three-dimensional scene.
Example of a 3D scene from the game Lords of DiscordExample of a 3D scene from the game Lords of Discord
Why did you choose these two engines, and not, say, Unity?
Firstly, Ogre, unlike Unity, has open source code, which, as you know, frees programmers’ hands. We have expanded Ogre’s support for texture compression formats, and this has improved performance.
Secondly, Ogre has low–level capabilities: it allows you to control the rendering process at all stages – from arranging 3D models, to working with output triangles and writing vertex and fragment shaders (by the way, it was noticed that on some video cards shaders work so strangely that they can shake the materialistic worldview).
Ogre has a fairly active community: a large number of developers work with it, you can easily find answers to your questions on the forum of this engine. And it’s also free. Well, do not forget that it was 5 years ago.
The server part of the game is developed internally: the game uses the same game server that other HeroCraft games run on.
A significant part of the time was spent working not on the game, but on the resource editor for it. Although at the beginning we considered options for using some existing 3D editor that would allow us to expand its functionality in the direction we need (for example, 3D Max or Blender), but it quickly turned out that the flexibility they provide is not enough. Since the tasks were mostly highly specialized, we realized that it would be optimal to write an editor ourselves to solve them.
Now our own editor allows you to draw landscapes for levels, place characters on them, customize animations, edit the elevation and terrain map.
Screenshot from the Lords of Discord editorScreenshot from the Lords of Discord editor
Screenshot from the Lords of Discord editor
As in any large project, we connected third-party libraries that added the missing functionality: GUI, sound system or particle system.
Despite the fact that this significantly accelerated the development, we are still shedding bitter tears about the choice of some of them, but there is no turning back.
What was refused
Recall: in Disciples, the player has a castle and a squad with which he walks around the map, opening new territories. Enemy buildings can and should be captured and made their own. There are also individual enemies with whom the player conducts a battle. Enemies act the same way: they move around the map, attack buildings and player units, capture land.
When we lost the license for Disciples, among other things, it was decided to change the concept of the game, and therefore part of the code had to be removed. A lot of things have been revised and a lot has been changed. Hence, by the way, our local joke was born: when the programmers of the project communicate with the game designer, an expression called “the muzzles of discord” is read on the faces of all three.
In particular, we abandoned the beautiful terramorfing, which is a repainting of the landscape to match the color of the race that captured it.
Example of terramorfingExample of terramorfing
I had to abandon AI to control enemy units, because this also fell out of the concept.
The changes also affected the capture of enemy buildings – they also decided to remove them.
Challenging and interesting tasks
Programmers especially had to sort out a lot of different options when developing a landscape and tree rendering system. While we were thinking about how to draw a landscape, we chose between a pre-prepared 3D model and a tile landscape with a special mechanism for merging tiles. As a result, a hybrid method was chosen, including a polygonal grid with variable detail, a common color map, mixed detailed textures and additional 3D objects.
To draw trees, programmers and 3D modelers went through a dozen and a half different algorithms in search of the most beautiful and effective. The chosen method allows you to draw bushes and trees and depict them swaying in the wind. By the way, while working on the trees, we came to the conclusion that it is preferable to make Christmas trees: they are arranged easier and are displayed faster. Part of this code was written in a reserved carriage of the Kaliningrad – Moscow train, where one of the programmers was traveling, looking at the endless snow-covered forests of Belarus.
Christmas trees from the game Lords of DiscordChristmas trees from the game Lords of Discord
A lot of time was spent on connecting various advertising and analytical SDKs, the final choice of which is up to our managers and analysts.
And since we use Marmalade, some of them also had to be specially adapted.
Conclusion.
Despite the fact that the developers of the Marmalade SDK are going to stop supporting it, we are ready to make the changes we need on our own. The team has many plans for the further development of the game: the introduction of a guild system, new races, as well as synchronous online battles.
When writing this article, the lights in the area were turned off twice and the Skype server crashed once, but not a single Christmas tree was damaged.