A 3D Racer on Playdate?! Here's the story of P-Racing.

A 3D Racer on Playdate?! Here's the story of P-Racing.

June 20, 2023

Hey! I’m Matteo, better known as RPDev, owner of Risolvi Productions.

I’m an indie software developer and author of P-Racing, a pseudo-3D racing game. P-Racing delivers a pure racing experience pushing Playdate to its limit.

P-Racing for Playdate

P-Racing

Once upon a time, there was a developer who really wanted to make a game but never had a chance to do that. He was focused mainly on programming and designing iOS apps.

Jokes aside, the journey of P-Racing begins on June 8 2021—that day Panic released the first Playdate Update and I was impressed by all these little, awesome games.

Inspirations

One game caught my attention: Daily Driver from Matt Sephton. A racing game for Playdate with 3D pre-rendered sprites that really inspired me.

At that time, I spent days brainstorming, prototyping and studying old consoles. The Game Boy Advance (GBA), a portable console comparable to the Playdate, was the perfect candidate to better understand how past games have solved specific problems.

Mario Kart: Super Circuit

Mario Kart: Super Circuit

Mario Kart: Super Circuit - a kart game for GBA - was definitely a source of inspiration. The combination of the “Mode 7” (a graphics mode that efficiently simulates a 3D environment) and pre-rendered sprites, is in fact the hallmark of P-Racing.

Early development

I started the development without really knowing where it would take me. The first public appearance of the game was on Reddit and the reaction was super positive but also skeptical.

“Can it run on Playdate?” was the question that kept me company for months.

That quickly became: “Can it run on a similar hardware?”, so I purchased a development board with the same CPU used on Playdate.

Early prototype

Early prototype

The early prototype was ugly, but it worked.

Playdate

8 months later, I received my Playdate and this was basically the result.

FPS is too low!

FPS is too low!

The game ran slow, really slow, just 8 FPS. It wasn’t a good day. I knew that was something wrong, so I continued to optimize the game.

The optimization process was very long and some game components were rebuilt from the ground-up.

The car (or kart?)

With P-Racing, there were lots of challenges, mostly technical ones. As previously mentioned, the car is generated in Blender (a 3D creation software) and it looks like this:

Car sprite

Car sprite

The car is captured at 36 different angles and then scaled into different sizes, Playdate can’t efficiently scale these images in real time so they’re all pre-rendered, resulting in a total of 1400 images (just for the car).

You can quickly identify two constraints here, CPU headroom and memory. P-Racing uses various strategies to save memory: * Secondary or big sprites like trees are exported in lower quality * Some images are compressed in a custom format developed specifically for the game

Controls

Solving technical challenges is not enough to make a good game, what it matters is how the game reacts when you control it.

Cutting a corner

Cutting a corner

Controls in P-Racing are quite simple, there’s no drift or boost system like other games, but it took a while to get a good feeling. In my mind, cutting a corner had to be easy and satisfying.

Steering graph

Steering graph

Here’s the math behind it, a simple function that interpolates the steering angle depending on speed.

Graphics

I haven’t mentioned the Playdate display yet, a 1-bit display is generally a limit; not in this case, pixel art or low-poly 3D models are just beautiful on it.

Visual hierarchy

Visual hierarchy

One of the key elements in a racing game is the asphalt, and I’ve been lucky enough since you can virtually achieve a solid gray on Playdate.

To build a visual hierarchy without colors, I’ve decided to carefully alternate dark and light layers. This approach allows to blend all the layers together and get a realistic look.

The City

In the middle of the development, a new idea came to my mind: adding a city with a bit of cinematics and story.

The city introduced new challenges because the map area was four times bigger than a regular track and full of buildings.

City

City

P-Racing makes extensive use of a grid-based partitioning system, as the player traverses the map, the game loads only the elements in the surrounding space. This concept is applied to rendering, collisions and AI-controlled objects.

Final thoughts

The Playdate community is extremely supportive. I want to thank all the folks at Panic and the people in the Playdate Squad Discord for making this game possible!

Check out P-Racing in Catalog