top of page

Portfolio

PROJECT

Video Game: Future Football

TOOLS

Plastic SCM, Unity, Discord, Trello, C#, Unity Backend Services, Mirror, UNET.

DESCRIPTION

I am one of the developers working on Future Football. A game consisting of football mechanics filled with special character abilities and skills, plus card collecting! It is a multiplayer mobile game coming Q4 2024. I've done the programming, UI/sprite work, shaders and particles. The other developer is my brother who has done the 3D art side of things.

Our project got approved funding by Prince's trust early 2023 to cover the costs of our backend services (servers etc). 

GENERAL OVERVIEW

  • Multiplayer Unity mobile football game. The multiplayer aspects were originally created with Mirror, but have now switched to Unet to be compatible with Unity's backend socket ports so the servers can scale depending on demand. 

  • Blend tree turning, idle, walk and sprinting animation system, including dribbling, tackling, slide tackling, stumbling, falling over, passing, recieving the ball and shooting. There is another animation which triggers if another enemy team member who owns a ball is close enough, which is called defensive mode, which slows the player down and focuses their rotation to the target player. 

  • A wide range of abilities such as "Swift" a shader for sprinting which highlights the mesh components in a futuristic tone (as seen below), another spell titled "Cannon Shot" which auto targets the ball like a homing missile to the enemies goal, and "Termination Tackle" which sends an engulfing flame wall to the other team player if they own the ball and tackles them, teleporting the ball back to the player who used "Termination Tackle"

  • The game also has a main menu inspired by Timesplitters by Free Radical Design, which uses a curve shader to bend the edges of the imagery and loops the imagery seen in the background. 

  • The main core loop of the game has been completed, players spawn at their respective locations, kick off starts, the timer starts counting down, if a goal is scored the players are set back to their respective locations as well as the ball too. 

  • A few more algorithms are used to create more realism such as the Ball Magnus Effect. The Magnus effect is a phenomenon in fluid dynamics where a spinning object moving through a fluid (like air or water) generates a force perpendicular to the direction of its motion and the axis of spin. This effect is named after Heinrich Gustav Magnus, who described it in the mid-19th century. The Magnus effect is commonly observed in sports, such as when a soccer ball, tennis ball, or baseball curves in flight.

ABILITY: SWIFT

ABILITY: CANNON SHOT

ABILITY: TERMINATION TACKLE

ROLES & RESPONSIBILITIES

  • Design and develop the multiplayer backend services and systems to connect clients to a dedicated server.

  • Concept art of characters.

  • All programming. 

  • Manage meetings and social media awareness.

  • UI design and sprite work.

  • Shaders/Particle work.

TECHNICAL & INTERDISCIPLINARY SKILLS

  • This projects demonstrates a lot of technical skills such as using c#, adhering to coding standards, the use of source control (Plastic SCM), game maths, multiplayer programming, optimisation, testing, debugging, code design, and iterative development.​​

  • I also showcased a range of interdisciplinary skills: excellence in communication among team members; research skills to design abilities that are unique and fun but balanced; problem-solving by retrieving and applying the information required to fix bugs or improve user feedback for my work; collaboration through presenting my work amongst playtesters, interpreting feedback, and clearly communicating ideas and implementation intentions; the use of agile practices by working within the framework and applying iterative and incremental development; version control using Plastic SCM; remote working by using common remote working tools; time management by logging information in Trello and Obsidian, attending meetings, and scheduling work accordingly; documentation by creating a games design document; and project management by using LOF checks, Obsidian and Discord to manage the stages of work effectively.

CONCEPT ART

Here are the concept art pieces I illustrated for two of Future Football's characters.

ALPHA GAMEPLAY TESTING & MAIN MENU FOOTAGE

In this footage you can see the alpha version of the video game played amongst three players in order to gain valuable insights on issues/bugs or suggested improvements.

CODE REVIEW & CHALLENGES

Below discusses screenshots of code and how I designed the systems to create Future Football.

BACKEND - AUTHENTICATION

CODE OVERVIEW

  • SignedIn Method:

    • Retrieves the access token from PlayerAccountService.

    • Calls SignInWithUnityAsync with the access token.

    • Logs any exceptions.

  • InitSignIn Method:

    • Initiates the sign-in process using PlayerAccountService.

  • SignInWithUnityAsync Method:

    • Signs in with Unity using the provided access token.

    • Logs success or any exceptions (authentication or request failures).

    • Displays a notification screen upon successful sign-in.

  • OnDestroy Method:

    • Unsubscribes the SignedIn method from the SignedIn event of PlayerAccountService when the object is destroyed.

  • SignInCachedUserAsync Method:

    • Checks if a session token exists (i.e., a cached user is available).

    • If a cached user exists, it attempts to sign in anonymously.

    • Logs success or any exceptions (authentication or request failures).

    • Displays a notification screen upon successful sign-in.

MAIN CHALLENGES

PLAYER ACCOUNTS & MIRROR COMPATABILITY

While developing the player account systems, I discovered that Unity had introduced a new user account option, allowing the use of Unity Player Accounts instead of third-party services like Google or Facebook. This required re-implementing some code and upgrading to a different Unity version to access the Unity Player Accounts feature. Due to the scarcity of documentation on backend solutions, I had to conduct extensive internet research and perform rigorous testing to make everything work. After successfully implementing the solution, I corresponded with Unity, and they informed me that one of their engineers had commented in 2022 about Mirror potentially not being compatible with their backend services. Consequently, this led to the decision to port the game to Unity's multiplayer solution.

CACHING USERS

I dedicated significant time to optimizing backend server call requests and decided to cache user data to enable automatic login. This not only streamlined development but also allowed for auto-login whenever the project was launched, greatly improving efficiency.

EU NOTIFICATION SYSTEM (LEGAL REQUIREMENTS)

One of the major challenges was complying with the new EU notification law for users. There was limited information available about this legal requirement, and online resources were sparse. Despite the lack of documentation and forums, I spent several days coding to develop a system that notifies users as required by the new regulations.

BACKEND SERVICES

123.png

MAIN CHALLENGES

SERVER FLEETS & SKILLED MATCHMAKING

Setting up the optimal fleet configuration to match the expected capacity per region required extensive research. The initial focus was on determining the number of servers needed within each fleet to maximize cost-effectiveness while ensuring a satisfying player experience. Opting for Linux servers proved to be the right choice in terms of both cost efficiency and performance.

The second phase of research involved ensuring that the matchmaking queues and fleets accounted for players' skill levels. The goal was to minimize waiting times by allowing for a larger skill gap in matches the longer a player waits. This approach helps balance the need for quick matchmaking with fair competition.

MIRROR & PORTS

Setting up multiple servers on a single machine revealed that Unity's Mirror networking solution doesn't work with the port socket system unless the port is 9000. This crucial detail, not mentioned in the documentation, necessitated porting the game to Unity's multiplayer solution to ensure compatibility with the backend services. Reprogramming the entire game's multiplayer code is a monumental task, but I am determined to push through, driven by my passion and dedication to game development.

ANIMATION - BLEND TREES

CODE OVERVIEW

  • Update Method: Handles input, updates the animator, and calls movement and rotation methods.

  • MovePlayer Method: Moves the player based on input direction and speed.

  • RotatePlayer Method: Rotates the player smoothly towards the input direction.

The movement code aligns the player object's forward-facing direction with the joystick input, ensuring that the movement reflects the player's intended direction, thus improving player readability.

Movement values are stored as hashes to enhance performance and are used in the blend tree, which utilizes the "2D Freeform Directional" system. This system allows the animation to blend smoothly between different states—idle, jog, sprint, turning left, and turning right—based on the player's speed and turning value.

123.png

MAIN CHALLENGES

BLEND TREES & FOOTBALL DRIBBLING

I spent quite sometime researching how to get blend trees to look natural whilst also keeping a football amongst range. Many different systems were tested since this was the main component of the game, and had to look as good as possible. 

The endless prototypes: 

The first solution I tried was making a custom spring system where the ball would stay within a certain range and return back to the player, and whilst this was convincing I still believed more could be done. 

The second system that was attempted was a box collider around the player's forward facing area in order to lock the ball within it so it would move more naturally, and whilst not the solution we wanted, it would prove to be useful in later stages. 

The third system implemented was the procedural foot placement with inverse kinematics and the box system, this looked good but still the blend tree for rotations needed implementing ontop of this.

Finally, the solution chosen that was both the most performant and visually appealing. A spring joint is used to connect both the ball and the foot of the player, with the box collider to prevent any mishaps. The distance for the balls limit on the spring joint reduces when the blend tree is rotating the player, in order to connect the ball better visually. This is all synced up with rigidbody interpolation in order to appeal across all networks. 

ALGORITHM - MAGNUS EFFECT

CODE OVERVIEW

The ApplyMagnusEffect method calculates and applies a force to a ball to simulate the Magnus effect based on its velocity and angular velocity. The force direction is determined by the cross product of these vectors, and its magnitude is influenced by the angular velocity and a predefined coefficient. This simulation is crucial for realistic ball physics in games, especially in sports games where spinning balls behave differently due to the Magnus effect.

123.png

MAIN CHALLENGES

RESEARCH

I dedicated time to studying the Magnus effect, drawing insights primarily from the Wikipedia page on the topic. The objective was to understand its core principles and apply them effectively in a practical scenario, simulating the observable phenomenon of a spinning object moving through a fluid.

Key elements of my research included:

  • Pressure Gradient Force: Understanding how variations in fluid pressure around a spinning object affect its trajectory.

  • Physics and Newton's Third Law: Applying principles that govern the interaction between the spinning object and the fluid, particularly focusing on the reactionary forces described by Newton's Third Law.

  • Lyman Briggs Wind Tunnel Experiment: Gaining insights from historical experiments to refine the simulation and achieve a closer approximation of real-world effects.

By leveraging these study points and making necessary tweaks, I aimed to realistically reproduce the Magnus effect within the physics engine, ensuring that the behavior of spinning objects in fluid environments aligns closely with observed phenomena.

bottom of page