Platform
Docs
Solutions
ContactLog In

Start Routing Notifications Today!

Courier is a notification service that centralizes all of your templates and messaging channels in one place which increases visibility and reduces engineering time.

Sign-up

Package Person Header Image
NOTIFICATIONS LANDSCAPE

How to Use Notifications to Build a Game in 36 Hours

Aydrian Howard

June 24, 2021

Back in April, Courier sponsored the Bitcamp Hackathon from University of Maryland. It was a 36-hour hackathon and it produced one of the most interesting projects we’ve seen out of a Hackathon. Matt Graber, a new grad, created a game called Package Person with a very interesting use of Courier. The game’s objective is to deliver as many packages as possible to the package drop locations in front of the houses while avoiding the dogs that chase the player.

Let's dive into how Matt got the idea for Package person, how he built it with Courier as a part of his suite of tools, and his reflections on the project.

Planning the Project

Since the 2021 Bitcamp Hackathon would be the last of UMD senior Matt’s career as an undergrad, he was committed to finishing a project and hopefully winning something in the process. He had done hackathons several times in the past, but this was his first time doing it without a team. So finishing a project of reasonable quality by himself was the main challenge and primary goal.

Matt's game development experience began when he joined the UMD AR Club during his freshman year, which later became the XR Club after merging with the VR Club. Throughout his time with the AR/XR Club, he learned and taught other students how to use the Unity game engine to create augmented and virtual reality experiences, which often took the form of games. His initial knowledge of Unity came from that experience, and he used those skills to start making more conventional games in my spare time.

Having had the time to develop these skills, Matt was inspired to build Package Person because of his experiences during the Covid-19 pandemic. He had been making games to pass the time with his roommates and during lockdown, they started hosting mini 4-hour hackathons that they called “game jams“ among themselves with some of their other friends as judges. Predictably, they got pretty good at quickly throwing together simple games using Unity.

The Development Process

The game’s objective is to deliver as many packages as possible to the package drop locations in front of the houses while avoiding the dogs that chase the player. The trick is for the player's top speed to be faster than the dogs' except when the Package Person is carrying a package. Upon losing, the player is brought to a leaderboard screen with the option to enter their contact information to be notified of any changes in their position on the leaderboard.

Initial Leaderboard

Package Person was developed in the Unity engine, which uses C# for scripting. For the notifications, Matt used Courier with Twilio and Mailjet as sending providers. He created the Package Person using Adobe Fuse (which is no longer supported) and rigged and animated it using Mixamo. The other 3D assets were free from the Unity Asset Store.

An auto-generated C# code-snippet was not provided by Courier because it does not yet have an SDK for C#, unlike other languages such as Python and Java. However, Matt says he found this to be more of a minor inconvenience than anything else. He instead used the Unity API’s built-in web request system to send a POST request with the necessary information. This produced the same result as the Courier SDK would have been able to do for other languages.

1
WWWForm form = new WWWForm();
2
form.AddField("event", "9GRDXE7RJZ42MSM12A87H4X3JCDC");
3
form.AddField("recipient", players[i].recipient_id);
4
form.AddField("override", "{}");
5
form.AddField("data", "{\"playerName\":\"" + players[i].playerData.playerName + "\"," +
6
"\"score\":" + players[i].playerData.score + "," +
7
"\"currentPlace\":" + players[i].playerData.currentPlace + "," +
8
"\"previousPlace\":" + players[i].playerData.previousPlace + "," +
9
"\"beatBy\":\"" + beatBy + "\"," +
10
"\"beatMessage\":\"" + beatMessage + "\"," +
11
"\"deviceName\":\"" + dataManager.GetDeviceName() + "\"}");
12
form.AddField("profile", "{\"email\":\"" + email + "\"," +
13
"\"phone_number\":\"" + phone + "\"}");
14
15
using (UnityWebRequest www = UnityWebRequest.Post("https://api.courier.com/send", form))
16
{
17
www.SetRequestHeader("Authorization", "Bearer " + Auth.CourierKey);
18
yield return www.SendWebRequest();
19
20
if (www.result != UnityWebRequest.Result.Success)
21
{
22
Debug.Log(www.error);
23
}
24
else
25
{
26
Debug.Log("Form upload complete!");
27
}
28
}

Full Code

The games Matt and his roommates made included leaderboards that were limited to showing scores achieved on individual machines. In many ways, these games were like the classic arcade machines, which have leaderboards that can usually only be accessed by visiting the machines themselves. He wanted to give players a reminder of their scores and an incentive to return to the games on those machines by giving them updates on their leaderboard position, taunting them (quite literally) back to defend their ranking.

Taunting in the Leaderboard

In Package Person, there are three types of notifications a player can receive. First, when the player gets on the leaderboard, the player will receive a notification that essentially serves as a “receipt,” just reminding them of the placement on the leaderboard that they just achieved.

The second type of notification is received by all players on the leaderboard whose scores were bested by the newcomer. This notification informs the recipient of the name of the player who beat them, any message that the triumphant player has specified to be sent to lesser players, and the new placement on the leaderboard that they now occupy.

Finally, because the leaderboard only displays the top ten players, a notification goes out to any players who get knocked off of the leaderboard as more players score higher than them. In each case, depending on whether a player entered their email, phone number, or both, they will receive an email and/or text message with the appropriate information. All of these notifications also include the “arcade name” which serves to identify the installation of the game that the notification is notifying about and is configurable in the game’s settings.

Package Person Email Notifications

Reflections on Courier

If Courier were not an option, Matt would have had to use Twilio and Mailjet directly through their own APIs. He also would have needed to program all the logic for creating the messages in C# rather than allowing most of the logic for the message content to reside in the conditionals within the notification templates created in Courier. While it would have been doable, it would have taken much longer and he likely would have had to settle for a much simpler game due to the time constraints of the hackathon.

Thoughts for the Future

Given more time, Matt's ideal game notification experience for Package Person would include a Package Person mobile app. This app would keep track of all scores on all the machines that an individual has used and also would feature a global leaderboard for the greatest Package Person players across all installations of the game. Package Person players would receive push notifications through the app. He would do so by adding a mobile push channel to his Courier workspace.

When asked for his advice for future game creators, he said that if they have the patience and a willingness to read documentation and follow tutorials, anyone can easily get started developing games in engines such as Unity or others. The experience needed to build a game varies with the intended complexity of the game that is being built. Starting out creating small, simple games will help build the skills required for making more complex games down the line.

When Matt started learning Unity, he found the easiest way for him to learn was to think of a game idea and then just get right into attempting to create it, stopping to read documentation and searching for tutorials whenever he would hit a roadblock. By thinking of and pursuing simple game ideas that he wanted to make a reality, he was able to keep himself more invested in learning to use the engine than if he would have been following a basic tutorial series.

Overall, his takeaway from the experience is that it is important to pursue making something that you can call your own and be proud of in order to maintain your interest in continuously refreshing your skillset.

Start Routing Notifications Today!

Courier is a notification service that centralizes all of your templates and messaging channels in one place which increases visibility and reduces engineering time.

Sign-up

More from Notifications Landscape

pm-guide-2-thumbnail
PRODUCT MANAGEMENTNOTIFICATIONS LANDSCAPEGUIDE

The Product Manager's Guide To Building Notification Systems: Decoupling Templates From Code

This is part 2 of a 5 part series. In this article, we explain how decoupling notifications from your application’s codebase can help make notification projects less complex and less risky for product teams.

Anwesa Chatterjee

Anwesa Chatterjee

September 23, 2022

sub-prime-crisis-thumbnail
NOTIFICATIONS LANDSCAPE

The Sub-prime Crisis of Notifications

There is a direct connection between all the unnecessary notifications you get on your phone and the sub-prime financial crisis of 2008: lack of accountability for bad behavior.

Nočnica Mellifera

Nočnica Mellifera

September 14, 2022

Build your first notification in minutes

Send up to 10,000 notifications every month, for free.

Get started for free

Email & push notification

Build your first notification in minutes

Send up to 10,000 notifications every month, for free.

Get started for free

Email & push notification

Platform

Users

Content

Channels

Sending

Workflows

Preferences

Inbox

Workspaces

Observability

API Status

Changelog

© 2024 Courier. All rights reserved.