> For the complete documentation index, see [llms.txt](https://steijn.gitbook.io/devlogs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://steijn.gitbook.io/devlogs/blewscreen/extras/advice.md).

# Advice

## Unity profiling

While I was implementing my placement system, I noticed a major issue in the current program. Whenever you would press a key, the fps would drop to around 10. This had to be improved.

After looking into how to use the profiler in [the manual](https://docs.unity3d.com/Manual/Profiler.html), I managed to get it to work. I had to set the profiler to editor profiling and monitored the CPU usage.

The main cause I could find (using the unity profiler) seemed to be a heavy usage of OnGUI calls.

![](/files/WTd5DtPWAHAWT6zxZRUF)

By using the search functions in Visual Studio, I managed to find "TriLibCore" as the main cause. It was in use by our fbx imports so we couldn't remove it entirely. However, removing the OnGUI calls did not have a negative effect after testing the program. So we kept them removed and no longer encountered this issue.

The other remaining performance issues were editor side only. When the game was built, this was not apparent. Other than the editor issue, there is the lack of multithreading causing a freeze. Fixing this issue would be beyond the scope of my project.&#x20;

## Editor performance

The performance issue is caused by the usage of a single canvas which leads to recalculating the entire canvas whenever any changes are made to existing UI objects. Because some scripts get changes based on a keypress, this causes some heavy issues.

If it could be switched to multiple canvases, there would be a large performance improvement.

<https://unity.com/how-to/unity-ui-optimization-tips>

## Theming

After some discussion with the GGZ project, I've noticed there was a lack of themes in the aesthetics. I suggested modeling the aesthetics after the hobbies of the case studies to provide the player with more immersive gameplay and harmonised aesthetics. This advice was well received and will be used while the level designs are made.

## Merging(Git/Gitkraken)

I've advised a co-intern in how to use Git. She was using git bash and was having troubles while merging and keeping up with other people's changes. I helped her use Gitkraken by showing her how to merge with it and how to interpret both sides. This gave her more insights into the current project and helped prevent further issues.&#x20;
