Pirate Island: Fixing the Frames

So, one of the complaints that I’m getting on Pirate Island is that the game has a poor frame rate.

Addressing this specific issue hasn’t been easy.  But after a lot of trial and error, I’ve narrowed down a number of factors that cause specific latency in the project and have wound up re-coding a lot of the game itself to correct many of these issues.

One thing I discovered is that the seagulls that I had flying around in various locations were just absolutely hammering my frame rate.  I was unaware of just how much the scripting of the birds were taking out of each frame, as I thought they were just animations that there being triggered one after the other.  Turns out that they had a -lot- of different things that they were trying to calculate and determine, ranging from places they could land to collision avoidance as they were tracking each other’s distance and orientation.  So, the bulk of the birds were yanked, replaced by birds that were just preforming set animations (at random intervals) and that they would deactivate if the player wasn’t in the general vicinity or at a place where they could theoretically be viewed.

Another thing that I discovered was that each and every course’s On Trigger functions were firing each and every frame even when the script/course logic was disabled.  This resulted in having to completely re-hash the entire logic of the ball detection routines and manually adjust all 76 courses, for both the main game and the network version.

I’ve created a framerate test branch that I’m now experimenting with and will be moving it over to the main branch once I’m satisfied with the results.

Hope you are all having a great week so far.  More updates to come!