Post 3 – Optimisation


This week I’ve been looking into ways to optimize some of the code within our game to perhaps make it run a little quicker.

The main way I was told when discussed with my group was to avoid casting and instead use interfaces to do their job. According to my peers, casting can be slower if used frequently, so to cut down on it would improve game performance.

I did this by creating an interface so that whenever a cast for the player character would be used, it would run through the interface to return the necessary information instead.

A video discussing this is as follows:

Thanks for reading!