How to build Pokémon in RCS Business Messaging

How to build Pokémon in RCS Business Messaging
Sean Roades
Sean Roades
Dec 6, 202410 min read

Source code on Github, Demo video, and Pinnacle RCS Signup

Introduction

Every Monday, my co-founder Ivan and I have an internal hackathon where we try to build something new that pushes RCS Business Messaging (RBM) to its limits. This week, we decided to build a Pokémon game.

The Plan

We're going to build a simple game where users can fight and catch Pokémon natively in RBM. There will be the opprotunity to fight and catch Pokémon. We'll just use two Pokémon for now: Pikachu and Zigzagoon.

We'll use Pinnacle RCS for our messaging and python to code it up. To represent health, we can generate images of a health bar at certain values and overlay them on top of a base picture. To get attacks and other commands, like capturing Pokémon, we can use RBM'squick replies.

Getting started

To get started, we'll need to create an RCS agent. We can do this by going to Pinnacle RCS and signing up. Then we can go to the RCS dashboard and create a new agent.

We just need to fill out some basic details about our company and then wait for the carriers to approve our agent. This generally takes about 1-3 weeks but can be longer depending on the carrier.

Once our agent is approved, we can start building our Pokémon game.

The Code

First, I created a health bar and a base image for the Pokémon battle:

from PIL import Image, ImageDraw
from dataclasses import dataclass

The health will overlay on top of the base image I created in Figma with the gray health bars:

Now within main.py, we use this again in our logic for the game:

from time import sleep
from typing import Dict, Callable

You may notice that there are .mp4 files in this file--you can actually send videos in RCS! They appear like this:

It also supports sound--so I created attack animations on Runway ML and added Pokémon battle music to them.

Now when we receive a payload from the webhook such as "QUICK_ATTACK", we can play the corresponding video, and give options with quick replies to attack again. We can also roll the dice for critical hits and missed hits to make the game a bit more interesting. The zigzagoon will also attack our Pikachu. If we get it low enough, we'll have a better chance to capture it.

To capture, we show a series of video animations with the classic 3 tick shake animation. If the zigzagoon breaks free, we can continue the battle. If we successfully capture it, that's it!

Conclusion

But overall, this really comes down to a few things: quick replies, videos, photos, cards, and text through RBM. It turns out you can make some pretty interesting things outside the normal marketing use cases for RCS.

If you want to learn more about RCS, you can check out our Pinnacle RCS docs and sign up here to get started.

Questions?

If you have any questions, feel free to reach out to me on LinkedIn or shoot us an email.

Join our newsletter for RCS updates