Liam's 4-In-A-Row

Independant Hobby Project
Windows
Unity
C#

View project on GitHub: 

GitHub Repository

Download from Itch:

Download

Liam's 4-In-A-Row is a naughts & crosses styled game that I am developing as a hobby to learn more about creating multiplayer games and improve my portfolio post-university.

 

This project uses the following Unity packages and other types of work that were not created by myself:

  • Netcode for Game-Objects (Unity)
  • Relay (Unity)
  • Lobby (Unity)
  • Visual effects

  • Audio (Ovani Sound)

  • Good times font

See the project's README for more details.

Why Naughts & Crosses?

I want to create a fun multiplayer game that I can complete as a solo developer. Therefore, I have chosen to use naughts & crosses as a foundation to build upon because it's a popular type of game that has already proven to work well and the simple rules and mechanics make it a good choice for expanding as my first online multiplayer game.

Description Image

New Mechanics

The game introduces new rules and mechanics through optional settings called mutators. By enabling these settings players can collect a variety of power-ups or have board-wide effects applied to all counters. For example, the bomb power-up blows up several counters, while other power-ups allow players to fling counters around and change the rules for placing counters to allow for more ways to play.

User Interface (UI)

Almost all of the game's objects exist on a screen-space or world-space canvas, the only non-UI game-objects are the counters and visual effects.

 

Lobby Browser

I created a user interface for a lobby browser, powered by Unity's Lobby package, so players can search, browse, and host public or private lobbies.

 

Loading screen

The loading screen appears as a simple transition between scenes to mask the application essentially pausing while multiple clients load content separately. It makes use of Unity's network scene manager to ensure all clients see the loading screen appear and hide at the same time.

 

Timeline

The timeline shows a counter for the total turns taken and a series of images that show upcoming turns and other events. Multiple events can be added to the timeline as a single entry, so they all trigger at the same time, such as changing the turn and spawning several power-ups. When a timeline event is triggered all remaining events smoothly move across the screen (events are triggered from left to right).

 

Scoreboard

The scoreboard appears once a match has finished and provides details about each player's statistics during that match, with the best statistic in each category being highlighted. By implementing a scoreboard I learned to share custom data types over a network using the Netcode for Game-Objects package.

 

Menus

The game contains several types of menus such as a:

  • Main menu
  • Lobby browser - search for and create lobbies
  • Match settings - change the rules and objectives of a match
  • Mutator settings - control which mutators will be active during a match
  • Game settings - change various application settings

 

Scrollable Lists

Most menus use a custom prefab for scrollable lists of UI elements, whether they're buttons, text, or images. Scrollable elements are hidden with a mask when out of bounds and scrollbars can be resized to reflect the number of elements within the list.

 

Scaling UI

I have considered how different screen sizes might affect the display of the UI and used Unity's layout components to ensure the UI maintains its intended layout across all screen sizes.

Lobby Browser Menu
Scoreboard
Game Settings Menu

Multiplayer

The game features local and online multiplayer for two players. The online multiplayer is powered by Unity's Netcode for Game-Objects, Lobby, and Relay packages. I chose these packages to help develop the game because this is the first online multiplayer game that I have worked on. Together these packages provide a framework for a lobby system, connecting clients, and sharing data through remote procedure calls and network variables. Some examples of online multiplayer features I have created using this framework are as follows:

  • created a UI for hosting and browsing lobbies
  • shared clients' ready status
  • shared match and mutator settings before loading into an online match
  • handled client connections and disconnections
  • handled disconnecting idle clients
  • synchronised loading screens across multiple clients
  • ensured the host is responsible for simulating all physics-based events
  • shared and synchronised all sorts of data such as game-object states & appearances, timeline events, and match statistics
  • obtained input data from connected clients when they use power-ups
  • both clients returning to the same lobby after they have left the match
Online Match

GitHub

GitHub has been an important asset in managing this project. I used it throughout the game's development to document issues, plan content for the game, and release builds for anyone to play.

 

Planning Board

I also made use of GitHub's projects feature which allowed me to create a planning board for sorting issues when planning what content to work on for current and future updates.

GitHub Planning Board

Other Notable Work

Error Messages

Error messages are displayed in-game...

 

Supporting Different Game Versions

When searching for open lobbies, clients are informed about lobbies that are running on a newer version of the game and don't see those results unless the two versions are backwards compatible.

 

Since the game requries manual updating I created a message that appears if a client can't authenticate with Unity services (intentional when the version's target environment is deleted to control which versions are supported with online multiplayer)

GitHub Planning Board