18 Optimization Techniques for Mobile and VR

Contents

INTRO

  1. Thou Shalt Remember the Goal
  2. Thou Shalt Know Thy Polybudget
  3. Thou Shalt Know Thy Bottlenecks
  4. Thou Shalt Have One Mesh to Rule Them All
  5. Thou Shalt Keep Your Textures Svelte: Keep
  6. Thou Shalt Bake Thy Lights
  7. Thou Shalt Use LODs Wisely and Sparingly
  8. Thou Shalt Cull!
  9. Thou Shalt Throw Shade(rs)
  10. Thou Shalt Profile
  11. Thou Shalt Optimize Scripting
  12. Thou Shalt Test and Version
  13. Thou Shalt Recycle!
  14. Thou Shalt Fake it Rather Than Make it
  15. (VR Specific) Thou Shalt Not Be Transparent
  16. (VR Specific) Thou Shalt be Even Stringier than Instructed
  17. (VR Specific) Thou Shalt Keep Thy Shadows Light
  18. (VR Specific) Thou Shalt Not Make Thy Players Hurl

 

 

 

INTRO

Imagine! You just got done producing game assets that could set the red carpet on fire with their gorgeous looks and polish. But oh no! The engineering team kills your buzz, saying you can’t use them or the game will instantly trip and fall. Villains! And yet you can’t ignore them because the last thing you need is a wardrobe (or game) malfunction on the red carpet.

 

You’ve just produced some very expensive, very heavy digital paperweights.

 

I’m sure every artist and producer has gone through this terrible feeling in their early days.

 

But it’s not all doom and gloom! Asset optimization is a thing! It’s like oxygen for mobile and VR games. You don’t particularly notice it when it’s there but its absence can be sickening (literally at times). It allows you to make a head turning, smooth-playing game. And I promise you won’t turn grey by the time it loads.

 

So what makes VR/Mobile optimization so tricky? Well, simply put, the hardware powering your mobile/VR device isn’t as powerful as it is in PC or consoles. It needs to get a lot of visual bang for its resources. And this optimization jungle gets even twistier when you have a cross platform game.

 

Confused? Don’t be! We have an optimization ninja sensei who can teach you the basic defense tactics you need to not fall flat on your face in asset optimization. Right here, right now, in this article.

 

Without further ado, grasshopper, let me introduce our Art Director, Adnan Ayub. He’s been optimizing assets since Saving Private Ryan came out. (Look up when that was, you may be surprised) He’s the man behind projects like board-game-turned-RPG Dungeon Lords, remaking the beautiful interactive environments of Geve for VR and creating training simulations for Leica geosystems.

Are you serious about wanting good looking assets without setting the user’s device on fire? Then listen up!

  1. Thou Shalt Remember the Goal: This may sound obvious, but stop skipping ahead. Write this following statement out and stick it on the forehead of the coworker who sits across from you: The goal of optimization is to reduce the per frame cost as much as possible both for the CPU and GPU.

 

  1. Thou Shalt Know Thy Polybudget: Maintain a target FPS and polybudget for the entire game. This number will be critical from the very beginning to the very end. What style should we use? How many characters can we have? How detailed should each environment be?  Know that every decision has an implication for your Polybudget. This number is the Testament. Do not cross it.

 

  1. Thou Shalt Know Thy Bottlenecks: It’s important to identify where the bottlenecks lie and optimize those areas first. Performance issues are generally related to two types of hardware: CPU and GPU. Normally, the CPU is more involved with logic, populating the scenes and managing the states while the GPU looks after the texture sampling, shading, rendering etc.

 

  1. Thou Shalt Have One Mesh to Rule Them All: Having multiple meshes within single objects is a performance murderer. Try to keep one mesh for per object wherever you can.Also, combine meshes/textures where possible to reduce performance load – it reduces draw calls.

 

  1. Thou Shalt Keep Your Textures Svelte: Keep the texture map size as low as possible depending on where they are on the screen and how often they’re seen. For objects that are permanently in the far distance, for example, texture sizes can be significantly lower. Bonus tip: it’s common practice to use texture formats that support MIP texture maps. Having multiple sizes of textures within an image means you can pick the appropriate one based on the distance from the camera. Some game engines do this automatically so go through your engine documentation first.Texture aliasing is also an effective technique to optimize the number of draw calls and therefore the memory used – it involves combing the textures of different objects that use the same material.

 

  1. Thou Shalt Bake Thy Lights: Light baking is a common technique that saves a TON of resources by pre-calculating all the real-time lights onto textures directly. Almost all game engines offer this feature. If resources are a concern, always use light baking, especially when it comes to large game levels with lots of lights involved.

 

  1. Thou Shalt Use LODs Wisely and Sparingly: LOD is the Level of Detail of a given game object. This technique is used by game engines to reduce performance load by switching between different levels of detail objects for each asset in the game based on the distance from the viewer. Reserve it mostly for large scenes with lots of objects. Using this on small scenes can cause performance load. In a small room where all objects have the same distance relative to the viewer, it’s not effective to use LOD objects.

 

  1. Thou Shalt Cull!: Object culling is an effective technique where the camera does not render objects behind other objects. So do a proper setup for object culling based on your game engine settings. In large scenes object culling is a life saver.

 

  1. Thou Shalt Throw Shade(rs): Generally, opaque shaders are lighter than transparent ones so keep the number of transparent shaders as low as possible.

 

  1. Thou Shalt Profile: Unlike the nasty business at airports, profiling is great in games! It’s used in game editors/engines to identify any indicators that are causing spikes in performance and lowering the FPS. After identification, go in hard and get the culprit. Bonus tip: if your scene is running fine in the editor but sluggish in play mode then the most probable suspect is scripts. But if the opposite is true, individual game objects in the scene probably need optimization. To identify individual assets causing FPS drops turn each object in the scene on and off while monitoring the profiling graphs.

 

  1. Thou Shalt Optimize Scripting: Hate to break it to you, but this involves a thorough investigation of the game code architecture and removing or replacing the problematic parts in the scripts. Sorry. No easy skip here.

 

  1. Thou Shalt Test and Version: Optimization isn’t something you do at the end of a project, if you’re smart. If you test throughout, you can identify issues as soon as they arise. Trying to fix 6 months worth of errors at once is like looking for a nausea inducing needle in a haystack, in the dark, at zero gravity. It’s not fun.

 

 

  1. Thou Shalt Recycle!: Develop a plan in advance to re-use as many models, materials/textures as possible. Set up rules based on the initial planning and decided draw call limit for how many polygons a mesh can have and how many materials a mesh can use. This is helpful in handling the performance in early stages.

 

  1. Thou Shalt Fake it Rather Than Make it: Don’t be tempted to bust your polybudget to add visual flair. Use techniques to fake the visuals. Like, instead of using real-time shadow, fake it with a soft texture blob beneath character. Think of VR content building in terms of early 3D development for mobile devices.

  1. (VR Specific) Thou Shalt Not Be Transparent: Use transparency only where it’s really needed and wherever possible try to fake it. You’ll thank me later.

 

  1. (VR Specific) Thou Shalt be Even Stringier than Instructed: Make sure that you always have extra buffer over the one recommended by the Head Mounted Display manufacturer. This keeps the frame rate in check. HMD Systems are technically rendering two cameras simultaneously, so these systems require really hardcore optimization practices and disciplines. TIP: graphical styles with simple details and shaders and few polygons can often give as convincing a VR experience as realistic graphics that have a much higher rendering cost.

 

  1. (VR Specific) Thou Shalt Keep Thy Shadows Light: Large scenes populated with tons of objects have a considerable resource cost when using real-time shadows. Optimize shadows as per the documentation of the editor you are using. For example, in Unreal Engine, consider limiting the Cascades as they can cost a lot of bandwidth Use fake shadows wherever possible

 

  1. (VR Specific) Thou Shalt Not Make Thy Players Hurl: Nausea is a common problem ruining the VR experience. But we’ve got it covered!
  • Test with a variety of users and don’t rely on developers for simulation sickness test as developers tend to be used to VR headsets, and so experience less sickness compared to the general user.
  • A mismatch between the field of view of the camera and the device’s recommended value can also cause discomfort. Use the recommended field of view value from the headset. It’s best to use automatic settings from the SDK.
  • Walking Bob effects for camera are not recommended in VR as they cause motion sickness.
  • Ditto for camera shake effects.
  • Similarly, don’t have your avatar use the stairs as moving up and down quickly can also cause sickness. Instead, use lifts and elevators where applicable.
  • Ensure player speed is constant. Gradual acceleration after starting is a bad idea here.

Thanks Adnan! So, are you feeling more hopeful you can have great looking assets in mobile/VR games? Don’t let the limitations of their hardware stop you from getting what you want!

 

 

Go ahead try these techniques in your next game. They’ll do wonders!

 

And if you have a project in mind that’s you know is going to be a beast to optimize but aren’t quite sure what it’ll take, there’s no need for guesswork. Fill out the form below!

 

Estimate My Project!
We'll never blab about your ideas, but you're always within your rights to request an NDA!
Add Comment