If you feel slowness or a lag in your game, or even a crash, it is always best to check your Atlas and Optimize it. If you have too many over sized assets this will clog up your atlases, and may eventually lead to long load times or worse: crash on load on older or weaker devices.
Here is how to do it.
Ideally you want to have between 4 to 7 atlases at most in projects to have compatibility with most devices. We try to keep our own project to 3 atlases max if at all possible.
Importing images to Buildbox
It is a best practice to avoid dragging large size image to Buildbox and scaling it down. In case your image is too big, you can use 3rd party software to minimize its size.
In the illustration below, I was looking for a good background image for my game from Buildbox's Everything Collection and I found this Desert River image.
I right clicked and check the properties and found out that it is way to big for Buildbox.
So to resize it, I opened the image using Microsoft Paint.
Right click on the image> Open with> Paint
And scale it down to 20%
Now the image will fit just right.
Importing solid color backgrounds
When importing a solid color background. It is best to use a small Image and then scale it up to your desired size. That will surely save you tons of space in Atlas.
Looking at the illustration below, I have removed the background and re-imported it to Buildbox to show you how big its original size is.
And we just scale it up by clicking and dragging the points for the image.
And then placing it all the way to the back where it was originally placed.
Collision shapes also play a role when it comes to your games performance, especially if it’s an object that is used very often in your game. Try to use round collision shapes whenever possible. In the illustration below, I used a round collision shape instead of the polygon. It’s OK to use a polygon, just be mindful when a round one will work just as well.
It is also important to keep opacity of images at 100% when possible. This may also affect the performance of your game specially if it is being frequently used.
Particle, Lights and Mirror Effects are cool design to have in our game. It would be best to minimize using them as this can take up a lot of CPU power which will definitely affect your game performance.
Cloning Characters and Objects
There are instances that you will create multiple enemies and platform for your game. It is a best practice to duplicate them by pressing the keys W,A,S & D on your keyboard.
To duplicate a Character, you will have to select the character that you want to duplicate in the assets panel on the left and press D on your keyboard.
I will create another article with in depth explanation about cloning and I will link it here one done.
Removing Unused Sound and Objects.
There are instances that people tend to forget that they have imported sounds and objects that they do not need. It is best to go to Tools>Remove Unused Sound Object once and a while to remove them.
Once a sound file has been imported to Buildbox, it is a best practice to click on the pen icon to show all the sound that has been uploaded and select from there.