Dev Diary: Scanner Rendering Update

by Alex

Agents,

Incoming Scanner Upgrade

My name is Alex, and I’m a Technical Artist on Ingress which is a role that combines skills across engineering, art, and design. My domain is anything graphics-related, but that doesn’t always mean making pretty visuals. My focus is more on optimizing the Scanner for speed and performance.

Ingress runs on Unity Engine. If you’re a game dev using Unity, you might know about the latest graphics change to the game engine, which requires games to upgrade to the Universal Render Pipeline (URP).In the latest update to Scanner version 2.156.1, we upgraded our graphics system to prepare for these upcoming Unity requirements, and used this opportunity to focus on the following goals:

  1. Optimize for Agents’ interaction speed

  2. Improve Scanner performance and stability

  3. Reduce overall battery usage on newer devices

To accomplish this, the team updated how objects on the Scanner are lit to reduce overhead. Several items needed to be rewritten, including the Drone and our Agent Avatars, like Aerodyne. Some items will look slightly different than they did previously, but we made the intentional choice to optimize in order to increase speed for more Agents across more devices. 

Instead of relying on the lighting model, we wrote new shaders to achieve a similar look. For the graphics enthusiasts out there, this is a fun thread about another game that used similar rendering techniques but in a different way.

What does fixing Graphics bugs look like under the hood?

“Pinkgress.” Lots of pink. When it comes to pixels, things like materials, shaders, textures, and animations are what control pixel behavior on screen. When references are broken, it turns everything pink.

Photo of Pinkgress during URP upgrade (very broken)

Additionally, graphics lag happens when the graphics processing unit (GPU) is unable to process the incoming frames at the device’s frame rate. This type of lag might be experienced when there are heightened volumes of Agent activity, like during Ingress Anomalies.

There are a lot of techniques we can do to increase performance gains in graphics. Some examples that made it into the Scanner.

  • Used Object Pooling on Machina portals to enhance map performance

  • Removed the lighting model as described above

  • Updated the rendering asset to disable things like shadows, which aren’t needed for Ingress but are sometimes enabled by default in Unity

  • Greatly reduced post-processing

    • Removed it from Overclock entirely, which should have minimal impact to look

    • Hopefully this fixes the thin glyph line issue experienced by some Android players, but if you still experience this issue after updating your Scanner to version 2.156.1, please make an in-Scanner Bug Report (Settings > GO > Chat with us > Gameplay Help > Report a Bug) and include screenshots.

We also optimized, reduced, and removed specific animations in order to speed up Scanner app startup time as well as many Scanner actions. For example, comparing 2.156.1 to our previous benchmarks across a sampling of Android and iOS devices, we now see the following improvements:

  1. Average Scanner app startup time from cold start is 2.3 seconds faster

  2. Average Drone move time is 1.0 second faster

  3. Average Agent Profile open time is 0.5 seconds faster

Native Refresh Rate

Native refresh rate is the default standard with URP. Instead of being locked into 30 fps, the framerate is whatever is the natural rate of the device. Is that good or bad? It depends. 

Rendering at native refresh rate for the device is generally best for battery life. On an iPhone, for example, it would be better to default to native frame rate to reduce overhead with graphics calls between Unity and Metal (Apple’s Graphics API). Basically, we should let Metal handle framerate natively instead of doing extra work for Unity to throttle the framerate to 30fps, thus reducing Unity calls overhead.

What Does This All Mean?

We upgraded our graphics engine, which usually happens at the start of a game product lifecycle, not the middle. It certainly isn’t a minor undertaking. It means we are investing in the future of Ingress, and Ingress is here to stay long-term.

Will it be bug free? We can’t promise perfection. The reality of Ingress is we are not a large dev team, probably smaller than you might think. However, I hope the Scanner feels snappier with this upgrade and your Ingress play is all the better for it.

Cheers Agents,

— Alex

この記事をシェア