Info

This post was originally intended for a Patreon audience.

Access Performance

I haven’t been posting very often lately because I spent a lot of work in the last few weeks working on quality-of-life stuff that will indirectly make the game a much better experience. Each improvement didn’t really make a super interesting post, but all of them together make a nice little thing.

Loading Screen

One of the biggest motivations for all of these changes was to improve the performance of the game. Since I wanted to target mobile, this was especially important. The first hitch in gameplay I noticed was when I’d start a dialog with a character. Since I was compiling Rumor scripts on-demand, the game had to pause while that was being completed.

So, I decided to pre-compile the scripts in a loading screen. In addition, I took a look at optimizing the performance of the Rumor compiler. Compilation of one of the scripts from the game was reduced from 6600 ms to just 26 ms, which is a fantastic improvement. Loading screens on mobile devices, such as my cell phone, no longer take a long time.

File Size

File size of the application was also very important to me. This is especially true on mobile, where people have much more limited space than on a desktop. Sadly, Unity is not so great at the file size of the built game. For example, for an empty Unity project, the size is already rather large:

Windows x86       34.3 MB ( 35,998,253 bytes)
Windows x86_64    39.3 MB ( 41,294,893 bytes)
MacOSX x86        44.9 MB ( 47,089,435 bytes)
MacOSX x86_64     45.9 MB ( 48,451,584 bytes)
MacOSX Universal  78.8 MB ( 82,661,106 bytes)
Linux x86         46.1 MB ( 48,395,582 bytes)
Linux x86_64      45.4 MB ( 47,648,929 bytes)
Linux Universal   80.0 MB ( 83,909,100 bytes)
Android APK       21.4 MB ( 22,540,490 bytes)

When you add the size of Access before I optimized it, the size of the application looks rather ridiculous for such a simple-looking game:

Windows x86       51.0 MB ( 53,481,469 bytes)
Windows x86_64    56.9 MB ( 59,767,886 bytes)
MacOSX x86        60.7 MB ( 63,711,723 bytes)
MacOSX x86_64     61.8 MB ( 64,807,359 bytes)
MacOSX Universal  94.6 MB ( 99,283,391 bytes)
Linux x86         61.9 MB ( 65,008,613 bytes)
Linux x86_64      61.2 MB ( 64,261,960 bytes)
Linux Universal   95.8 MB (100,522,131 bytes)
Android APK       34.4 MB ( 36,157,014 bytes)

I took some time to take out things that weren’t necessarily needed and changed lots of Unity settings. The file size of the game is now much more tolerable.

Windows x86       38.8 MB ( 40,777,932 bytes)
Windows x86_64    43.9 MB ( 46,074,574 bytes)
MacOSX x86        49.4 MB ( 51,899,552 bytes)
MacOSX x86_64     50.5 MB ( 52,995,189 bytes)
MacOSX Universal  83.4 MB ( 87,471,216 bytes)
Linux x86         50.7 MB ( 53,202,640 bytes)
Linux x86_64      50.0 MB ( 52,455,952 bytes)
Linux Universal   84.6 MB ( 88,716,124 bytes)
Android APK       22.9 MB ( 24,027,686 bytes)

Hopefully, in the future, I will find more ways to convince Unity to build a smaller application.

Graphics

I also inspected the frame debugger built into Unity and found several rendering problems that caused the game to have a low frame rate on mobile devices. I fixed quite a few problems with too many draw calls and simplified a lot rendering code. The result is that on my mobile device, Access runs rather smoothly now.