Oliver Nyholm
AI and Gameplay Programmer

Perkele Saatana



C++ | Smooth 'em Up | AI | Shitty Object Pool



About the Game


Perkele Saatana was the second game project at the Game Assembly and our first created in C++, using The Game Assemblies Tga2D home engine. It was created over an eight week period, where we were four programmers. Our reference game was the SNES game, R-type 3

"In 1939 the red madman from the east attacked the peaceful villages of Finland... When the delusional madman decided to attack, he did not know of Finlands bravery and fighting spirit.. Nor did he know of "Perkele Saatana"! The super advanced one-man-army aero fighter! Perkele Saatana must push back the madman! ...and put him in his grave!"


My contribution


As we were four programmers, our task force was spread out heavily. In the AI deparment, I created two of the base enemies and first and last boss. Below is a snippet of my first ever object pool, which was created in the BulletFactory class. The CPU's cache memory really loved me after this! I posted it as code if you want to copy paste it if you are inspired by the new operator for each element.

//End of creation in BulletFactory.
for (int index = 0; index < static_cast<int>(arrayOfBullets.Size()); index++)
{
    myBulletQueues.Add(new std::queue());
    for (unsigned short x = 0; x < myQueueSize; x++)
    {
        myBulletQueues[index]->push(new Bullet(*myBulletTypes[index], { 0.0f, 0.0f }, { 0.0f, 0.0f }, this, myEffectsManager));
    }
}
                        


The final boss, called Kremlin, even though it actually is the Saint Basil's Cathedral was tricky and unbalanced. There were a total of 22 different places where the boss would shoot from. In the first phase, the turrets would rotate in an ellipse around the main tower, where sorting their draw order had to be taken into consideration.


The rotation value in the first phase was to determine what position every turret should have. They grabbed their parents rotation and applied it with their own offsetRotation. Then some cos and sin fun stuff.