Optimization💀💀💀


Arr!, this update be all 'bout changin' the code, no extra content bein' added to Beak to Beak. I be solely fixin' to make them frames per second (fps) more stable, matey.

To achieve this, I had to do three things, each bein' more challengin', and truth be told, at one point, I thought me problems were due to some cosmic entity beyond me grasp, aye. 

First problem

I'm not the best programmer, and this issue was easy to correct; it was simply time-consuming. I opted to make all my variables static.

Second problem

The map is divided into quadrants, and when a player transitions from one quadrant to another, the game loads adjacent islands and unloads the ones they've left behind. I spent a considerable amount of time, even before I set out to optimize the game, searching for a way to load these islands without causing a drop in the framerate. I managed to minimize the loss to 8 frames per second, but it was still noticeable.

The issue arose when a player crossed back and forth between the same quadrant, as the game would repeatedly load and unload the same island. I resolved this by creating an array to keep track of loaded islands, only unloading islands when this array reached its capacity (typically storing around 5 islands).

However, this solution still presented the problem of an FPS drop when loading a new island. After much head-scratching and attempts with various methods like background loading, I tried something counterintuitive: I loaded everything at once. Surprisingly, it worked. Following this, I embarked on an optimization journey where the loading and unloading of islands occurred solely with respect to the objects. The geometry of the islands was loaded only once at the beginning of the game. Subsequently, when a player crossed into a new quadrant and objects needed to be loaded, the game focused solely on loading the objects without reloading the entire geometry.

Now, when crossing a quadrant, there's only a negligible 1 FPS drop, making it virtually imperceptible.

Third problem (THE PROBLEM)

Read this as an HP lovecraft novel

In my fervent endeavor to vanquish the harrowing specter of perpetually plummeting frames per second, I beheld a terror that transcended the boundaries of comprehension. Each passing minute bore witness to an inexplicable descent, a haunting frame drop of twenty frames per second, ensnaring my digital realm for a full sixty seconds before the veil would lift, once more revealing the promised land of a steady 60 frames per second. The maddening enigma that shrouded this recurring anomaly eluded the grasp of my understanding.

Delving deep into the annals of ancient knowledge, the hallowed tomes, the cryptic codices, and the sacred scrolls, that is to say, the documentation of Godot, my fruitless search yielded no elucidation, no tidings of such an unearthly occurrence. Yet in a dream, a vision unbidden, I was granted insight into the riddle—the monitor of Godot.

In these dreams, I beheld an array of disparate forms that appeared utterly unrelated. It was only when I discerned a common thread woven within the fabric of this phantasmagoria that the elusive answer began to take shape. The enigma, it seemed, was entwined with the very essence of the Physics process, for it was precisely at the juncture of the frame drop that a most sinister spike in physics manifested.

This newfound insight, though a glimmer of enlightenment, left me wandering in the labyrinth of uncertainty, unsure of the path forward. Desperation drove me to meticulously log each node within the hallowed scene, their awakening and the subsequent faltering of frames, yet the elusive specter remained concealed.

It was only when I, in a moment of serendipity, cast my gaze heavenward, that I, in an epiphanic trance, beheld the culprit—a celestial scape, the firmament itself. It dawned upon my consciousness that the alteration of the sky's hue was a resource-intensive ritual, a ritual that devoured the minutes, an entire sixty seconds to be precise.

Resolute and fervent in my quest for a resolution, I hastened to render this cosmic transformation more expeditious, shortening it to a mere matter of seconds. While the lag became inconspicuous, a fleeting frame drop lingered, a specter scarcely noticeable, or so I pray.

Thanks for reading  :D

I have to say that this update broke the first pirate code :(  

Files

BeakOptBeakOpt 00.00.07.zip 38 MB
Oct 11, 2023

Get Beak to Beak Delivery Co.

Buy Now$4.95 USD or more

Leave a comment

Log in with itch.io to leave a comment.