Yousaf Zahir
Computer Scientist 🕹️ The University of Calgary
Welcome to my website, here are links to some recordings of my personal projects.
These links are intended to be used in conjunction with my resume.

THE PROJECTS ARE ORDERED CHRONOLOGICALLY FROM MOST RECENT TO OLDEST.

🐺Kingdom of Predators 2024

    The paper can be requested via email.


          An agent-based emergence simulation of a predator-prey ecosystem made in Unreal Engine 5 with C++ as my final project for CPSC 565: Emergent Computing class. This project was completely planned, designed, and implemented by me. Notably, the creatures' decisions are solely composed of information they can collect. In other words, there is no external data being transferred into the creatures; rather, the creatures are looking and listening to collect their own data. Here’s where the emergence comes in: all the creatures are relatively simple, but as a consequence of many of them acting together, more complex behaviors emerge.

         This project aimed to see whether agent-based simulation could be used to create believable actors and assess the viability of using such a system in games and other simulations. The hope was that emergence-based behavior would prove to be a viable solution for making virtual worlds feel alive and not mechanical. The project was largely a success; however, further exploration needs to be done to assess the viability of such agents in virtual worlds beyond simulation.

         The project was made using Unreal Engine 5 and C++, and no blueprints were used. The StateTrees plugin was used to implement the creature AI.



// Called every frame
void UData::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
    Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

    FVector OwnerLocation = Owner->GetActorLocation();
    FRotator OwnerRotation = Owner->GetActorRotation().Clamp();

    int arrOffSet = OwnerRotation.Yaw;
    directionalArr = &memory[arrOffSet];

    if(lastHit > 0) lastHit -= DeltaTime;

    if (energy > 0) {
        energy -= DeltaTime;
        if (energy <= 0) ProcessHit(attr_health);
    }

    UpdateHealth();


    // Raycast parameters
    FCollisionQueryParams TraceParams;
    TraceParams.AddIgnoredActor(Owner);
    FHitResult HitResult;


    for (int32 i = 0; i < directionalArrSize; i++) {
        // this is used to know the direction of the raycast relative to the owner
        FVector Direction = OwnerRotation.RotateVector(std::get<1>(directionTuple[i]));

        TArray Hits;

        // Perform the raycast
        if (GetWorld()->LineTraceMultiByObjectType(Hits, OwnerLocation, OwnerLocation + Direction * 1000.0f, PawnsAndCorpses, TraceParams))
        {
            int sumOfHits = 0;
            for (auto Hit : Hits) {
                if (Hit.GetActor()->GetName().Mid(0, 12) == "BP_Character") {
                    if (!IDMap.Contains(Hit.GetActor()->FindComponentByClass()->ID)) {
                        IDMap.Add(Hit.GetActor()->FindComponentByClass()->ID, CalcAttraction(Hit.GetActor()));

                    }

                    if (!(Hit.GetActor()->FindComponentByClass()->IDMap.Contains(ID))) {
						Hit.GetActor()->FindComponentByClass()->IDMap.Add(ID, CalcAttraction(Owner));

					}
                }


                sumOfHits += gameObjectToAffinity(Hit.GetActor());

            }

            memory[(arrOffSet + i) % 360] = sumOfHits;

            // update highest if necessary
            if (sumOfHits > highestHit) {
				highestHit = sumOfHits;
				highestHitI = (arrOffSet + i) % 360;
			}

            // Get Play_UI 
            if(seeDebugLines)DrawDebugLine(GetWorld(), OwnerLocation, OwnerLocation + Direction * 1000.0f, FColor::Red, false, 0.1f, 0, 1.0f);

        } else {
            if (seeDebugLines)DrawDebugLine(GetWorld(), OwnerLocation, OwnerLocation + Direction * 1000.0f, FColor::Green, false, 0.1f, 0, 1.0f);
            
        }
    }

    DecayMemory();

}
                        




🌽Pathfinder 2022

         This is Pathfinder, a project I made over the summer of 2022 to learn and implement pathfinding algorithms, specifically BFS and DFS. I had learned them for the first time a a year ago or so and had forgotten them over time. So, I came up with a project to work on which would help me practice and understand the algorithms. The project was made using Unity 3D and C#, and I relearned the algorithms using MIT OCW.





👾KorEscape 2022

The GDD can be requested via email.


         This is KorEscape, a game my group and I made for Art 503 during the Winter semester of 2022. It was made using the Unity Engine and C#. To get a proper breakdown of all the features in the game you can download the game design document from above. All of the programming and implementation (setting up animations, setting up the map layout, etc.) were exclusively my responsibility.





⚔️Untitled Unity 3D Game 2021

         This is a game made for the GDN 2021 Game Jam over the course of 4-days that was actively worked on by myself and one other person in Europe who I met online for the purpose of the game jam. We both worked on it remotely using Unity 3D, C# and GitHub. This was my first time working with another person on a game jam as well as working with Unity 3D.




⚽Fallball 2021

         This is a game I made for the Innovators' Jam 2021, a solo game jam with the theme of "can't stop moving". I designed and developed this game over the course of 48 hours using Unity 2D and C#. This was also my first ever game jam.






You can contact me using my E-MAIL: yousafz1@hotmail.com