Devblog #9 - Optimising to the Gods
Dear Community!
One of our main objectives while creating the game is to allow players to create complex cities that spread over large areas. We want their settlements to look busy and full of life, with a multitude of different buildings and NPCs running around. This may be difficult when our player base has a large variety of different computers, some of them better, others worse. We need to make sure that they all will be able to play the game with no major problems and at least a satisfactory framerate. To achieve that, we decided to use a mixture of techniques.

Every building that players can place on the map is divided into the main mesh and smaller props, which get hidden when the camera moves away. The main mesh has multiple LODs, which lower the number of triangles on the scene by simplifying the shape of the building. Some of them are generated by the engine, while others are crafted by hand to make sure they still have a satisfying amount of detail. Additionally, when objects are placed on the scene they are caught by a special system that aggregates identical meshes to minimize the Draw Calls. This frees the CPU's resources, which are then used to calculate for example the economy among other things.

We use a similar solution when it comes to NPCs assigned to buildings. When the camera moves away, characters stop moving and then slowly disappear once the distance between them and the camera is large enough.
Drawing roads also turned out to be an optimisation challenge. To achieve a good visual effect each tile of the road has to differ from the ones next to it, which forced us to use Decals. On their own, they are not viable on large maps. We solved this by using Runtime Virtual Texture technology. Thanks to it, we are able to design a sheet on which we placed every single terrain texture. Then when roads are placed, only one source needs to be active, even though there’s a visual distinction between tiles.
Citizens of the city turned out to be a challenge as well. To be able to create crowded streets we had to use AI based on HISM (Hierarchical Instanced Static Mesh). It allows us to connect many static meshes into one, which is later on drawn in many different places. This reduces the number of Draw Calls, as information about the texture has to be sent out only once. We use the vertex animation method to move our citizens, so instead of moving their bones, we use information coded into textures to move triangles on of the static meshes. All NPCs have a shared AI, which chooses the starting and ending points of their journey and then sends them on their way.

These are just a few techniques we use to optimize the game and make it run on as many different computers as possible. These technical aspects of the process may often not look spectacular, but without them, the game would never run on even the highest-end computers. Our programmers spend countless hours on these tasks and they deserve their own time in the spotlight. If you have any questions, don’t be afraid to ask, we’ll try to answer.
See you next time
The Devs
One of our main objectives while creating the game is to allow players to create complex cities that spread over large areas. We want their settlements to look busy and full of life, with a multitude of different buildings and NPCs running around. This may be difficult when our player base has a large variety of different computers, some of them better, others worse. We need to make sure that they all will be able to play the game with no major problems and at least a satisfactory framerate. To achieve that, we decided to use a mixture of techniques.

Every building that players can place on the map is divided into the main mesh and smaller props, which get hidden when the camera moves away. The main mesh has multiple LODs, which lower the number of triangles on the scene by simplifying the shape of the building. Some of them are generated by the engine, while others are crafted by hand to make sure they still have a satisfying amount of detail. Additionally, when objects are placed on the scene they are caught by a special system that aggregates identical meshes to minimize the Draw Calls. This frees the CPU's resources, which are then used to calculate for example the economy among other things.

We use a similar solution when it comes to NPCs assigned to buildings. When the camera moves away, characters stop moving and then slowly disappear once the distance between them and the camera is large enough.
Drawing roads also turned out to be an optimisation challenge. To achieve a good visual effect each tile of the road has to differ from the ones next to it, which forced us to use Decals. On their own, they are not viable on large maps. We solved this by using Runtime Virtual Texture technology. Thanks to it, we are able to design a sheet on which we placed every single terrain texture. Then when roads are placed, only one source needs to be active, even though there’s a visual distinction between tiles.
Citizens of the city turned out to be a challenge as well. To be able to create crowded streets we had to use AI based on HISM (Hierarchical Instanced Static Mesh). It allows us to connect many static meshes into one, which is later on drawn in many different places. This reduces the number of Draw Calls, as information about the texture has to be sent out only once. We use the vertex animation method to move our citizens, so instead of moving their bones, we use information coded into textures to move triangles on of the static meshes. All NPCs have a shared AI, which chooses the starting and ending points of their journey and then sends them on their way.

These are just a few techniques we use to optimize the game and make it run on as many different computers as possible. These technical aspects of the process may often not look spectacular, but without them, the game would never run on even the highest-end computers. Our programmers spend countless hours on these tasks and they deserve their own time in the spotlight. If you have any questions, don’t be afraid to ask, we’ll try to answer.
See you next time
The Devs
