Developer Spotlight: Winning a Game Jam with Jamstack and Durable Objects

Erwin van der Koogh
13 min readintermediate
--
View Original

Overview

This article highlights Guido Zuidhof's experience developing 'Full Tilt', a game that won first place in the innovation category at Ludum Dare 49. It showcases the use of Cloudflare Workers and Durable Objects to create a seamless gaming experience where players control a game on their computer using their smartphones.

What You'll Learn

1

How to use Cloudflare Workers and Durable Objects to create a real-time game server

2

Why using smartphones as motion controllers can enhance user experience in web games

3

How to implement a room code system for multiplayer games

Prerequisites & Requirements

  • Basic understanding of web development and game design concepts
  • Familiarity with Cloudflare Workers and Durable Objects(optional)

Key Questions Answered

How does the DeviceMotion API enhance gameplay in Full Tilt?
The DeviceMotion API allows the game to access smartphone sensors like the gyroscope and magnetometer, enabling players to use their phones as motion controllers. This results in a more immersive and responsive gaming experience compared to traditional input methods.
What are Durable Objects and how are they used in Full Tilt?
Durable Objects are a feature of Cloudflare Workers that allow the creation of stateful mini servers. In Full Tilt, they are used to manage game rooms where players can connect and communicate in real-time, ensuring low latency and a seamless gaming experience.
What challenges did Guido face when developing Full Tilt?
Guido faced challenges such as time constraints typical of game jams, the need to cut scope, and ensuring low latency communication between the smartphone and the game server. These challenges required innovative solutions using available web technologies.
How does the room code system work in Full Tilt?
The room code system generates a four-character code that uniquely identifies game rooms. This code allows players to join specific game sessions easily, facilitating quick access and minimizing confusion when entering codes.

Key Statistics & Figures

Game jam duration
48-72 hours
Guido completed the development of Full Tilt within this time frame during Ludum Dare 49.
Room code character set size
29 characters
The room code is generated from a limited character set to minimize confusion among players.
Potential unique rooms
approximately 700,000
The four-character room code allows for a significant number of unique game sessions.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Backend
Cloudflare Workers
Used to create serverless functions that manage game rooms and handle communication between devices.
Backend
Durable Objects
Facilitates the creation of stateful mini servers for managing real-time game sessions.
Frontend
Devicemotion API
Enables access to smartphone sensors for motion control in the game.
Frontend
Svelte
Framework used to develop the game and controller web app.
Frontend
Phaser
Game engine utilized to create the gameplay mechanics.

Key Actionable Insights

1
Utilizing smartphones as controllers can significantly improve user engagement in web games.
By leveraging built-in sensors, developers can create innovative gameplay experiences that feel more interactive and responsive, appealing to a broader audience.
2
Implementing a room code system can streamline multiplayer game sessions.
This approach reduces user friction by allowing easy access to game rooms, which is especially important in fast-paced gaming environments.
3
Using serverless architectures like Cloudflare Workers can simplify game server management.
This allows developers to focus on game development rather than server maintenance, making it easier to deploy and scale games quickly.

Common Pitfalls

1
Assuming that a single Durable Object can handle all game sessions without considering geographical distribution.
This can lead to high latency for players located far from the server. It's crucial to create Durable Objects in a way that minimizes latency by considering the user's location.

Related Concepts

Real-time Web Applications
Serverless Architecture
Game Design Principles