Inkomic Tactics · Update
Inkomic Tactics: smoother battles on the web
We found why the browser version froze mid-battle and fixed it: the worst frame went from over a second to 34 milliseconds.
In the browser version, the screen would hitch for a moment mid-battle, especially when attacking. On later levels the freeze could last more than a second. It is fixed now, and here is what was going on.
How we found it
We built a test bench that opens the game in a real Chrome, starts a battle on its own and logs every frame that takes too long. It also logs every time the browser has to build a shader (the small program that tells the graphics card how to draw a material) and how long it takes.
The freezes lined up with the browser building new shaders mid-battle. Comparing their code revealed the cause: GPU instancing, a technique to draw many copies of the same object at once. On the web, the engine builds a different shader depending on how many copies it draws together, and every time a new count showed up in a fight, the browser stopped everything to build it.
What changed
- On the web version, materials no longer use GPU instancing; the engine still batches those objects another way, with no performance loss.
- The battle preload, which draws every effect behind a curtain before the fight, has far less work to do: battles start a few seconds sooner.
- Nothing changes on Android, where there was no problem.
The numbers
In a level 45 battle, the worst frame went from 1.17 seconds to 34 milliseconds, and the browser no longer builds any shader during combat. On level 3 the worst frame is 39 milliseconds.
If you still notice a hitch, tell us the level and your team at games@inkomic.com so we can reproduce it.