• Register
Post news Report RSS Performance Optimizations and Factions

Some final performance optimizations before taking further steps towards the Steam page. Dive into this update for Assembly RTS, the physics-based strategy game!

Posted by on

Welcome to a new devlog for Assembly RTS, the physics-based real-time strategy game!


(Image created with MidJourney)


Hi everyone, join me in this article about the performance improvements I've made so that Assembly RTS will eventually run perfectly, even on the Steam Deck!
+ some new details on the two distinct factions that will be featured at a later stage in development.

Ever since I released the exclusive footage for perafilazof's showcase it has been clear to me that I need to improve the performance of Assembly RTS before proceeding any further.

As you may remember, I had to take some shortcuts to get important, still missing features into the game before the video deadline. Two of these shortcuts cost Assembly RTS a huge amount of performance.

Everything ground down to as low as 40 FPS on my PC, with less than a hundred active units.
This made it quite tricky to capture usable footage. In the near future, I don't want to face the same limitation when making the Steam page trailer- Let's fix it.

The new Spatial Quadrant System

The first shortcut I addressed over the past two weeks was the unoptimized targeting system.
One important responsibility of the targeting system is to look for units in range of each other.

The problem was that it was not just checking the distance of neighboring units.
Instead, it was checking distance to all other units.
As you might imagine, this quickly spirals the amount of distance checks out of control.
This is called the O-to-the-power-of-N problem.

To solve this, I implemented a quadrant system (also known as a spatial hashing system).
The basic principle is that the world is divided into a 2D grid.
Each unit is assigned to one of these quadrant cells depending on their current position.

This makes it possible to only iterate over units that are in nearby quadrant cells.
In this simplified visualization the bunny is only observed when it's in an adjacent quadrant cell:

GPU-Based Projectiles

The second performance issue I was Unity's old particle system, utilizing GameObjects.
GameObjects are a popular choice for representing 3D objects in Unity.

However, GameObjects come at a performance cost, especially when you create a lot of them.
This is why I generally don't use them for my game.
Instead, I use Unity's new data-oriented-technology-stack's ECS entities which can be much more performant.

As a solution, I even went a step further and used Unity's new(ish) VFX Graph to spawn projectile and muzzle flash particles without any need to spawn new entities.

GPU-based projectile
Unity TmGJgTiCDI


Muzzle flash VFX Graph
Unity OvjvM5ypjq


In the future, this optimization technique could be extended from projectiles and muzzle flashes over to other particle effects I use. For example for the snow dust effects.

Brainstorming 2 Different Factions

For the time being Assembly RTS only features one unnamed faction but in the future it will feature two distinct factions with their own unique traits. Last week I made more progress brainstorming what these two factions will look like on our Discord server-
Carrying over the art assets I've already created into the Legions of Tesem.

VTurjkmzfA vivaldi yoBpSdLrgw

What's Next?

  • Displaying performant texture decals on unit selection
  • Death animations for infantry
  • Brand new textures for the mech

and much more...

vivaldi 6exu361o0b


Join Our Discord Server!

If you are looking forward to the future of Assembly RTS as much as I do,
consider joining our Discord where I post extra sneak-peaks behind-the-scenes.
(+ art, memes and music)

Unity vhyIhfQQ8e

We are a small community of RTS game enthusiasts. I'm always looking for new ideas!

Click Me 2  removebg preview 1

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: