Tech Art: Unity 2D Assets Management & Unity UI
In recent years, the art of video games has developed so much to the point where video games feel like an almost real experience. The seamless open worlds, complex animation systems, and attractive environments have turned video games into a real attraction for gamers.
Unity is a popular cross-platform game engine used by game artists and game developers. To improve performance, as video game developers, we have to apply in our projects a set of “good practices” which in the long term will save us time, and headaches. It’s not just about doing one thing right, it’s about doing everything the best we can.
This starts to work by understanding how Unity manages the files we load in our projects: meshes, textures, and audio files are converted into something different, and we have to know why.
What do TECH ARTISTS do that are so important?
A short version of what the Tech Artists do: they streamline how art is made and put into the game. In detail, this means that they build tools for artists, streamline the game creation pipeline, make game exporters, make implementation easier, some of them work on the game content and rigging characters for animation. They also structure files, version control support, automation, they make VFX, build interfaces, UI, etc.
UNITY 2D Assets Management
1. Quad vs Sprite Renderer
Sprite Renderer is a very important component to use when developing 2D projects as it determines how the given Sprite is rendered. Also, it’s an essential component for the Tilemap system to work properly. Sprites are generally preferred for 2D games as they can have tighter packing which reduces overdraw on the transparent areas.
Although Sprite Renderer is preferred in 2D games, one of the situations in which a quad is desired to be used is when your image is square and will cover the entire area in pixels.
2. The Overdraw
The overdraw is what happens when we try to draw the same pixel more than once per frame, and is one of the biggest performance problems for VR and mobile games.
Perhaps the simplest and fastest method to get an idea of the overdraw levels in the scenes is to use Unity’s built-in overdraw view mode. There, you can see the highest overdraw in the areas with the most intense colors. Some of those most intense areas you’ll find are probably related to particle effects. If you have a lot of overdraw areas, think about the cause. Most likely those are caused by rendering semi-transparent elements.
3. Batch! Batch! And Batch!
To a Game Object be drawn on the screen, the engine has to issue a draw call to the graphics API (such as OpenGL or Direct3D). But often, with the graphics API doing significant work for every draw call, this process causing performance overhead on the CPU side. To manage this, Unity uses 2 techniques: Dynamic batching and Static batching,
Dynamic batching: for small enough Meshes, this transforms their vertices on the CPU, groups many similar vertices together, and draws them all in one go.
Static batching: combines static (not moving) Game Objects into big Meshes, and renders them in a faster way.
With complex UI systems, it must be assumed that trade-offs between batching draw calls must be done, and both developers and artists must acknowledge the importance of their work to minimize the impact of this trade-off. This is a very complex topic, but we need to understand the basics, especially in terms of mesh generation, sorting, and particle systems usage.
The UI systems rely on quads to generate its meshes, so, this can lead us to an overdraw issue, killing our GPU performance.
By default, Unity renders all UI elements on the transparent render queue. To release the stress of the GPU, avoid transparencies as much as you can (here we can not rely on a mesh to cut the alpha).
The Unity layer system is just a grouping system, used in the input system, camera culling, or gameplay. This will determine the render order of your objects nor in the UI neither in the scene itself.
The Sorting layer system is also a grouping system but in this case, has completely different purposes. The first, as we have seen before is to improve Unity dynamic batching. The second is to sort your assets in terms of rendering, determining what is displayed in front or behind of what.
Particle System is a great addition to your Unity toolkit, it can drastically improve the look and feel of your game. One thing you need to keep in mind is that you have to make your particles able to scale properly regardless of the resolution.
First, you have to decide where these particles will be displayed, if it’s something that will happen on top of everything or otherwise will only appear on a panel of the UI. Once decided, you create an empty object (Always named VFX) on the root where everything will happen, and scale it up around 100. UI is humongous compared to the default particle system size.
This is an easier part. To implement the fonts you want, you can use Text Mesh Pro. It has a lot of options and is very customizable.
The video game development process requires patience and continuous improvement, so if you want to learn more about Unity 2D Assets Management & Unity UI, watch the video which our talented VFX Artist, Iontxu Ocasar, made for you:
In the video games industry, the experience and the wide range of expertise make us a reliable partner for all project components.
Since 2011, Starloop Studios provides premium quality game art and game development services to publishers and game developers. Our team is a tight cluster of seasoned producers, game developers, game designers, and senior artists that are always willing to exceed themselves to deliver incredible services and products.
- Portfolio: Adventure Pop for 505 Games
- Portfolio: Kukouri Entertainment’s Tiny Troopers
- Portfolio: Fieldrunners Attack! for Subatomic Studios
- Portfolio: Heavenstrike Rivals for Square Enix, Mediatronic
Find out more about our end-to-end gaming solutions and how we can bring your vision to reality.
Do you have in mind some ideas for outsourcing your game development? If so, email us at firstname.lastname@example.org. We’d love to hear from you!