⚠️ WARNING: BETA SOFTWARERelay is currently in active development and is intended for developer beta testing only.
- 🚧 Unstable - APIs and features may change without notice
- 🐛 Bugs Expected - Code may contain errors or unexpected behavior
- 🧪 Not Production Ready - Use with caution in real projects
- 📝 Feedback Welcome - Please report issues and suggestions
Use at your own risk. We recommend thorough testing before any production use.
Relay is a Domain-Specific Language (DSL) and toolchain that simplifies multiplayer game development. Write your game logic in Relay's intuitive syntax, and the compiler generates production-ready server code, client SDKs, and networking protocols.
Building multiplayer games traditionally requires:
- Deep networking expertise (WebSockets, UDP, TCP)
- Complex state synchronization logic
- Client-side prediction and reconciliation
- Extensive boilerplate code
Relay abstracts all of this away.
1. Write game logic in Relay DSL (.relay files)
→ Define entities, actions, and events
2. Compile with Relay CLI
→ Generates server code (TypeScript/Node.js)
→ Generates client SDKs (TypeScript, Unity C#, Godot GDScript)
3. Integrate generated code
→ Drop into your game engine
→ Multiplayer works out-of-the-box
npm install -g @relay/clirelay init my-game
cd my-gamegame MyGame {
config {
maxPlayers: 2
turnBased: true
}
entity Player {
id: string
score: int = 0
}
action addScore(player: Player, points: int) {
validate {
points > 0
}
execute {
player.score += points
}
sync {
to_all reliable
}
}
}
# Check syntax
relay check src/game.relay
# Start dev server with hot reload
relay dev src/game.relay
# Build for production
relay build src/game.relay --target typescript- Strongly typed syntax prevents runtime errors
- IntelliSense support in VS Code
- Compile-time validation catches bugs early
- TypeScript/JavaScript - Web games
- Unity C# - Desktop and mobile
- Godot GDScript - Cross-platform
- Server-authoritative by default
- Automatic input validation
- Configurable rate limiting
- Hot reload during development
- Clear, actionable error messages
- Visual debugging tools
- Extensive documentation
relay/
├── packages/
│ ├── cli/ # Command-line interface
│ ├── compiler/ # DSL compiler
│ ├── runtime/ # WebSocket game server
│ └── client-sdk/ # Client libraries
├── examples/
│ └── tic-tac-toe/ # Example game
├── vscode-extension/ # VS Code support
└── docs/ # Documentation
| Command | Description |
|---|---|
relay init <name> |
Create new project |
relay check <file> |
Validate syntax and types |
relay build <file> |
Compile to production code |
relay dev <file> |
Start dev server with hot reload |
relay --help |
Show help |
entity Player {
id: string
position: Vector2 = (0, 0)
health: int range(0, 100) = 100
computed isAlive: bool => health > 0
}
action move(player: Player, direction: Vector2) {
validate {
player.isAlive
direction.magnitude <= 1.0
}
execute {
player.position += direction * 5.0
}
sync {
to_all unreliable
predict client
}
}
event playerDeath(player: Player, killer: Player?) {
sync {
to_all reliable
animation "death"
}
}
onPlayerJoin(player: Player) {
// Initialize new player
}
onTick(deltaTime: float) {
// Game loop
}
Install the Relay VS Code extension for:
- ✅ Syntax highlighting
- ✅ Code snippets
- ✅ IntelliSense (coming soon)
- ✅ Error diagnostics (coming soon)
Simple turn-based game demonstrating core concepts.
cd examples/tic-tac-toe
relay dev game.relayContributions are welcome! Please read our Contributing Guide first.
# Clone the repo
git clone https://github.com/relay-dsl/relay.git
# Install dependencies
npm install
# Build all packages
npm run build
# Run tests
npm testMIT License - see LICENSE for details.
Made with ❤️ by Buchori Muslim